flaxsearch/luwak — pull request #46 by james-jory (2014-08-08 15:55:02+00:00)
Title: Clear attributes in incrementToken to fix IllegalArgumentException.

We ran into IllegalArgumentException for an uninitialized position increment. Adding clearAttributes call to incrementToken solved this problem for us.

java.lang.IllegalArgumentException: Increment must be zero or greater: -1873026560
at org.apache.lucene.analysis.tokenattributes.PackedTokenAttributeImpl.setPositionIncrement(PackedTokenAttributeImpl.java:50)
at org.apache.lucene.analysis.util.FilteringTokenFilter.incrementToken(FilteringTokenFilter.java:58)
at uk.co.flax.luwak.presearcher.TermFilteredPresearcher.buildQuery(TermFilteredPresearcher.java:80)
at uk.co.flax.luwak.Monitor.buildQuery(Monitor.java:174)
at uk.co.flax.luwak.Monitor.match(Monitor.java:162)
at uk.co.flax.luwak.Monitor.match(Monitor.java:189)
...