UpStart Commerce Search
Synonyms
7min
to make the search more robust and relevant, synonyms are introduced synonyms are also a unique feature of nochannel search as the name implies, the purpose of synonyms is to search for words with similar meanings and also retrieve them in the results because of the synonyms, all ambiguities while searching are removed for the searcher for example, in some european countries, cars are commonly known as autos or automobiles if a person searches for the word "auto", the search result will retrieve all "car" items in the result to add a synonym in an index, it is important to reindex the data otherwise the synonyms will not be updated types of synonym there are three different types of synonyms alias grouping multiple keywords together that have similar meanings to them for example, "table", "desk", and "counter" if users search for "desk" then "table" and "counter" will be searched too contraction grouping together a list of keywords in such a way that if any word is searched for in the group, the results retrieved correspond to one of the words in the group only for example, if the contraction is set to "table" in a group of "table", "desk", and "counter", even if the user searches for the word "desk" the search will retrieve all the results of table items only expansion it is a one to many relation between the keywords i e one keyword maps to multiple keywords on searching that one keyword, all the other mapped keywords are searched for for example, mapping the word "table" on "desk" and "counter" will search for desk and counter every time table is searched to better understand the concept of synonyms, let us look at the following example for each type of synonym for the word "chair" creating the alias synonyms the api call to create alias synonyms is post https //api upstartcommerce com/v1/search/synonyms/ the following code block represents the creation of alias synonyms for a word in this case, it is "chair" catalog in the api refers to the name of an existing query pipeline { "displayname" "chair synonym", "status" "active", "synonyms" { "synonyms" \[ "table, counter, desk" ], "type" "synonymalias" } } notice that an array called synonyms is defined which has all three words; “table”, "desk", and "counter" in it the type field explicitly defines the type of synonym as alias searching for a table yields results for counters and desks as well creating the expansion synonyms the api call to create expansion synonyms is post https //api upstartcommerce com/v1/search/synonyms the following code block represents the creation of expansion synonyms for a word in this case, it is a "table" catalog in the api refers to the name of an existing query pipeline { "displayname" "table synonym", "status" "active", "synonyms" { "from" "table", "to" \[ "desk", "counter" ], "type" "synonymexpansion" } } the type field explicitly defines the type of synonym as expansion the field "from" in the synonym block defines the word expansion as "table" the field defines the words "desk" and "counter" that will be contracted with "table" searching for "table" will yield results for "counter" and "desk" creating the contraction synonyms the api call to create contraction synonyms is post https //api upstartcommerce com/v1search/synonyms/ the following code block represents the creation of contractions synonyms for a word in this case, it is a "table" catalog in the api refers to the name of an existing query pipeline { "displayname" "table synonym", "status" "active", "synonyms" { "from" \[ "desk", "counter" ], "to" "table", "type" "synonymcontraction" } } the type field explicitly defines the type of synonym as contraction the field to in the synonym block defines the word of contraction "table" the field defines the words "desk" and "counter" that will be contracted with "table" searching for "table", "desk", or "counter" will yield results only for "table" similar to the create api, crud operations can be performed to update, delete, and manage the synonyms directory