lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shrinath.m" <>
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] <> 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,
and the parse method should go like this :
MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, s, fields, flags, new
StandardAnalyzer(Version.LUCENE_CURRENT, Collections.emptySet()));


View this message in context:
Sent from the Lucene - Java Users mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message