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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to