stats

Post Reply
User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

stats

Post by Thunderstone »



Hi!

Does anyone know if it is possible to find out what people are searching for
on your site. I would also like to know how many searches were done etc...

TIA

Roshayne


User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

stats

Post by Thunderstone »



You can perform search logging to a table provided for that purpose. It
is not done by default.

There's a table called "querylog" in the database which is for use
in query logging. It has 3 fields:
id counter
Client varchar
Query varchar
You just do something like:

<if $query ne "">
<sql "insert into querylog values(counter,$REMOTE_HOST,$query)"></sql>
</if>

Just after the "<search>" call in the "main" function of the default
search script. You could log any other desired information in the
Client and Query fields. You could also do it at some other point in
the script if you wanted to log different things.

Read the log with SQL select statements:
gw -s "select * from querylog"
Or get fancy and write a Vortex script to process and print it out.





User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

stats

Post by Thunderstone »



Thanks! I found the following error message.

<!-- 015 /webinator/wts/searchme:472: Needed parameters not supplied in
the function execntexis -->

Line 472 is the line after the <search> call in the main function:

<sql "insert into querylog values(counter,$REMOTE_HOST,$query)"></sql>

so something isn't defined.

I searched the webinator web site, both user questions and documentation,
and did not find a solution for this error message.

On Wed, 3 May 2000, Thunderstone Technical Support wrote:





User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

stats

Post by Thunderstone »




One or more of the variables being inserted has no values (this is
different from having 1 empty value), and an INSERT statement requires
all the parameters to have values. (A SELECT does not; this is used
in combination with $null to dynamically alter the query. See the
Vortex manual, http://www.thunderstone.com/vortexman/node36.html.)

Since you've checked that $query is non-empty before this insert, it's
possible that $REMOTE_HOST isn't being set by the web server. Just
before the insert, add the following:

<if $REMOTE_HOST eq ""><$REMOTE_HOST = $REMOTE_ADDR></if>
<if $REMOTE_HOST eq ""><$REMOTE_HOST = "Unknown"></if>

to ensure that $REMOTE_HOST is set to some value. You can also try
setting <$null = > to pass no-value variables as empty strings.

-Kai



Post Reply