You will likely need to create n-grams from the user query and from that construct a sloppy PhraseQuery.

There is an n-gram Filter in the contrib/analysis package (I think it is called the ShingleFilter)


On Feb 19, 2009, at 7:19 AM, Ian Vink wrote:

Once my app gets the query string from the user, is there a way to tell the query engine to only return documents where these words are at most 5 words apart? I can't tell the user to change their query, I have to do it server
side.
Is so do I have to add anything to my index to let Lucene know about
positions of the terms when it indexes?

Thanks,
Ian Vink
http://BahaiResearch.com

--------------------------
Grant Ingersoll
http://www.lucidimagination.com/

Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids) using Solr/Lucene:
http://www.lucidimagination.com/search


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to