Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

search_api_synonym

629 sites Security covered
View on drupal.org

INTRODUCTION

This module let editors or administrators manage synonyms and spelling errors for Search API
directly in Drupal.

The module support automated export of synonyms using cron or manual using Drupal Console or Drush.

The module it self is NOT deploying exported synonyms and spelling errors to Solr or other search backends. This can be automated using a shell script or similar. Automated deployment using Solr API integration is in development.

The module support the synonyms.txt format used in Apache Solr.
Other formats can be added using the Export plugin annotation.

REQUIREMENTS

  • No requirements.

BRANCHES

The 2.x branch should be considered legacy. The current 3.x branch is for D10+, for compatibility with Drupal 11.

New features will be targeted on the 3.x branch moving forward. As of beta2, the 3.x functionality is largely the same as 2.x, so if the module is working well for you on <= D10 stick with 2.x.

INSTALLATION

Install as you would normally install a contributed drupal module. See: https://www.drupal.org/documentation/install/modules-themes/modules-8 for further information.

MANAGE SYNONYMS

After installation can you start managing your synonyms and spelling errors
at admin/config/search/search-api-synonyms.

EXPORT SYNONYMS

Drupal Console

Export synonyms using the Drupal Console command:

drupal searchapi:synonym:export

Execute the command with --help to see the different options.

Drush 8 and previous versions

Export synonyms using the Drush command:

drush search-api-synonym-export

drush sapi-syn-ex

Drush 9 (only in git repo and dev releases after 2nd of April 2018)

Export synonyms using the Drush command:

drush search-api-synonym:export

drush sapi-syn:export

drush sapi-syn-ex

Examples

Replace [COMMAND] with one of the above Drupal Console / Drush commands.

Export all Danish synonyms and spelling errors in the Solr format.

[COMMAND] --plugin=solr --langcode=da

Export all Danish spelling errors in the Solr format.

[COMMAND] --plugin=solr --langcode=da --type=spelling_error

Export all Danish synonyms without white spaces in the Solr format.

[COMMAND] --plugin=solr --langcode=da --type=synonym --filter=nospace

Cron

Export using Drupal cron is supported. See the settings in /admin/config/search/search-api-synonyms/settings.

IMPORT SYNONYMS

Synonyms can be imported as Synonym entities in Drupal using the import function in the synonym administration in Drupal.

At the moment is simple CSV, JSON and Solr (synonyms.txt) formats available. Example files can be downloaded from the import form. Choose a format and then download the example file.

Import files are expected to be in UTF-8!

DEVELOPERS

The Search API Synonym module provides the following ways for developers to
extend the functionality:

Plugins

Export plugin - see the annotation and the Solr plugin:

  • Drupal\search_api_synonym\Annotation\SearchApiSynonymExport
  • Drupal\search_api_synonym\Plugin\search_api_synonym\export\Solr

Import plugin - see the annotation and the CSV plugin:

  • Drupal\search_api_synonym\Annotation\SearchApiSynonymImport
  • Drupal\search_api_synonym\Plugin\search_api_synonym\import\CSV

SPONSORS

MAINTAINERS

Current maintainers:

Activity

Total releases
4
First release
Apr 2025
Latest release
11 months ago
Release cadence
7 days
Stability
0% stable

Release Timeline

Releases

Version Type Release date
3.0.0-beta3 Pre-release May 17, 2025
3.0.0-beta2 Pre-release Apr 26, 2025
3.0.0-beta1 Pre-release Apr 25, 2025
3.0.x-dev Dev Apr 25, 2025