AND query in SHOULD

2007-11-22 Thread Rapthor
field : fields) { bq.add(new TermQuery(new Term(field, word)), Occur.SHOULD); } } Hits hits = indexSearcher.search(bq); What's wrong? How to achieve the functionality? Thanks in advance. -- View this message in context: http://www.nabble.com/AND-query-in-SHOULD-tf485571

Re: AND query in SHOULD

2007-11-22 Thread Daniel Naber
On Donnerstag, 22. November 2007, Rapthor wrote: > I want to realize a search that finds the exact phrase I provide. You simply need to create a PhraseQuery. See http://lucene.zones.apache.org:8080/hudson/job/Lucene-Nightly/javadoc/org/apache/lucene/search/PhraseQuery.html Regards Daniel --

Re: AND query in SHOULD

2007-11-22 Thread Rapthor
scription, 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

Re: AND query in SHOULD

2007-11-22 Thread Erick Erickson
n: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 messa

Re: AND query in SHOULD

2007-11-22 Thread Shai Erera
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 multi

Re: AND query in SHOULD

2007-11-24 Thread Rapthor
r.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) { >> >

Re: AND query in SHOULD

2007-11-24 Thread Shai Erera
Rapthor <[EMAIL PROTECTED]> wrote: > >> > >> > > >> > 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: > >> > > >> > Phrase