4.1.1. Search Engine
ElasticSuite’s main feature is the search engine which is used e.g. to display search results in the search flyout on the storefront. Per default MageSuite does display here:
Search terms that fit the input and search criteria (auto-suggest)
Products that fit the input and search criteria
Categories that fit the input and search criteria
CMS Pages that fit the input and search criteria
You can find the ElasticSearch search engine configuration under ELASTICSUITE / SEARCH RELEVANCE. Here you can configure the full-text search settings, spellchecking as well as the phrase matching. It is recommended to stick to the official ElasticSuite documentation: https://github.com/Smile-SA/elasticsuite/wiki/FulltextSearchEngineBasicConfiguration
Also you can set up the thesaurus configuration in ELASTICSUITE / THESAURUS. It is recommended to stick to the official ElasticSuite documentation: https://github.com/Smile-SA/elasticsuite/wiki/ThesaurusAdministration
After setting up the basic search engine configuration you can make the search configuration per attribute. Access STORES / ATTRIBUTES / PRODUCTS and click the attribute you want to edit (use in
the search). Choose the tab STOREFRONT PROPERTIES and scroll down to the SEARCH CONFIGURATION section. Here you can do the following:
“USE IN SEARCH”: If set to “Yes”, the given attribute will be used in compute results in the search
engine.“SEARCH WEIGHT”: The weight of the attribute in the search context is set here. If set to “Yes”, in the full-text search the input which matches values of the given attribute have higher search relevance.
“USED IN SPELLCHECK”: If set to “Yes”, ElasticSearch will compute spellchecking for the given
attribute.“DISPLAY IN AUTOCOMPLETE”: If set to “Yes”, the attribute will appear in the search flyout.
“VISIBLE IN ADVANCED SEARCH”: Typically the advanced search page is not contained in MageSuiteIf set to “Yes”, the attribute would appear in the advanced search.
When the changes have been made click “SAVE ATTRIBUTE” in the top section on the right-hand side.
With the basic search configuration and the attribute configuration being made you can configure the
auto-complete dropdown itself. Access STORES / SETTING / CONFIGURATION and then navigate to
ELASTICSUITE and then AUTOCOMPLETE. Here you can do the following:
POPULAR TERM AUTOCOMPLETE: In the input field you can enter the maximum number of popular
search terms (in the storefront as “search terms”) that should appear search flyout.PRODUCT AUTOCOMPLETE: In the input field you can enter the maximum number of products (in the storefront as “products”) that should appear search flyout.
CMS PAGE AUTOCOMPLETE: In the input field you can enter the maximum number of CMS pages
(in the storefront as “cms page”) that should appear search flyout.PRODUCT ATTRIBUTES AUTOCOMPLETE: In the input field you can enter the maximum number of
attributes that should appear search flyout.CATEGORY AUTOCOMPLETE: In the input field you can enter the maximum number of categories
(in the storefront as “categories”) that should appear search flyout.
When the changes have been made click “SAVE CONFIG” in the top-section on the right-hand side.
In certain cases the search input is precise and so it leads to only one product hit. In such cases it enables a one result redirect to the product detail page. In order to do so access STORES / SETTINGS
/ CONFIGURATION and then navigate to ELASTICSUITE and then CATALOG SEARCH. In the REDIRECT TO PRODUCT PAGE IF ONLY ONE RESULT dropdown select “YES”. After the change click “SAVE CONFIG” in the top-section on the right-hand side.