Hi,

When doing some debugging regarding #725142: Using word "to" causes error, I discovered a bug in the following code (around line 1170 of luceneapi.module):

    if ($query instanceof Zend_Search_Lucene_Search_Query_Boolean) {
      $subqueries = $query->getSubqueries();
      if ($subqueries[0] instanceof Zend_Search_Lucene_Search_Query_Insignificant) {
        $query = FALSE;
      }
    }

With a stopword-only query all subqueries will be "insignificant" query objects. The $query->getSubqueries() call should still work (which is interesting for the other issue), it will just return an array with only such insignificant query objects. This case is then caught by the next line.
However, if just the first key is a stopword, e.g. when searching for "is wonderful" (with "is" defined as a stopword), the warning is still displayed and the search not executed. The attached patch (I hope attaching works for once) will fix this.
The second patch additionally displays a message if some (but not all) keywords were ignored.

Comments

cpliakas’s picture

Issue tags: +6.x-2.3

I really like the direction of these patches, and think they are a more complete fix to the ones applied to the 6.x-2.2 release. Flagging for adoption in 6.x-2.3. I haven't had a chance to thoroughly test them yet, but I will do so as soon as I get the time.

Thanks,
Chris

cpliakas’s picture

Status: Needs review » Reviewed & tested by the community

I applied the first patch, and it works perfectly. Thanks!

cpliakas’s picture

Status: Reviewed & tested by the community » Fixed

Patch committed at #391752.

Status: Fixed » Closed (fixed)
Issue tags: -6.x-2.3

Automatically closed -- issue fixed for 2 weeks with no activity.