Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

Support for NumericRangeQuery in QueryParser

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


jochenhebbrecht at gmail

Jun 12, 2012, 12:29 AM

Post #1 of 3 (181 views)
Permalink
Support for NumericRangeQuery in QueryParser

Hi,

I'm currently reading "Lucene in action (2nd edition)". At page 105 -
section 3.5.4, I'm reading the following paragraph:

---

QueryParser won’t create a NumericRangeQuery for you. This is because
Lucene currently doesn’t keep track of which of your fields were indexed
with NumericField, though it’s possible this limitation has been corrected
by the time you read this.

---

I'm using version 3.2 of Lucene and I'm not able to "queryparse" a
NumericRange syntax query. Can somebody tell me if this is already fixed in
Lucene? And most of all: in which version :-). I cannot find it using
Google :-( ...

Thanks!

Jochen


uwe at thetaphi

Jun 12, 2012, 4:10 AM

Post #2 of 3 (174 views)
Permalink
RE: Support for NumericRangeQuery in QueryParser [In reply to]

Hi Jochen,

the flexible query parser in contrib allows for numeric fields (you need to
configure it to "know" the types of fields, e.g. which fields are long
float,...). Alternatively use the code from my "Java Magazin" article a few
years ago and customize core's QueryParser by overriding the factory method
that creates range queries (I assume you are German and know this IT
magazine).

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe [at] thetaphi


> -----Original Message-----
> From: Jochen Hebbrecht [mailto:jochenhebbrecht [at] gmail]
> Sent: Tuesday, June 12, 2012 9:30 AM
> To: java-user [at] lucene
> Subject: Support for NumericRangeQuery in QueryParser
>
> Hi,
>
> I'm currently reading "Lucene in action (2nd edition)". At page 105 -
section
> 3.5.4, I'm reading the following paragraph:
>
> ---
>
> QueryParser won't create a NumericRangeQuery for you. This is because
> Lucene currently doesn't keep track of which of your fields were indexed
with
> NumericField, though it's possible this limitation has been corrected by
the
> time you read this.
>
> ---
>
> I'm using version 3.2 of Lucene and I'm not able to "queryparse" a
> NumericRange syntax query. Can somebody tell me if this is already fixed
in
> Lucene? And most of all: in which version :-). I cannot find it using
Google :-( ...
>
> Thanks!
>
> Jochen


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


jochenhebbrecht at gmail

Jun 12, 2012, 4:26 AM

Post #3 of 3 (170 views)
Permalink
Re: Support for NumericRangeQuery in QueryParser [In reply to]

Hi Uwe,

Thanks for your answer. The alternative way was already familiar to me, but
thanks anyway ;-)!
I didn't know the "contrib" folder :-).

Thanks for your reply.

Kind regards,
Jochen

PS: I'm Belgian ;-) ...


2012/6/12 Uwe Schindler <uwe [at] thetaphi>

> Hi Jochen,
>
> the flexible query parser in contrib allows for numeric fields (you need to
> configure it to "know" the types of fields, e.g. which fields are long
> float,...). Alternatively use the code from my "Java Magazin" article a few
> years ago and customize core's QueryParser by overriding the factory method
> that creates range queries (I assume you are German and know this IT
> magazine).
>
> Uwe
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe [at] thetaphi
>
>
> > -----Original Message-----
> > From: Jochen Hebbrecht [mailto:jochenhebbrecht [at] gmail]
> > Sent: Tuesday, June 12, 2012 9:30 AM
> > To: java-user [at] lucene
> > Subject: Support for NumericRangeQuery in QueryParser
> >
> > Hi,
> >
> > I'm currently reading "Lucene in action (2nd edition)". At page 105 -
> section
> > 3.5.4, I'm reading the following paragraph:
> >
> > ---
> >
> > QueryParser won't create a NumericRangeQuery for you. This is because
> > Lucene currently doesn't keep track of which of your fields were indexed
> with
> > NumericField, though it's possible this limitation has been corrected by
> the
> > time you read this.
> >
> > ---
> >
> > I'm using version 3.2 of Lucene and I'm not able to "queryparse" a
> > NumericRange syntax query. Can somebody tell me if this is already fixed
> in
> > Lucene? And most of all: in which version :-). I cannot find it using
> Google :-( ...
> >
> > Thanks!
> >
> > Jochen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>
>

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.