lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Bigham <dani...@wolfram.com>
Subject SpanNearQuery With Inner Phrases
Date Thu, 12 May 2016 20:06:53 GMT
When constructing boolean queries, the "parts" can themselves be 
phrases, and can be parsed as follows:

QueryBuilder(analyzer).createPhraseQuery(fieldName, phrase)

The above call is handy in that, even if the part is a single word, it 
will get tokenized and turned into the appropriate term.

If I'd like to do something similar -- a SpanQuery where the "parts" can 
be phrases, how would I do that?

A SpanQuery can't have a PhraseQuery as one of its parts, which seems to 
rule out using QueryBuilder.createPhraseQuery.

One idea would be to continue using QueryBuilder.createPhraseQuery but 
then manually convert that into a SpanNearQuery.

What's the right way to do this?

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


Mime
View raw message