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: http://jakarta.apache.org/lucene/docs/queryparsersyntax.html 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: http://today.java.net/pub/a/today/2003/11/07/QueryParserRules.html You'll need to override the getRangeQuery() method. Have fun, Ype --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
