2

Is there any way to write a query that will return all results that do not contain a certain field?

For example, let's say that I have an index of people that contains firstName, lastName and birthDate. I want to query for all people who do not have a birthDate. NOT all people where birthDate is null, but all people where there simply is no birthDate field. Is this possible?

EDIT: MATAN pointed me to the answer here - solr search for documents where a field doesn't exist

Community
  • 1
  • 1
August Flanagan
  • 886
  • 14
  • 27
  • 2
    Check this out: http://stackoverflow.com/questions/4365369/solr-search-for-documents-where-a-field-doesnt-exist – Matan Jul 19 '12 at 23:24

1 Answers1

1

You can use negative at field. like that:

-birthDate:*
or
-birthDate:[* TO *]
HenioJR
  • 604
  • 1
  • 10
  • 17