Optimize keyword searches
Sitecore Search allows you to expand keyword searches by using semantic relationships between keywords or key phrases. With one-way or two-way synonyms, the keywords in a request can be related to other words, expanding the number of search results and keeping visitors engaged.
Synonyms and replacements
In Sitecore Search, you can define one-way and two-way synonyms to create relationships between hyponyms and taxonyms.
There is a hyponym-taxonym relationship between the three words: feline, lion, and tiger.
Because feline is a general category of cats, including cat types like lion and tiger, we can infer that:
-
Feline is the hyponym of lion and tiger.
-
Lion and tiger are the taxonyms of feline.
You can create true semantic word relationships by making keyword relationships at the word level using the following directional word equivalences:
Direction |
Word equivalence description |
---|---|
One-way synonyms |
One-way synonyms relate words that involve a whole and part of the whole. For example, a finger is a part of a hand. The word hand is the holonym of finger and finger is the meronym of hand. |
Two-way synonyms |
Two-way synonyms allow for bidirectional word equivalence for search terms. For example, a search for black pants is equivalent to a search for black trousers. Both key phrases yield the same results although the order of the results might not be the same. |
With synonyms, you define replacements as an additional type of word-level relationship. This method omits any results matching the keyword and returns results for the replacement keyword. For example, potential bad results returned for keyword chevy are hidden, and are corrected with those for the replacement word chevrolet.
Analyzers
Sitecore Search uses analyzers to ensure that searches return all relevant results instead of just exact matches. They are used to varying degrees in filters, personalization, suggestion blocks, textual relevance, and sorting options.
Analyzers convert text input into a structured format that is optimized for search. They do this using the following three-step process:
-
If the analyzer uses character filters, it applies them. This means that certain characters are replaced or removed. For example, non-alphanumeric characters such as punctuation might be removed.
-
The analyzer tokenizes the search phrase. This means that the phrase is split up into smaller chunks called tokens. These tokens are usually single words, but can also be partial words or phrases.
-
If the analyzer uses token filters, it applies them. This means that the tokens are transformed using a variety of methods including applying synonyms, reducing tokens to their root words, removing stop words, and so on.
Sitecore Search offers the pre-built analyzers listed in the following table:
Basic analyzers |
Advanced analyzers |
---|---|
Multi locale standard Standard Alphanumeric only Keyword Lowercase Prefix match |
Ngram based matching Partial match Shingle generator Standard no stemmer |
For more information about analyzers, see the ElasticSearch documentation on the topic.