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, Multiple Fields
Date Thu, 12 May 2016 19:35:31 GMT
I'm very interested in SpanNearQuery, because it allows for quite 
powerful phrasal searching.

However, unlike BooleanQuery, there doesn't seem to be any way to have 
it search multiple fields.

I thought I might be able to wrap multiple SpanNearQueries, each of them 
searching a different field, in an outer SpanOrQuery, but that raises an 
exception:

java.lang.IllegalArgumentException: Clauses must have same field.
     at 
org.apache.lucene.search.spans.SpanOrQuery.addClause(SpanOrQuery.java:63)

So, is there any way to do what I'd like to do?  Would it require 
performing multiple search operations, once per field, and then 
combining the results from those multiple queries?

---------------------------------------------------------------------
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