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

Re: Multifield query parser

2010-12-18 Thread Ahmet Arslan
> While searching across multiple fields using > MultiFieldQueryParser, when a > doc is returned how do I know in this doc which field(among > the multiple > fields i queried over) contained the query term? You can extract that info from org.apache.lucene.search.Explanation. http://lucene.apache.

Multifield query parser

2010-12-18 Thread Pankaj Malhotra
Hi, While searching across multiple fields using MultiFieldQueryParser, when a doc is returned how do I know in this doc which field(among the multiple fields i queried over) contained the query term? Regards Pankaj

RE: Lucene multifield query problem

2007-12-19 Thread Rakesh Shete
java-user@lucene.apache.org > Subject: Re: Lucene multifield query problem > > Hi Rakseh, > > It just occurred to me that your code has > String searchCriteria = "Indoor*"; > > Assuming StandardAnalyzer used at indexing time, all text words were > lowercased.

RE: Lucene multifield query problem

2007-12-18 Thread Steven A Rowe
oleanClause.Occur.MUST_NOT);booleanQuery.add(topicQuery, > BooleanClause.Occur.MUST); > > This produces the following query: > +(i_title:Indoor* i_description:Indoor*) -i_published:false > +i_topicsClasses.id:1_1_*_* > But no results are fetched :( > > Any hints if am

Re: Lucene multifield query problem

2007-12-18 Thread Doron Cohen
> BooleanClause.Occur.MUST);booleanQuery.add(q3, > BooleanClause.Occur.MUST_NOT);booleanQuery.add(topicQuery, > BooleanClause.Occur.MUST); > > This produces the following query: > +(i_title:Indoor* i_description:Indoor*) -i_published:false > +i_topicsClasses.id:1_1_

RE: Lucene multifield query problem

2007-12-18 Thread Rakesh Shete
e, 18 Dec 2007 23:09:09 +0200 > From: [EMAIL PROTECTED] > To: java-user@lucene.apache.org > Subject: Re: Lucene multifield query problem > > Hi Rakesh, > > Perhaps the confusion comes from the asymmetry > between +X and -X. I.e., for the query: > A B -C +D > one

Re: Lucene multifield query problem

2007-12-18 Thread Doron Cohen
escription' field, > > eliminate if not published (-i_published:false) but should > > have topic id of the form "1_1_*_*" (i_topicsClasses.id:1_1_*_*) > > > > i_title:indoor* i_description:indoor* -i_published:false > > +i_topicsClasses.id:1_1_*_* returns me

RE: Lucene multifield query problem

2007-12-18 Thread Steven A Rowe
false > +i_topicsClasses.id:1_1_*_* returns me extra results which > should not be fetched. > > -- Regards, > Rakesh Shete > > > Subject: RE: Lucene multifield query problem > > Date: Tue, 18 Dec 2007 13:26:24 -0500 > > From: [EMAIL PROTECTED] > > To:

RE: Lucene multifield query problem

2007-12-18 Thread Rakesh Shete
-i_published:false) but should have topic id of the form "1_1_*_*" (i_topicsClasses.id:1_1_*_*) i_title:indoor* i_description:indoor* -i_published:false +i_topicsClasses.id:1_1_*_* returns me extra results which should not be fetched. -- Regards, Rakesh Shete > Subject: RE: Luce

RE: Lucene multifield query problem

2007-12-18 Thread Steven A Rowe
Rakesh Shete wrote: > > Hi all, > > I am facing problem with the following multifield query: > > i_title:indoor* i_description:indoor* -i_published:false > +i_topicsClasses.id:1_1_*_* > > The above query returns me even results which should not be > there. Ideall

Lucene multifield query problem

2007-12-18 Thread Rakesh Shete
Hi all, I am facing problem with the following multifield query: i_title:indoor* i_description:indoor* -i_published:false +i_topicsClasses.id:1_1_*_* The above query returns me even results which should not be there. Ideally I would like the query resullts as: (i_title:indoor

Re: Which field cause a hit in multifield query

2006-10-17 Thread Grant Ingersoll
Take a look at the explain functionality on the Searcher On Oct 17, 2006, at 5:43 AM, Mukesh Bhardwaj wrote: Hi, If I do a search such as "field1:jim OR field2:bob" is there any way to determine for each document that was a hit, which field caused the hit? Or rather, since they both migh

Which field cause a hit in multifield query

2006-10-17 Thread Mukesh Bhardwaj
Hi, If I do a search such as "field1:jim OR field2:bob" is there any way to determine for each document that was a hit, which field caused the hit? Or rather, since they both might, is there any easy way to find out which fields definitely cause a hit? Regards, --Mukesh

Re: MultiField Query

2006-07-17 Thread Michael D. Curtin
Erick Erickson wrote: I'm pretty sure your problem is Query q = new BooleanQuery... should be BooleanQuery q = new BooleanQuery... Good catch! That's why the add() method is barfing. The parse() thing, though, is probably a change to the QueryParser interface for 2.0. --MDC --

Re: MultiField Query

2006-07-17 Thread Erick Erickson
P.S. Are you sure you're looking at the 2.0 docs? I don't see any Query.parse(String, String, Analyzer) in the 2.0 docs. Rather, I see QueryParser(String field, Analyzer analyzer) and a non-static method parse(String parse). Best Erick

Re: MultiField Query

2006-07-17 Thread Erick Erickson
I'm pretty sure your problem is Query q = new BooleanQuery... should be BooleanQuery q = new BooleanQuery... Best Erick

Re: MultiField Query

2006-07-17 Thread Michael D. Curtin
[EMAIL PROTECTED] wrote: When I try this ( using Lucene 2.0 API ) I get the error: "..The method parse(String) is not applicable for arguments (String, String, StopAnalyzer) ... When I try this I get the error: The method add(TermQuery, BooleanClause.Occur) is undefined for type Query Could th

RE: MultiField Query

2006-07-16 Thread Rod.Madden
Could this be a 2.0 issue ? Rod -Original Message- From: Michael D. Curtin [mailto:[EMAIL PROTECTED] Sent: Sunday, July 16, 2006 8:04 PM To: java-user@lucene.apache.org Subject: Re: MultiField Query [EMAIL PROTECTED] wrote: > I am using Lucene 2.0 and trying to use the MultiFieldQueryPa

Re: MultiField Query

2006-07-16 Thread Michael D. Curtin
[EMAIL PROTECTED] wrote: I am using Lucene 2.0 and trying to use the MultiFieldQueryParser in my search. I want to limit my search to documents which have "silly" in "field1" ...within that subset of documents, I want documents which have "example" in "field2" OR "field3" The code fragment b

MultiField Query

2006-07-16 Thread Rod.Madden
I am using Lucene 2.0 and trying to use the MultiFieldQueryParser in my search. I want to limit my search to documents which have "silly" in "field1" ...within that subset of documents, I want documents which have "example" in "field2" OR "field3" The code fragment below is my attempt at this