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
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
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
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
> 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.
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
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.
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
> 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_
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
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
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:
-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
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
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
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
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
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
--
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
I'm pretty sure your problem is
Query q = new BooleanQuery...
should be
BooleanQuery q = new BooleanQuery...
Best
Erick
[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
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
[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
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
24 matches
Mail list logo