Thanks for your response.....
I have indexed like Field.Text("size",docSize)
Field.Text runs the text through the analyzer, which may or may not strip numbers. In this case, you probably want to use Field.Keyword instead. Be sure, like the wiki link I sent below says, that you zero pad docSize so that all docSize values have the same string length, right justified, padded with leading zeroes.
You'll then be able to do range queries like size:[005 TO 020]. Handling the conversion so QueryParser automatically pads so a user can type size:[5 TO 20] is a different story, and requires subclassing QueryParser and overriding getRangeQuery to do the padding internally.
Erik
-----Original Message----- From: Erik Hatcher [mailto:[EMAIL PROTECTED] Sent: Monday, December 06, 2004 6:48 PM To: Lucene Users List Subject: Re: Size Search
On Dec 6, 2004, at 8:08 AM, Natarajan.T wrote:I have indexed File sizes....(like 2,4, 5,10,20,etc...)
How did you index them?
I want search results only the size range between 5 - 20.
How can I handle this???
See here:
http://wiki.apache.org/jakarta-lucene/SearchNumericalFields
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
