lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vishal Bathija" <vishalbath...@gmail.com>
Subject Re: using boolean operators with the PhraseQuery
Date Wed, 19 Apr 2006 05:25:24 GMT
I tried using the boolean query to perform an OR  as below
BooleanQuery b1 = new BooleanQuery();
 b1.add(query,BooleanClause .Occur .SHOULD  );
 b1.add(query2,BooleanClause .Occur .SHOULD );
Hits hits = searcher.search(b1);		


System.out.println("Query= "+b1.toString() );

gave me
Query= contents:"provides  distribution" contents:"supports  distribution"

This returns 0 hits.

I am not sure why it returns 0, when I have both phrases present in the docs.


Vishal
On 4/19/06, Chris Hostetter <hossman_lucene@fucit.org> wrote:
>
> : The code above just adds the terms of phrase2 following the
> : terms  for phrase1.
> : Can you give me an example building a BooleanQuery OR  for the
> : newTerm1 and newTerm2.
>
> At no point does your code use a BooleanQuery ... have you looked at the
> javadocs for the BooleanQuery class?
>
>
>
> -Hoss
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


--
Vishal Bathija
Graduate Student
Department of Computer Science & Systems Analysis
Miami University
Oxford,Ohio
Phone: (513)-461-9239

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