Page 1 of 1

try to make use of noise words

Posted: Wed Apr 18, 2012 10:54 pm
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?

try to make use of noise words

Posted: Thu Apr 19, 2012 8:26 am
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>

try to make use of noise words

Posted: Thu Apr 19, 2012 10:47 am
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?

try to make use of noise words

Posted: Fri Apr 20, 2012 12:25 pm
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>

try to make use of noise words

Posted: Sat Apr 21, 2012 11:38 am
by rjshelq
Thanks... that works great. Do I need to reset keepnoise back off after the search, or is it automatically reset somewhere?

try to make use of noise words

Posted: Sat Apr 21, 2012 11:46 am
by John
Every search is independent, so there's no need to reset.