FAQ
Hi All,



I have indexed File sizes....(like 2,4, 5,10,20,etc...)



I want search results only the size range between 5 - 20.



How can I handle this???





Natarajan.

Search Discussions

  • Erik Hatcher at Dec 6, 2004 at 1:18 pm

    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: lucene-user-unsubscribe@jakarta.apache.org
    For additional commands, e-mail: lucene-user-help@jakarta.apache.org
  • Natarajan.T at Dec 7, 2004 at 3:36 am
    Thanks for your response.....

    I have indexed like Field.Text("size",docSize)

    -----Original Message-----
    From: Erik Hatcher
    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: lucene-user-unsubscribe@jakarta.apache.org
    For additional commands, e-mail: lucene-user-help@jakarta.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
    For additional commands, e-mail: lucene-user-help@jakarta.apache.org
  • Erik Hatcher at Dec 7, 2004 at 7:33 am

    On Dec 6, 2004, at 10:41 PM, Natarajan.T wrote:
    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
    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: lucene-user-unsubscribe@jakarta.apache.org
    For additional commands, e-mail: lucene-user-help@jakarta.apache.org


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
    For additional commands, e-mail: lucene-user-help@jakarta.apache.org

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
    For additional commands, e-mail: lucene-user-help@jakarta.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedDec 6, '04 at 1:05p
activeDec 7, '04 at 7:33a
posts4
users2
websitelucene.apache.org

2 users in discussion

Erik Hatcher: 2 posts Natarajan.T: 2 posts

People

Translate

site design / logo © 2022 Grokbase