Page 1 of 1
Best Bets - Hit Count is 0
Posted: Wed Aug 09, 2006 1:58 pm
by velevi
Whenever we have a Best Bet item match the keywords of the query, the Hit Count is set to 0 (does not show the real hit count).
We have a special Best Bet behavior in the "getbestbet" function, where if the profile's "Linear Search" option is set to Yes, the function uses "where Keywords likein" in the SQL statement, otherwise just "where Keywords like".
What is wrong with that set-up?
Thank you tremendously!
Ivan
Best Bets - Hit Count is 0
Posted: Wed Aug 09, 2006 2:06 pm
by mark
Hard to say exactly in your customized script. You probably did some looping operation which changed one or more of $loop, $next, $indexcount etc.
Best Bets - Hit Count is 0
Posted: Wed Aug 09, 2006 2:17 pm
by velevi
Nothing else has really changed that should affect the searching.
ALSO in the 'dowalk' script, I was told to add the following, to enable the 'likein' SQL operator:
<sql db=$dbother novars "create metamorph counter index xmmcbestbetskeywords on bestbets(Keywords)">
</sql>
__________ ORIGINAL 'search' ____________________
<a name=getbestbet place>
<local shtitle shdesc shurl>
<$bbresult=>
<if $havebbtable eq "n"><return></if>
<if $havebbtable eq "">
<sql novars "select NAME from SYSTABLES where NAME in ('bestbets','groups')"></sql>
<if $loop eq 2><$havebbtable=y><else><$havebbtable=n><return></if>
</if>
<sql row "select Title, Url, Descr, Groupid, Keywords
from bestbets
where Keywords like $sq and Groupid=$gid
order by Priority desc">
<$bbnum=$next>
<sql max=1 "select Resulttype,Groupname from groups where id=$gid"></sql>
<bbresult>
</sql>
______________ CUSTOMIZED 'search' __________________
<a name=getbestbet place>
<local shtitle shdesc shurl>
<$bbresult=>
<if $havebbtable eq "n"><return></if>
<if $havebbtable eq "">
<sql novars "select NAME from SYSTABLES where NAME in ('bestbets','groups')"></sql>
<if $loop eq 2><$havebbtable=y><else><$havebbtable=n><return></if>
</if>
<if $SSc_allinear eq "Y"> <!-- only then use LIKEIN -->
<sql row "select Title, Url, Descr, Groupid, Keywords
from bestbets
where Keywords likein $sq and Groupid=$gid
order by Priority desc">
<$bbnum=$next>
<sql max=1 "select Resulttype,Groupname from groups where id=$gid"></sql>
<bbresult>
</sql>
<else> <!-- use LIKE should not affect profiles that do not have linear search enabled -->
<sql row "select Title, Url, Descr, Groupid, Keywords
from bestbets
where Keywords like $sq and Groupid=$gid
order by Priority desc">
<$bbnum=$next>
<sql max=1 "select Resulttype,Groupname from groups where id=$gid"></sql>
<bbresult>
</sql>
</if>
</a>
Best Bets - Hit Count is 0
Posted: Wed Aug 09, 2006 4:13 pm
by mark
What version of scripts?
Did you make any other changes?
Does the original script work correctly when there's a best bet match?
Best Bets - Hit Count is 0
Posted: Thu Aug 10, 2006 8:28 am
by velevi
<!--
Webinator 5.1.10
$Id: search4.src,v 2.171 2005-02-10 15:39:38-05 kai Exp $
-->
The original seems to work as it has to (if any of the keywords of a best bet item are in the query phrase, the best bet item shows).
Also the modified version seems to work in some cases but not in others. Imagine, we have two best bets set on two different URLs. However, one best bet item contains two keywords "red carrot" and the other best bet item contains these two plus a third additional word: "red carrot stick".
So, when searching with the modified script with the "likein" operator:
* searching on "red carrot" yields the correct best bet item AND the correct hit count
* searching on "red carrot stick" yields both best bet items but a "0" hit count.
* howeverr, searching on "carrot red stick" (mixed order) actually produces the right results/best bets/hit count.
I have no clue why this could be. The only idea that comes to mind is that we have a synonym/equivalence entry on "red carrot stick" ("RCSt,red carrot stick"), which might be messing things up. By default, I have set the script to use our user-defined equivalences file, (and in a special case to use both the built-in and user-defined dictionaries). This should not affect the results thought, since I am not "replacing" "red carrot stick" with "RCSt", but I am expanding the set of words to be searched on (that is, search on either "RCSt" or "red carrot stick").
Best Bets - Hit Count is 0
Posted: Thu Aug 10, 2006 10:56 am
by mark
Sounds like the best bet is a red-herring. The problem is the equivalence. Searching for
red carrot
looks for the words "red" and "carrot" anywhere in the document in any order. Searching for
red carrot stick
searches for the exact phrase "red carrot stick" which probably doesn't occur.