Sounds good. "OR" in the negation of any query that matches any possible value in a field.

The Solr query parser doc lists the open range as you used:

     -field:[* TO *] finds all documents without a value for field

See:
http://wiki.apache.org/solr/SolrQuerySyntax

This also include pure wildcard that can generate a PrefixQuery:

      -fname:* OR fname:(A B C)


-- Jack Krupansky

-----Original Message----- From: Ryan McKinley
Sent: Wednesday, May 02, 2012 7:18 PM
To: solr-user@lucene.apache.org
Subject: syntax for negative query OR something

How do I search for things that have no value or a specified value?

Essentially I have a field that *may* exist and what the absense of a
field to also match.

I have a few variations of:
-fname:[* TO *] OR fname:(A B C)


Thanks for any pointers

ryan

Reply via email to