On 23.09.2008 00:30 Chris Hostetter wrote: > : 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. > > Please, PLEASE ... do yourself a favor and stop using "AND" and "OR" ... > food will taste better, flowers will smell fresher, and the world will be > a happy shinny place... > > +productId:102685804 +liveDate:[* TO NOW] +(endDate:[NOW TO *] (*:* > -endDate:[* TO *]))
I would also like to follow your advice but don't know how to do it with defaultOperator="AND". What I am missing is the equivalent to OR: AND: + NOT: - OR: ??? I didn't find anything on the Solr or Lucene query syntax pages. If there is such an equivalent then I guess the query would become: productId:102685804 liveDate:[* TO NOW] (endDate:[NOW TO *] <OR>(*:* -endDate:[* TO *])) I switched to the AND-default because that is the default in my web frontend so I don't have to change logic. What should I do in this situation? Go back to the OR-default? It is not so much this example I am after but I have a syntax translater in my application that must be able to handle similar expressions and I want to keep it simple and still have tasty food ;-) -Michael