Re: Using MultiField query with Boost factor

2013-06-07 Thread Ian Lea
Phrases or otherwise should be irrelevant other than titleq or addressq will be PhraseQuery or TermQuery or whatever. To get "A or B in either city or address", in my suggested solution, you'd need a BooleanQuery something like BooleanQuery bq = new BooleanQuery() Query caq = new whatever("A in c

Re: Using MultiField query with Boost factor

2013-06-07 Thread Abhishek Mallik
I understand but how to handle the situation where A or B may be phrase and present in both the fields. On Fri, Jun 7, 2013 at 7:12 PM, Ian Lea wrote: > Take a look at BooleanQuery and the setBoost() call on Query, and > BooleanClause.Occur for the MUST/SHOULD logic. > > Something along the lin

Re: Using MultiField query with Boost factor

2013-06-07 Thread Ian Lea
Take a look at BooleanQuery and the setBoost() call on Query, and BooleanClause.Occur for the MUST/SHOULD logic. Something along the lines of this pseudo code BooleanQuery bq = new BooleanQuery(); Query titleq = xxx; titleq.setBoost(somevalue) bq.add(titleq, must|should) Query addressq = yyy ad

Using MultiField query with Boost factor

2013-06-05 Thread Abhishek Mallik
I have indexed documents in Lucene based on three fields: *title*, *address* , *city*. Now I want to build my query say, *C A B *so that I can retrieve the documents as follows: *C* must be present in the *title* field of the documents and either *A* or *B* must be present in either of *address* a