WSDOT / wsdot-website

Codebase for WSDOT's public Drupal 7 website hosted on Acquia.
0 stars 4 forks source link

Deleted taxonomy term's ID's showing up in facet filters #472

Closed waynedyck closed 2 years ago

waynedyck commented 5 years ago

When a term is removed, if a node has an entity reference to it, the id of term will continue to be indexed by the facet API and will display the term id in any facet filters.

This can be seen in the Safety Rest Areas - Location list with the Amenity facet 2601 which is the term id for the deleted Telephone taxonomy term that was removed.

There are two patches available in the Search API and Field reference delete modules which have been reviewed and tested by the community and appear to address this.

waynedyck commented 5 years ago

This issue has also been added to the Common pitfalls documentation under, Indexing of broken references.

waynedyck commented 4 years ago

Applying patch to the Search API with a local install of Solr 4.5.1 to see if the patch removes the ghost taxonomy terms. The Field reference delete patch sounds like it has to be installed prior to any taxonomy terms being deleted in order to work.

waynedyck commented 4 years ago

The patch I applied from the previous comment did nothing. It is meant to be used together with the field reference delete patch.

After applying the patch from comment #10 and reindexing the rest-areas content, the id of the deleted telephone entity no longer displays.

The original problem comes from #2450333: Increase performance of indexing entity references, where they switched to not loading entities during indexing anymore when they only want their entity ID. This means that the reference will get indexed even if the referenced entity doesn't exist anymore.

waynedyck commented 4 years ago

Any future updates to the Search API module will likely need to have this patch applied again, otherwise, any deleted entities will potentially show up again when the content is re-indexed.

waynedyck commented 4 years ago

While commit bd3bea85 prevents deleted referenced entities from being indexed it also introduced a new bug. String field types which appear in a dropdown list in a key | value form are having both the key and value indexed rather than just the value.

For example in our Project content type, the project status field has key | value pair of active | Active and completed | Completed and now what is being indexed and displayed on the project index list is, active Active (189) and completed Completed (194)

waynedyck commented 2 years ago

Closing this issue since we are launching a new Drupal 8 site next week.