lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <ikoelli...@daegis.com>
Subject RE: Possible to use span queries to avoid stepping over null index positions
Date Mon, 29 Aug 2011 15:29:32 GMT
I don’t think I can use span-term(null_1). That is not a specific value I indexed, but a
value put into the index when we call token.setPositionIncrement(2) on the first token in
the token stream, essentially skipping a position.

-----Original Message-----
From: Trejkaz [mailto:trejkaz@trypticon.org]
Sent: Saturday, August 27, 2011 9:59 AM
To: java-user@lucene.apache.org
Subject: Re: Possible to use span queries to avoid stepping over null index positions

On Sat, Aug 27, 2011 at 2:30 AM,  <ikoelliker@daegis.com> wrote:
> Hello,
> In our indexes we have a field that is a combination of other various metadata fields
(i.e. subject, from, to, etc.). Each field that is added has a null position at the beginning.
As an example, in Luke the field data looks like:
>
> null_1 this is a test subject null_1 ikoelliker email address
>
> If someone searches this field using a NEAR or WITHIN style query for "subject email"~10.
This message will be found. Is it possible to use Span Queries to avoid stepping over null
position?

Seems like you could:

    span-not(
      span-near(
        span-term(subject)
        span-term(email)
        10 ),
      span-term(null_1))

This is similar to tricks I have seen to return span matches in the
same sentence.

TX

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