lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eran Sevi <>
Subject New SpanAndQuery implementation
Date Wed, 26 Aug 2009 13:26:12 GMT
Hello all,

Currently the only way to simulate a SpanAndQuery was to use SpanNearQuery
with a large enough slop.
The problem with this method is that the returned span contains all the
positions between the AND clauses. This makes it not effective for
highlighting or for knowing what was the original terms that were used in
the query. Also there is the issue of order which shouldn't matter for AND

I've created a new SpanAndQuery implementation and would like to contribute
My solution returns each matched hit as a different span.

For example:

doc1: a b c d
doc2: a d b c a

a span near query for ( a NEAR c) will result in two spans: doc1:"a b c" and
doc2:"a d b c"
with the new span and query the result will be: doc1: "a" "c", doc2: "a" "c"
"a" (with the correct positions of each span).

How should contribute it?
I know that Lucene.Net only follows the jave Lucene project but if someone
is interested in my implementation they can import it to java and add it to
the java version (although changes are probably required because of the
versions differences between java and .Net).


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message