: I'm having difficultly filtering my documents when a field is either
: blank or set to a specific value. I would have thought this would work
:
: fq=-Type:[* TO *] OR Type:blue
Rule#1 don't try to mix AND/OR syntax with +/- syntax ... it never works
the way you want.
"a OR b" is just syntactic sugar for "a b" ... "-a OR b" is equivilent to
"-a b" ... if you use debugQuery=true and look at the
parsed_filter_queries you'll see that your fq is being parsed as...
-Type:[* TO *] Type:blue
...looking at it that way, odes it make sense why it doesn't match any
documents? there is only one "positive" clause, which is that Type ==
blue. But then you are excluding any docs where Type has a value, so you
get the empty set.
you could have a special "Type_empty" boolean field and use...
fq = Type_empty:true Type:blue
...or you can play tricks with the syntax, and do something like this...
fq = (*:* -Type:[* TO *]) Type:blue
-Hoss