FAQ
Newbie here. Or, at least it has been a couple of years....

I have a date ranges working, which seem to work well. But I have
a question about how to form a query.

I have a publication with a dateAvailable and a dateExpired. It is
viewable any time between these dates.

I want to supply a date range, looking for publications available in
the specified range. I thought I could do:

+((dateAvailable:[02/01/2004 TO 03/01/2004]) OR
(dateExpired:[02/01/2004 TO 03/01/2004]))

But this does not work with this combination of dates:

dateAvailable=1/1/2004
searchStartDate=2/1/2004
searchEndDate=3/1/2004
dateExpired=6/1/2004

Neither the dateAvailable nor dateExpired are included within the user
specified test
range, even though the publication is available during the entire
specified range,
plus more.

Anyone figured out a way to do this without enumerating all the dates?
Or, do I
just need more sleep.

Thanks for any help.

Frank


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

Search Discussions

  • Abe Grief at Apr 23, 2004 at 9:42 pm
    I'm a newbie to Lucene, so someone please correct me if I say something
    wrong or if there's an easier way.

    Your search is looking exclusively for Documents that either become
    available or expire in the given period. What about something like
    (untested):

    +((dateAvailable:[01/01/0001 TO 03/01/2004]) AND
    (dateExpired:[02/01/2004 TO 12/31/9999]))

    This query assumes that Documents expire before they become available, which
    seems like a reasonable assumption.

    - Abe


    -----Original Message-----
    From: Frank Morton
    Sent: Thursday, April 22, 2004 8:42 PM
    To: Lucene Users List
    Subject: date range suggestion anyone?


    Newbie here. Or, at least it has been a couple of years....

    I have a date ranges working, which seem to work well. But I have
    a question about how to form a query.

    I have a publication with a dateAvailable and a dateExpired. It is
    viewable any time between these dates.

    I want to supply a date range, looking for publications available in
    the specified range. I thought I could do:

    +((dateAvailable:[02/01/2004 TO 03/01/2004]) OR
    (dateExpired:[02/01/2004 TO 03/01/2004]))

    But this does not work with this combination of dates:

    dateAvailable=1/1/2004
    searchStartDate=2/1/2004
    searchEndDate=3/1/2004
    dateExpired=6/1/2004

    Neither the dateAvailable nor dateExpired are included within the user
    specified test
    range, even though the publication is available during the entire
    specified range,
    plus more.

    Anyone figured out a way to do this without enumerating all the dates?
    Or, do I
    just need more sleep.

    Thanks for any help.

    Frank


    ---------------------------------------------------------------------
    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
  • Stephane James Vaucher at Apr 24, 2004 at 5:31 pm
    Ranges are sorted like text, alphabetically.

    You should change the format of your dates to: yyyy/mm/dd

    If you don't, the range search won't work:

    Here is an example (I'm not sure if I understand your algorithm, so
    ignore mistakes there):

    +((dateAvailable:[0 TO S_END_DATE]) AND
    (dateExpired:[S_START_DATE TO 9])) <other terms>

    or with the following parameters:
    dateAvailable=20040101
    searchStartDate=20040201
    searchEndDate=20040301
    dateExpired=20040601
    +((dateAvailable:[0 TO 20040301]) AND
    (dateExpired:[20040201 TO 9]))

    Should return the right the above doc.

    HTH,
    sv
    On Fri, 23 Apr 2004, Abe Grief wrote:


    I'm a newbie to Lucene, so someone please correct me if I say something
    wrong or if there's an easier way.

    Your search is looking exclusively for Documents that either become
    available or expire in the given period. What about something like
    (untested):

    +((dateAvailable:[01/01/0001 TO 03/01/2004]) AND
    (dateExpired:[02/01/2004 TO 12/31/9999]))

    This query assumes that Documents expire before they become available, which
    seems like a reasonable assumption.

    - Abe


    -----Original Message-----
    From: Frank Morton
    Sent: Thursday, April 22, 2004 8:42 PM
    To: Lucene Users List
    Subject: date range suggestion anyone?


    Newbie here. Or, at least it has been a couple of years....

    I have a date ranges working, which seem to work well. But I have
    a question about how to form a query.

    I have a publication with a dateAvailable and a dateExpired. It is
    viewable any time between these dates.

    I want to supply a date range, looking for publications available in
    the specified range. I thought I could do:

    +((dateAvailable:[02/01/2004 TO 03/01/2004]) OR
    (dateExpired:[02/01/2004 TO 03/01/2004]))

    But this does not work with this combination of dates:

    dateAvailable=1/1/2004
    searchStartDate=2/1/2004
    searchEndDate=3/1/2004
    dateExpired=6/1/2004

    Neither the dateAvailable nor dateExpired are included within the user
    specified test
    range, even though the publication is available during the entire
    specified range,
    plus more.

    Anyone figured out a way to do this without enumerating all the dates?
    Or, do I
    just need more sleep.

    Thanks for any help.

    Frank


    ---------------------------------------------------------------------
    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
  • Abe Grief at Apr 23, 2004 at 10:02 pm
    Sorry, I meant to say:

    This query assumes that _NO_ Documents expire before they become available,
    which seems like a reasonable assumption.

    - Abe

    -----Original Message-----
    From: Abe Grief
    Sent: Friday, April 23, 2004 2:42 PM
    To: 'Lucene Users List'
    Subject: RE: date range suggestion anyone?



    I'm a newbie to Lucene, so someone please correct me if I say something
    wrong or if there's an easier way.

    Your search is looking exclusively for Documents that either become
    available or expire in the given period. What about something like
    (untested):

    +((dateAvailable:[01/01/0001 TO 03/01/2004]) AND
    (dateExpired:[02/01/2004 TO 12/31/9999]))

    This query assumes that Documents expire before they become available, which
    seems like a reasonable assumption.

    - Abe


    -----Original Message-----
    From: Frank Morton
    Sent: Thursday, April 22, 2004 8:42 PM
    To: Lucene Users List
    Subject: date range suggestion anyone?


    Newbie here. Or, at least it has been a couple of years....

    I have a date ranges working, which seem to work well. But I have
    a question about how to form a query.

    I have a publication with a dateAvailable and a dateExpired. It is
    viewable any time between these dates.

    I want to supply a date range, looking for publications available in
    the specified range. I thought I could do:

    +((dateAvailable:[02/01/2004 TO 03/01/2004]) OR
    (dateExpired:[02/01/2004 TO 03/01/2004]))

    But this does not work with this combination of dates:

    dateAvailable=1/1/2004
    searchStartDate=2/1/2004
    searchEndDate=3/1/2004
    dateExpired=6/1/2004

    Neither the dateAvailable nor dateExpired are included within the user
    specified test
    range, even though the publication is available during the entire
    specified range,
    plus more.

    Anyone figured out a way to do this without enumerating all the dates?
    Or, do I
    just need more sleep.

    Thanks for any help.

    Frank


    ---------------------------------------------------------------------
    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
postedApr 23, '04 at 3:42a
activeApr 24, '04 at 5:31p
posts4
users3
websitelucene.apache.org

People

Translate

site design / logo © 2021 Grokbase