Problem/Motivation

We are in the process of switching our site's facets from blocks to Better Exposed Filters, which is a very welcome update. However, we are missing the ability to add a missing result with a customizable label.

Description of the functionality in the block-based format: Show missing - Add a facet item that counts and selects all search results which match the current query but do not belong to any of the facet items. Also has the ability to add "Label of missing items"

Our site is an image database, and in some contexts, browse-ability relies on a missing result. For example, to filter thousands of images to differentiate a general image of a building from an image with more specific details. We also rely on it for internal quality control views, to quite literally find missing items.

Many thanks to all

* Originally posted in BEF (#3535211: Add ability to show missing items in facets), was suggested to post here instead.

Issue fork facets-3544882

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lspeck created an issue. See original summary.

fengtan made their first commit to this issue’s fork.

fengtan’s picture

Status: Active » Needs review
StatusFileSize
new165.98 KB
new6.18 KB

I also needed this functionality and came up with MR !354.

The MR adds a new checkbox Show missing to views filters, as well as a text field Label of missing items (this is similar to the legacy facets system at /search/admin/config/search/facets):

Views UI option to show missing

The label does not seem to actually show up (instead I get an exclamation mark !) but that was also the case with the legacy facets system so maybe we can deal with that in a separate issue.

The MR makes phpunit fail with errors on Drupal\Tests\facets\Kernel\FacetManager\DefaultFacetManagerTest (#673678). I can't reproduce these failures locally (drupal 10.5, search_api 1.40.0), and the errors reported do not seem related to this changeset, so I am going to dare to move this issue to Needs Review.

Attached is a also patch version of the MR for convenience.

prudloff’s picture

I opened a separate issue for the failing DefaultFacetManagerTest: #3579256: Failing DefaultFacetManagerTest

mkalkbrenner made their first commit to this issue’s fork.

mkalkbrenner’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.