Do not add a condition when missing filter has no values

Created on 4 May 2023, about 2 years ago

Problem/Motivation

When using the "Show missing" item in a facet it is possible for the facet result set to only contain the missing item.

In this case the missing values are empty (e.g. represented as !() in the query string).

Its not expected a user would activate the missing facet if it the only option, but it is possible. If that happens in certain cases this can trigger a fatal error.

E.g if the facet if for a taxonomy term, using search api solr I get an exception from solr that '' is not a valid integer.

Steps to reproduce

  • Configure a facet for an integer field
  • Select "Show missing value"
  • Do a search that will result in only the missing item being returned
  • Activate the missing item filter

Proposed resolution

Check that there is a value before adding the missing filter condition.

Remaining tasks

Review

User interface changes

n/a

API changes

n/a

Data model changes

n/a

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇳🇿New Zealand ericgsmith

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024