lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claudio Corsi" <claudio.co...@gmail.com>
Subject SpanNearQuery: how to get the "intra-span" matching positions?
Date Fri, 30 May 2008 14:12:10 GMT
Hi all,
I'm querying my index with a SpanNearQuery built on top of some
SpanOrQuery. Now, the Spans object I get form the SpanNearQuery
instance returns me back the sequence of text spans, each defined by
their starting/ending positions. I'm wondering if there is a simple
way to get not only the start/end positions of the entire span, but
the single matching positions inside such span.

For example, suppose that a SpanNearQuery composed by 3 SpanTermQuery
(with a slop of K) produce as resulting span the terms sequence: <t0
t1 t2 t3 .... t100> (so start() == 0, end() == 100). I know that for
sure t0 and t100 have generated a match, since the span is "minimal"
(right?). But I also know that there is a 3th match somewhere in the
span (I have 3 SpanTermQuery that have to match). Is there a way to
discover it?

The application I'm building should highlights the single matches not
the entire spans, but at the same time it have to support the "near"
queries.

Thank you!

-- 
Claudio Corsi

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