Magento 2 search terms and synonyms, and how to import and export them

Magento 2 allows the store administrators to optimise the customer search queries by composing lists and search terms and synonyms.

In this article you will learn how to import lists of search synonyms and terms to your Magento 2, and how to export those for editing purposes.

'

So, what search terms and search synonyms in Magento 2 do? 

  • Search Terms allow the store administrator to redirect customers to a particular page of the store is a certain search query is entered in the search field.
  • Search Synonyms allow the store administrator to compose a list of queries, separated by commas, that should bear the same search results.

Below you will find the instructions how can one locate these settings in Magento 2 and how to import and export both Search Terms and Search Synonyms to and from Magento 2 store.

Finding and managing Search Terms and Synonyms

Navigate to your Magento 2 administrator panel and proceed to Marketing > SEO & Search. In this menu section you can find both Search Terms and Search Synonyms.

Both sections represent a grid with terms and synonym rules. The grids share native Magento 2 grid look and functionality, and come with filters and mass actions, – nothing special. The differences come when you are creating terms and synonym lists.

Search terms settings

The search terms define the behavior of Magento 2 search when the customer enters a particular search query.

  • Search query – defines a word or a phrase a customer should enter in the search field to get redirected to a particular page.
  • Store – defines the store(s) view the search term is applied to.
  • Redirect URL – defines the URL the customer should be redirected to.
  • Display in Suggested Terms – defines whether the term should be displayed in the Suggested Terms at the Magento 2 front.

Search synonyms settings

The search synonyms allow the store administrator to specify a list a words that should bear the same meaning in terms of providing search results for the customers.

  • Scope – defines the websites to which this particular list of synonyms should be applied.
  • Synonyms – a text field where you specify the words that should bear the same meaning in terms of search. Separate these words by a comma without spaces.

Importing and exporting search terms and search synonyms

Native Magento 2 import and export tool doesn’t let you handle search terms and synonyms, it is only limited to products and customers. To import and export terms and synonyms you will need to use a third party tool. Firebear Studio Improved Import & Export extension version 3.1.8 for Magento 2 allows you to import and export ALL Magento 2 entities including search terms and synonyms.

Get Improved Import & Export extension for Magento 2

Improved Import & Export Magento 2 extension is a full-features data management tool fully operational from Magento 2 administrator panel. Your store administrators without programming knowledge can use it no problem with the explicit documentation that Firebear Studio provides.

The extension features:

  • Support of all Magento 2 entities, including B2B and MSI extensions.
  • Support of all Magento 2 product types: simple, configurable, bundle, grouped, downloadable, virtual.
  • Support of multiple import sources including Google Sheets, FTP/SFTP, Dropbox.
  • Support of REST and SOAP APIs for connection with any system or service.
  • Support of CSV, XML, Excel XLSX, ODS, and Json files.
  • Custom import logic with support of XSLT translation templates.
  • Powerful attribute and separator mapping.
  • Open code and customization endpoints for better integration.
  • One time payment. No SAAS, no recurring payments, no subscriptions

Visit the extension product page for more information.

How import and export works

With Improved Import and Export extension for Magento 2 you will be using jobs. The jobs are a set of rules which define which entity and on what conditions should be import/exported to Magento 2.

To find the extension’s jobs proceed to System > Improved Import/Export > Import Jobs. Here you will be presented with the import jobs grid, from which you can create new import jobs and manage existing ones.

To create new import or export job click ‘Add New Job’ button. In the general job settings specify the name of the job and schedule, if you want the job to be recurring and execute it automatically.

In the Import Settings select the entity you want to import or export. In our case we are interested in Search Terms and Search Synonyms. When the entity and selected and the behavior specified you can proceed to selecting the import source and the file type you will be using.

In the Import Source section you can select the type of the file you will be importing. Improved Import & Export supports CSV, XML, Json, XLSX, and ODS file formats. And specify the source of the file, including: local file, direct URL, Dropbox, FTP/SFTP, and Google Sheets (you only need to share, and paste the link).

Sample files containing all search term and synonym attributes can be found at:

  • Google Sheet Master table – a table where we have gathered all Magento 2 entities and explained every entity attribute.
  • Firebear GitHub – here you can find files of different file types containing sample values for every Magento 2 entity.

Once you have specified the file location hit ‘Validate file’ button. Improved Import & Export extension will run the necessary checks and you will be able to hit ‘Save & Run’ button to execute the entity import.

For more information on how to use Improved Import and Export extension read the extension manual.

Search terms attributes

As every Magento 2 entity search terms and synonyms are composed of a set of attributes, which are stored in the tables. In the table below you can find the description of every attribute and sample values you can use for editing.

Attribute name Reference Values Value example
query_id ID of the search query term. From the administrator panel can be found at the URL of the edit term page For example in the url of the page:

/index.php/admin/search/term/edit/id/2/

ID of the search term is ‘2’.

Can only contain numerals.

132
query_text Search Query – the word or a phrase that you enter in the search query field. Can be any value import
num_results Number of results field of the search term Can only contain numerals 0
popularity Number of Uses field of the search term Can only contain numerals 1
redirect Redirect URL field of the search term. Defines the page where customer should be redirected Must contain a full URL of the page. Including https:// https://firebearstudio.com/the-improved-import.html
store_id ID of the store the search term is available at Can only contain numerals. The store id can be found at Stores > All Stores section of administrator panel 1
display_in_terms Display in Suggested Terms setting of the search term 1 – Yes

0 – No

1
is_active Defines if the search term is active or disabled 1 – Active

0 – Disabled

1
updated_at The date the search term has been last updated on Can only contain date and time format, for example:

2019-02-13 6:19:21

2019-02-13 6:19:21

Search synonyms attributes

As every Magento 2 entity search terms and synonyms are composed of a set of attributes, which are stored in the tables. In the table below you can find the description of every attribute and sample values you can use for editing.

Attribute name Reference Values Value example
group_id ID of the search synonyms group. From the administrator panel can be found at the URL of the edit synonym group page. For example in the url of the page:

/index.php/admin/search/synonyms/edit/group_id/1/

ID of the synonyms group is ‘1’.

Can only contain numerals.

1
synonyms Synonyms field where you specify the words separated by comma which bear the same meaning in terms of the search Do not put spaces after the commas.

Can contain any symbols.

firebear,studio,fire,bear,studio
store_id ID of the store the synonym group should be applied to Can only contain numerals. The store id can be found at Stores > All Stores section of administrator panel 0
website_id ID of the website the synonym group should be applied to Can only contain numerals. The website id can be found at Stores > All Stores section of administrator panel 0

IMPORTANT: make sure NOT to use THE SAME word for different synonym groups to avoid any errors.

 

That’s it. Having all the information above you can start importing and exporting Magento 2 search terms and synonyms.

Buy Improved Import and Export extension for Magento 2

If you are interested in importing other entities to your Magento 2 store – refer to the following blog posts:

'