lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Hadfield <m...@animarc.com>
Subject Re: query across fields?
Date Tue, 11 Oct 2005 20:12:11 GMT

thanks again!




Doug Cutting wrote:

> Marc Hadfield wrote:
>
>> In the SpanNear (or for that matter PhraseQuery), one can set a slop 
>> value where 0 (zero) means one following after the other.
>>
>> How can one differentiate between Terms at the **same** position vs. 
>> one after the other?
>
>
> The following queries only match "x" and "y" at the same position:
>
> Query pq = new PhraseQuery();
> pq.add(new Term("f", "x"), 0);
> pq.add(new Term("f", "y"), 0);
>
> Query sq =
>   new SpanNearQuery(new SpanQuery[]
>                       { new SpanTermQuery(new Term("f", "x")),
>                         new SpanTermQuery(new Term("f", "y")) },
>                     0, false);
>
> Doug
>
> ---------------------------------------------------------------------
> 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