lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shrinath.m" <shrinat...@webyog.com>
Subject Re: Re: How to do an all field search without using a "catchall" fieldor "MultiFieldQueryParser" ?
Date Thu, 17 Mar 2011 13:45:35 GMT
On Thu, Mar 17, 2011 at 7:07 PM, Ian Lea [via Lucene] <
ml-node+2693447-1032232993-376162@n3.nabble.com> wrote:

> static Query parse(Version matchVersion, String[] queries, String[]
> fields, Analyzer analyzer)
>           Parses a query which searches on the fields specified.
>


Well, at the end of the day its either I make an array of Boolean.Occur
or I make an array of Queries to go with the fields right ?
Nothing helps me from creating an unnecessary array of repetitive elements ?
:(

So if I have 2 fields "name" and "address",
and if the query is "shrinath",

then there should be arrays like this :
    private static String[] fields = {"name", "address"};
    private static BooleanClause.Occur[] flags= {BooleanClause.Occur.SHOULD,
BooleanClause.Occur.SHOULD};
and the parse method should go like this :
MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, s, fields, flags, new
StandardAnalyzer(Version.LUCENE_CURRENT, Collections.emptySet()));

:(
-- 
Regards
Shrinath.M


--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-do-an-all-field-search-without-using-a-catchall-field-or-MultiFieldQueryParser-tp2681163p2693475.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message