lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmed El-dawy <>
Subject QueryParser with position increment > 1
Date Tue, 08 Nov 2005 07:03:31 GMT
  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)
Must be
      if (t.getPositionIncrement() != 0)

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".

Ahmed Saad

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message