Taxonomy synonyms used to be a feature in Drupal 6. They were dropped in Drupal 7, on the basis that synonym-like systems are easy to create using fields. There are therefore lots of different approaches that can be taken, and none I can find seem to work perfectly smoothly with the Search API family.

What is the approach to using fields for taxonomy synonyms that is expected by the Search API team and most robust for working with Search API?

I've got another support issue for the Facet API side of this coin open, and there's a Drupal Answers question on this with an open bounty for any users of that site.

A few particular questions, using an example vocabulary where "Notebook" is a synonym for "Laptop":

  • One obvious approach to taxonomy synonyms is to create a term reference field on a vocabulary, and index it with the same weight as the term name itself. This would work for searches finding content tagged "Laptop" for searches on "Notebook", but being a uni-directional reference, if content got tagged "Notebook" it wouldn't show up for "Laptop" searches. Also, filters (e.g. exposed filters in Search API Views) wouldn't know to follow this reference. Any thoughts?
  • Is linking taxonomy terms with bi-directional relations from Relation module a better approach, or overkill?
  • An alternate approach would be a text field on a term that lists its synonyms, also indexed with the same weight as the term name itself. This solves the uni-directional problem, but wouldn't show up in lists e.g. exposed form autocomplete
  • In general, would be a recommended approach to Search API Views exposed filters (autocompletes, long lists of options) with synonyms?
  • Is there any possible way (on a setup using Search API Solr) to programatically update the solr synonyms.txt file to keep in sync with taxonomy fields? (would this be desirable?)
  • Are there any existing taxonomy-related features (e.g. relating to taxonomy hierarchies) that could be used for this?

Comments

alanom’s picture

Issue summary: View changes

edit

DamienMcKenna’s picture

Status: Active » Fixed

How about adding a repeating text field to the vocabulary, configure that field to have the same weight as the title?

Status: Fixed » Closed (fixed)

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