Possible to create a "not defined" / "empty" facet option?

Created on 14 August 2019, over 5 years ago
Updated 11 March 2025, 23 days ago

I'm running Search API Solr and Facets on my site, and it's working great. I have a number of facets that are checkboxes. They list all the defined values for a given field.

My clients now want to make this particular field mandatory, and want a way to filter search results where a field is empty or undefined, things Facets would normally ignore.

Is there a way to filter on "undefined" in facets? Add an option that basically says "This field isn't defined"?

(Having typed this out, I'm guessing the quick answer is "no". Particularly for Solr, there's no way to tell between a content type which has an empty field, and a content type where the field isn't defined. Any other ideas on how to quickly find other "undefined" content would be appreciated!)

💬 Support request
Status

Closed: won't fix

Version

1.4

Component

Code

Created by

🇨🇦Canada TrevorBradley

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪Belgium borisson_ Mechelen, 🇧🇪

    As you say, there's no way to do this without also having to do entity queries, ruining performance. Closing this issue.

Production build 0.71.5 2024