FAQ
Hi, I was thinking a long time how to implement this kind of
functionality but couldn't figure out anything appropriate.
In my lucene document, I have two date fields: start and end date.
As a search input I have current date (NOW).
I need to display all documents for which current date is between
start and end dates.

I know that this could be performed by two RangeQuery-es, ie.
startDate:{19700101 to NOW} AND endDate:{NOW to 29990101}
but since the index could be very large, performance would not be very good.
RangeFilter is not a good idea as well, since I would have to filter
on two fields (or maybe it would with ChainedFilter?).

Does anyone know which approach would be the best in this kind of
situation, performance wise?

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

Search Discussions

  • Grant Ingersoll at Oct 1, 2009 at 3:01 pm

    On Sep 29, 2009, at 11:30 AM, Dragan Jotanovic wrote:

    Hi, I was thinking a long time how to implement this kind of
    functionality but couldn't figure out anything appropriate.
    In my lucene document, I have two date fields: start and end date.
    As a search input I have current date (NOW).
    I need to display all documents for which current date is between
    start and end dates.

    I know that this could be performed by two RangeQuery-es, ie.
    startDate:{19700101 to NOW} AND endDate:{NOW to 29990101}
    but since the index could be very large, performance would not be
    very good.
    RangeFilter is not a good idea as well, since I would have to filter
    on two fields (or maybe it would with ChainedFilter?).

    Does anyone know which approach would be the best in this kind of
    situation, performance wise?
    In Lucene 2.9, there is much better performance for range queries on
    numerics, you might try that.

    --------------------------
    Grant Ingersoll
    http://www.lucidimagination.com/

    Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids)
    using Solr/Lucene:
    http://www.lucidimagination.com/search


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Dragan Jotanovic at Oct 1, 2009 at 5:12 pm
    Thanks, I will try NumberRangeQuery
    On Thu, Oct 1, 2009 at 4:01 PM, Grant Ingersoll wrote:
    On Sep 29, 2009, at 11:30 AM, Dragan Jotanovic wrote:

    Hi, I was thinking a long time how to implement this kind of
    functionality but couldn't figure out anything appropriate.
    In my lucene document, I have two date fields: start and end date.
    As a search input I have current date (NOW).
    I need to display all documents for which current date is between
    start and end dates.

    I know that this could be performed by two RangeQuery-es, ie.
    startDate:{19700101 to NOW} AND endDate:{NOW to 29990101}
    but since the index could be very large, performance would not be very
    good.
    RangeFilter is not a good idea as well, since I would have to filter
    on two fields (or maybe it would with ChainedFilter?).

    Does anyone know which approach would be the best in this kind of
    situation, performance wise?
    In Lucene 2.9, there is much better performance for range queries on
    numerics, you might try that.

    --------------------------
    Grant Ingersoll
    http://www.lucidimagination.com/

    Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids) using
    Solr/Lucene:
    http://www.lucidimagination.com/search


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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedSep 29, '09 at 3:31p
activeOct 1, '09 at 5:12p
posts3
users2
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase