If the query stars with a negative clause Lucene returns nothing.

 endDate[NOW TO *] OR -endDate:[* TO *]
Might work


-----Original Message-----
From: Kolodziej Christian [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 16, 2008 12:01 AM
To: solr-user@lucene.apache.org
Subject: AW: Searching for future or "null" dates

Hi Chris,

>I'm having a lot of trouble getting this query syntax to work correctly.
>How
>can I search for a date, which is either in the future OR missing 
>completely (meaning open ended)
>
>I've tried -endDate:[* TO *] OR endDate[NOW TO *] but that doesn't work.
>Adding parentheses doesn't help either.

Why do you use a range query for the endDate, that is not set? It's not
tested yet but try -endDate:19700101T00:00:00Z (if it's a date field) or
-date:0 (if you have saved timestamp). Another solution I would try is to
use specific dates instead of NOW or * for the future.

Can you post the results of your trials, this might be interesting for other
users, too.

Best regards,
Christian


Reply via email to