I have a taxonomy term used in 1 content type. It's set to cardinality 1. Now all nodes in my system get indexed in the search_api_db_rm_content_search_index_field_product_taxonomy table. Also nodes of content types that do not have the field attached to it.

This leads to a strange facet (see attachment)

Comments

drunken monkey’s picture

Title: Taxonomy terms with cardinality of 1 do not get properly indexed » Don't index NULL values
Project: Search API » Search API Database Search
Component: Miscellaneous » Code

This seems to be a bug in the DB backend, not in the Search API per se.

freakalis’s picture

Status: Active » Needs review
StatusFileSize
new692 bytes

Here is is patch that stops null values from being indexed. This works for me

adam_b’s picture

+1 - I'm having the same problem; will test this patch tonight.

drunken monkey’s picture

Patch looks very good, thank you!

@ adam_b: Did you get to it, did it work? If someone can confirm this works, I'll gladly commit this.

ollu’s picture

+1 Tested it the other day and it worked just fine!

drunken monkey’s picture

Please see whether #1649042: Fix handling of NULL values when indexing is the same problem, and whether the patch in #10 there solves it.
The solution here is a bit unflexible in my opinion.