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 Mon, 24 Apr 2006 14:24:20 GMT
How do I get the spans (getSpans()) if I use the SpanNearQuery as a
clause (subquery) in a BooleanQuery

I currently have

SpanQuery [] clauses1 = new SpanQuery[phraseTerms1.length];
for(int count =0; count< phraseTerms1.length; count++)
{
clauses1[count]=phrase1[count];
}
SpanQuery [] clauses2 = new SpanQuery[phraseTerms2.length];
for(int count =0; count< phraseTerms2.length; count++)
{
clauses2[count]=phrase2[count];
}
SpanNearQuery near1 = new SpanNearQuery(clauses1, 0, true);
SpanNearQuery near2 = new SpanNearQuery(clauses2, 0, true);
						
I need the spans of either clause1 or clause2.

Vishal

On 4/22/06, Paul Elschot <paul.elschot@xs4all.nl> wrote:
> On Friday 21 April 2006 21:11, Vishal Bathija wrote:
> > Hi,
> > I am trying to get the frequency of a phrase using the SpanNearQuery.
> > How can I use SpanNearQuery for boolean queries. The code I have is
> > for a single query. How can I extend this for multiple queries
>
> You can use SpanNearQuery as a clause (subquery) in a BooleanQuery
> or in a SpanOrQuery.
> See BooleanQuery.add() and the constructor of SpanOrQuery.
>
> Regards,
> Paul Elschot
>
> ---------------------------------------------------------------------
> 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