lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rapthor <rapt...@lycos.de>
Subject Re: AND query in SHOULD
Date Thu, 22 Nov 2007 12:17:50 GMT

There is no option to provide an Occur.SHOULD to the PhraseQuery. So where
does it go? I changed the source to look like this:

PhraseQuery pq = new PhraseQuery();
for (String word : words) {
	for (String field : fields) {
		pq.add(new Term(field, word));
	}
}
Hits hits = indexSearcher.search(pq);

However, I get an exception:
java.lang.IllegalArgumentException: All phrase terms must be in the same
field: description:green tree

I don't understand how to a) search for combinations of words like "green
tree", b) search in multiple fields (description, text, ...) and c) search
by a SHOULD restriction.
-- 
View this message in context: http://www.nabble.com/AND-query-in-SHOULD-tf4855719.html#a13895700
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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