On Thu, Mar 17, 2011 at 7:07 PM, Ian Lea [via Lucene] <
ml-node+2693447-1032232993-376...@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.

Reply via email to