try to make use of noise words

Post Reply
rjshelq
Posts: 75
Joined: Thu Nov 17, 2005 3:25 pm

try to make use of noise words

Post by rjshelq »

Currently, Webinator is set via the admin menu to ignore search noise words. However, after looking at the search logs, it appears that for the special case in which a search is made up entirely of noise words (not within any quote marks), rather than issue an error message such as the present "Your query was all noise words", it would be better (in my application) to go ahead and use the given noise words to perform a search with keepnoise=1 and both rorder and rprox set to 1000.

Since this case seldom occurs, it seems that making the program fast during this special case is not very important, so repeating the search with altered parameters would be ok.

What would be the most practical way to perform that task? Can you provide a code example?
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

try to make use of noise words

Post by mark »

In the putmsg function check for the all noise message and set a flag for use later. Then after the search, if there were 0 hits check your flag. If set change the settings and do the search again.

<rex "all noise" $errmsg>
<if $ret ne "">
<$allnoise=y>
</if>
rjshelq
Posts: 75
Joined: Thu Nov 17, 2005 3:25 pm

try to make use of noise words

Post by rjshelq »

In putmsg, following the statement:

<if $thisErrmsg eq "Nothing to search for in query">

I commented out the original "all noise words" boxmessage and immediately after that boxmessage simply added two new statements:

<apicp "keepnoise" "on">
<search>

So far, this seems to accomplish the desired goal. Do you see any obvious flaws or shortcomings in this approach?
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

try to make use of noise words

Post by mark »

You don't want to invoke search or anything else complicated from putmsg.

In the search function after the <$noResults=1> line you
could check for $SaidNoise and change the settings and call search again.

<$noResults=1>
<if $SaidNoise eq "y">
<apicp "keepnoise" "on">
<$rorder=1000><!-- search will reapply rorder and rprox -->
<$rprox=1000>
<search>
<return><!-- don't do the previous tail part -->
</if>
rjshelq
Posts: 75
Joined: Thu Nov 17, 2005 3:25 pm

try to make use of noise words

Post by rjshelq »

Thanks... that works great. Do I need to reset keepnoise back off after the search, or is it automatically reset somewhere?
User avatar
John
Site Admin
Posts: 2597
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

try to make use of noise words

Post by John »

Every search is independent, so there's no need to reset.
John Turnbull
Thunderstone Software
Post Reply