lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sascha Janz" <Sascha.J...@gmx.net>
Subject Aw: Re: Re: combine to MultiTermQuery with OR
Date Wed, 11 Feb 2015 15:38:51 GMT
many thanks. the understanding of the meaning of  BooleanClause.Occur.SHOULD was my problem.


now the query works as expected.

greetings
Sascha
 
 

Gesendet: Dienstag, 10. Februar 2015 um 21:17 Uhr
Von: "Ian Lea" <ian.lea@gmail.com>
An: java-user@lucene.apache.org
Betreff: Re: Re: combine to MultiTermQuery with OR
Yep, that looks good to me.


--
Ian.


On Tue, Feb 10, 2015 at 5:01 PM, Sascha Janz <Sascha.Janz@gmx.net> wrote:
> hm, already thought this could be the solution but didn't know how to do the or Operation
>
> so i tried this
>
> BooleanQuery bquery = new BooleanQuery();
> bquery.add(queryFieldA, BooleanClause.Occur.SHOULD);
> bquery.add(queryFieldB, BooleanClause.Occur.SHOULD);
>
> this is the correct way?
>
>
> Gesendet: Dienstag, 10. Februar 2015 um 17:31 Uhr
> Von: "Ian Lea" <ian.lea@gmail.com>
> An: java-user@lucene.apache.org
> Betreff: Re: combine to MultiTermQuery with OR
> org.apache.lucene.search.BooleanQuery.
>
>
> --
> Ian.
>
>
> On Tue, Feb 10, 2015 at 3:28 PM, Sascha Janz <Sascha.Janz@gmx.net> wrote:
>>
>> Hi,
>>
>> i want to combine two MultiTermQueries.
>>
>> One searches over FieldA, one over FieldB. Both queries should be combined with "OR"
operator.
>>
>> so in lucene Syntax i want to search
>>
>> FieldA:Term1 OR FieldB:Term1, FieldA:Term2 OR FieldB:Term2, FieldA:Term3 OR FieldB:Term3...
>>
>> how can i do this?
>>
>> greetings
>> sascha
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

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

---------------------------------------------------------------------
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