lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmed El-dawy <aseld...@gmail.com>
Subject QueryParser with position increment > 1
Date Tue, 08 Nov 2005 07:03:31 GMT
Hello,
  When I use QueryParser with phrase queries it makes some errors. It
assumes that positionIncrement must be 0 or 1. In my case it can be
greater than one (in case of stop words). It handles all non ONE
positionIcrement as zero.
The error is at lines 384, 385
      if (t.getPositionIncrement() == 1)
        positionCount++;
Must be
      if (t.getPositionIncrement() != 0)
        positionCount+=t.getPositionIcrement();

It assumes that the phrase "the quick brown" has only one
positionCount. "quick" returns positionIncrement=2 (handled as Zero),
and "brown" returns positionIncrement=1. It generates a BooleanQuery
instead of MultiPhraseQuery and it matches documents like "quick".

--
regards,
Ahmed Saad

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message