lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: Re: How to do an all field search without using a "catchall" fieldor "MultiFieldQueryParser" ?
Date Thu, 17 Mar 2011 14:10:51 GMT
if you go the MultiFieldQueryParser route you are going to need some
arrays. You specifically asked if you needed an array of
BooleanClause.Occur and the answer to that specific question is still
no.

I can't tell you any more on this than you can get from reading the javadocs.


--
Ian.



On Thu, Mar 17, 2011 at 1:45 PM, shrinath.m <shrinath.m@webyog.com> wrote:
> 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.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message