lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <ser...@gmail.com>
Subject Re: Equality Numeric Query
Date Wed, 11 Nov 2009 14:16:56 GMT
Thanks !

If I use Yonik's approach, do I need to index the terms in a special way?

Shai

On Wed, Nov 11, 2009 at 4:13 PM, Uwe Schindler <uwe@thetaphi.de> wrote:

> Hi Shai,
>
> In 2.9.1, the approach using upper/lower bound identical and included is
> the
> official supported usage. The Query is optimized to rewrite efficient in
> this case (constant score term query).
>
> But you can also use a TermQuery like Yonik suggested and converting the
> numbers yourself.
>
> You will never hit any false terms, as the encoding clearly differentiate
> between precisions.
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
> > -----Original Message-----
> > From: Shai Erera [mailto:serera@gmail.com]
> > Sent: Wednesday, November 11, 2009 2:55 PM
> > To: java-user@lucene.apache.org
> > Subject: Equality Numeric Query
> >
> > Hi
> >
> > I index documents with numeric fields using the new Numeric package. I
> > execute two types of queries: range queries (for example, [1 TO 20}) and
> > equality queries (for example 24.75). Don't mind the syntax.
> >
> > Currently, to execute the equality query, I create a NumericRangeQuery
> > with
> > the lower/upper value being 24.75 and both limits are set to inclusive.
> > Two
> > questions:
> > 1) Is there a better approach? For example, if I had indexed the values
> as
> > separate terms, I could create a TermQuery.
> > 2) Can I run into precision issues such that 24.751 will be matched as
> > well?
> >
> > Shai
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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