lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: phrase search with custom TokenFilter
Date Wed, 19 Mar 2008 00:20:20 GMT

You're going to want to change your TokenFilter so that it emits the split 
pieces tokens immediately after the original token and with a 
positionIncrement of "0" .. don't buffer then up and wait for the entire 
stream to finish first.

it true order of the tokens in the tokenstream and the positionIncrement 
are what matter when doing a PhraseQuery -- not the start/end offsets

Incidently: you might want to take a look at Solr's WordDelimiterFilter, 
both as an example of how to do this, and because it may already meet all 
the needs you've anticipated and some you might not have thought of but 
might want to use once you take a look at them...


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

View raw message