lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <paul.elsc...@xs4all.nl>
Subject Re: Adding support for NOT NEAR construct?
Date Wed, 17 Oct 2007 18:45:47 GMT
Dave,

One can use SpanNotQuery to get NOT NEAR by using this generalized structure:

SpanNot(foo, SpanNear(foo, bar, distance))

This also allows for example:

SpanNot(two, SpanNear(one, three, distance))

Btw. I don't know of any query language that has this second form.

AND NOT normally does not work for this because it works on doc level
and not within the matching text of a field.


Regards,
Paul Elschot


On Wednesday 17 October 2007 17:57:21 Dave Golombek wrote:
> We've run into a situation where having "NOT NEAR" queries would really
> help. I haven't been able to find any discussion of adding this to Lucene
> in the past, so wanted to ask if people had any comments about it before I
> started trying to make the change.
>
> I've looked at NearSpansUnordered and it seems that reversing the logic in
> atMatch() would go a long way towards implementation; NearSpansOrdered is a
> bit harder, depending upon the exact semantics of "NOT NEAR" that we want
> to implement. For queries, I was thinking that either "foo bar"~-10  or
> "foo bar"!~10 might be reasonable; the former should be pretty easy to
> parse.
>
> Does this sound reasonable? Something for contrib?
>
> Thanks,
> Dave Golombek
> Senior Software Engineer
> Black Duck Software, Inc.
>
> daveg@blackducksoftware.com
> T +1.781.810.2079
> F +1.781.891.5145
> C +1.617.230.5634
> http://www.blackducksoftware.com
>
>
>
> ---------------------------------------------------------------------
> 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