Try:   Type:blue OR -Type:[* TO *] 

You can't have a negative clause at the beginning. Yes, Lucene should barf
about this.

-----Original Message-----
From: Geoffrey Young [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 19, 2008 12:17 PM
To: solr-user@lucene.apache.org
Subject: filtering on blank OR specific range

hi all :)

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

which I would expect to find all document where either Type is undefined or
Type is "blue".  my actual result set is zero.

using a similar filter

  fq=-Type:[* TO *] OR OtherThing:cat

does what I would expect (documents with undefined type or documents with
cats), so it feels like solr is getting confused with the range negation and
ORing, but only when the field is the same.  adding various parentheses
makes no difference.

I know this is kind of nebulous sounding, but I was hoping someone would
look at this and go "you're doing it wrong.  your filter should be..."

the field is defined as

  <field name="Type" type="string" indexed="true" stored="true"
multiValued="true"/>

if it matters.

tia

--Geoff

Reply via email to