searching for words starting w/ "mo" gives incorrect number matching docs

cindy_walker
Posts: 36
Joined: Tue Jul 24, 2001 2:16 pm

searching for words starting w/ "mo" gives incorrect number matching docs

Post by cindy_walker »

Many of our webmasters add an extra line like this:

<input type=hidden name=uq value="www.dot.ca.gov/dist9%">

to limit searches to just their pages. I've found that if you search for words starting with "mo" the result page will state a higher number of matching documents than actually exist. Then when you select page 2, etc of results you see the message "No documents match the query". I tested extensively and only the words mono, move and mode cause this problem. You can see this for yourself here:

http://www.dot.ca.gov/dist9/temp/dist_9 ... 9_info.htm (be sure to select "this site").

What is it about words starting with "mo" causes this? More to the point, how can problem this be solved?

Thank you,

Cindy
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

searching for words starting w/ "mo" gives incorrect number matching docs

Post by Kai »

It's not words starting with "mo" that cause this, but the fact that the search is restricted via $uq. The number of hits (and thus the next-page links) are determined from what the index says the total hit count is. In some instances -- such as when searching "within sentence/paragraph/line" -- the index can only estimate the hit count, and the search script corrects for this by doing a select count(*).

Restricting the query with $uq is another of these cases, but the search script didn't account for it. You can fix this by adding the following lines to the <A NAME=fpar> function in your search script:

<IF $uq neq "" or $tq neq "" or $dq neq "">
<$count = 1>
</IF>
cindy_walker
Posts: 36
Joined: Tue Jul 24, 2001 2:16 pm

searching for words starting w/ "mo" gives incorrect number matching docs

Post by cindy_walker »

That did the trick! Thank you.