lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ype Kingma <>
Subject Re: Range Query Sombody HELP please
Date Thu, 27 May 2004 07:15:49 GMT
On Thursday 27 May 2004 07:00, Karthik N S wrote:
> Hi
> Lucene developers
> Is it possible to do Search and retrieve relevant information on the
> Indexed Document
> within in specific range settings which may be  similar to an
> Query in SQL  =  select  *  from BOOKSHELF where  book1  between 100 and
> 200
> ex:-
>        "search_word"  ,   Book between  100   AND   200
> [ Note:- where Book uniquefield  hit info which is already Indexed ]

The query parser can construct this query for you (assuming search_word
is in the query default field):

+search_word +(book:[100 TO 200])

See also:

One problem you might run into is that Lucene does not support numbers
directly, only strings are indexed. You can index these numbers with sufficient
zero's prefixed and add these prefix zero's in the query.

Erik Hatcher wrote an article on how to do make the query:
You'll need to override the getRangeQuery() method.

Have fun,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message