1
votes

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

1

1 Answers

0
votes

You can use negative at field. like that:

-birthDate:*
or
-birthDate:[* TO *]