You can do this with a PhraseQuery[1]. Just add more terms with position 0.
[1] http://lucene.apache.org/core/4_3_0/core/org/apache/lucene/search/PhraseQuery.html#add(org.apache.lucene.index.Term, int) On Mon, Jun 3, 2013 at 6:46 AM, Lance Norskog <[email protected]> wrote: > What is a Lucene query that will find two words at the same term position? > Is there a class that will do this? Is the feature available from the > Lucene query syntax or any other syntax parsers? > > For example, if I'm using synonyms at index time I should get the base > word and all synonyms at the same position. What is a query that will find > a document with the synonym substituted, but will not find a document which > has the base word and a synonym at two different positions? > > Thanks, > > Lance. > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > java-user-unsubscribe@lucene.**apache.org<[email protected]> > For additional commands, e-mail: > [email protected].**org<[email protected]> > >
