Arthur Prokosch wrote:

> have you verified on either release that a word giving a null list ANDed
> with a word giving a populated list returns no matches?  That is, have you
> verified that this bug is completely specific to my machine; or, have you
> duplicated it on another machine?
>

Hello,
    I just read this thread. I can confirm that the problem noticed by
Arthur exists in my setup, 3.2.0b2.

The problem is that if you look for  XXX and YYY, XXX has matches
in some documents, while YYY has NO matches in ANY document in the
database, the rearch will result in the same result as a search for XXX
alone.

I think I found the "guilty" code at line 353 of htsearch/parser.cc

    if (!wordList || wordList->Count() == 0)
      {
      // We can't score an empty list, so this should be ignored...
      list->isIgnore = 1;
      return;
      }

Here a word having no match has its resultlist set to be ignored, and
at line 434 of the same file  you can find the code that evaluates the
AND operator.

    // If either of the arguments is set to be ignored, we will use the
    // other as the result.
    //
    if (l1->isIgnore)
      {
      stack.push(l2);
      delete l1;
      return;
     }
   else if (l2->isIgnore)
    {
    stack.push(isand ? l1 : result);
    delete l2;
    return;
    }

I'd like to try a patch for this, but the parser code is not so clear to me
and I fear to have side effects by changing it.
Any ideas ?

Bye
    Lorenzo

Reply via email to