Here is what I was able to get working with your help.

(productId:(102685804)) AND liveDate:[* TO NOW] AND ((endDate:[NOW TO *]) OR
((*:* -endDate:[* TO *])))

the *:* is what I was missing.

Thanks for your help.



hossman wrote:
> 
> 
> : If the query stars with a negative clause Lucene returns nothing.
> 
> that's not true.  If a "Query" in lucene is a BooleanQuery that only 
> contains negative clauses, then Lucene returns nothing (because nothing is 
> positively selected) ... but it if there is a mix of negative lcauses and 
> positive clauses doesn't matter what order the clauses are in.
> 
> in *solr* there is code that attempts to detect a query containing purely 
> negative clauses and it adds a "MatchAllDocs" query in that case -- but it 
> only works at the top level of a query.  nested queries like this...
> 
>         +fieldA:foo +(-fieldB:bar -fieldC:baz)
> 
> ...won't work as you expect, because that nested query is only negative 
> clauses.  you can add your own MatchAllDocs query explicitly using the *:* 
> syntax....
> 
>         +fieldA:foo +(*:* -fieldB:bar -fieldC:baz)
> 
> :  endDate[NOW TO *] OR -endDate:[* TO *]
> 
> side note: you really, REALLY don't wnat to mix the "+/-" syntax with 
> "ANT/OR/NOT" .. it almost never works out the way you expect...
> 
> : >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.
> 
> unless you've set the default op to "AND" this should work...
> 
>       fq = endDate:[NOW TO *] (*:* -endDate:[* TO *])
> 
> 
> -Hoss
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Searching-for-future-or-%22null%22-dates-tp19502167p19563117.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to