Skip to content

Commit 6703f3e

Browse files
Merge branch 'master' into v0.29
2 parents 97acfdb + c1dd97b commit 6703f3e

File tree

6 files changed

+20
-6
lines changed

6 files changed

+20
-6
lines changed

.code-samples.meilisearch.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,13 @@ settings_guide_faceting_1: |-
965965
--data-binary '{
966966
"maxValuesPerFacet": 5
967967
}'
968+
synonyms_guide_1: |-
969+
curl \
970+
-X PUT 'http://localhost:7700/indexes/movies/settings/synonyms' \
971+
-H 'Content-Type: application/json' \
972+
--data-binary '{
973+
"great": ["fantastic"], "fantastic": ["great"]
974+
}'
968975
getting_started_faceting: |-
969976
curl \
970977
-X PATCH 'http://localhost:7700/indexes/movies/settings/faceting' \
@@ -979,4 +986,3 @@ getting_started_pagination: |-
979986
--data-binary '{
980987
"maxTotalHits": 500
981988
}'
982-

.vuepress/public/sample-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ get_faceting_settings_1: |-
148148
update_faceting_settings_1: |-
149149
reset_faceting_settings_1: |-
150150
settings_guide_faceting_1: |-
151+
synonyms_guide_1: |-
151152
getting_started_faceting: |-
152153
getting_started_pagination: |-
153154
getting_started_front_end_integration_md: |-

learn/configuration/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Suppose you would like to search `the mask` in a movie database. Since `the` is
234234

235235
## Synonyms
236236

237-
A set of words defined for an index. Synonyms are **different words that have the same meaning**, and thus are treated similarly. If either of the associated words is searched, the same results will be displayed.
237+
A set of words defined for an index. Synonyms are **different words that have the same meaning**, and thus are treated similarly. When searching for one word, you will also get some of the same results as the other associated word.
238238

239239
`synonyms=<Object>`
240240

learn/configuration/synonyms.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22

33
If multiple words have an equivalent meaning in your dataset, you can [create a list of synonyms](/reference/api/settings.md#update-synonyms). This will make your search results more relevant.
44

5-
In general, **a search on a word will return the same results as a search on any of its synonyms**.
6-
There is one exception to this rule, [detailed below](#multi-word-phrases).
5+
Words set as synonyms won't always return the same results. With the default settings, the `movies` dataset should return 547 results for `great` and 66 for `fantastic`. Let's set them as synonyms:
6+
7+
<CodeSamples id="synonyms_guide_1" />
8+
9+
With the new settings, searching for `great` returns 595 results and `fantastic` returns 423 results. This is due to various factors like [typos](/learn/configuration/typo_tolerance.md#minwordsizefortypos) and [splitting the query](/learn/advanced/concat.md#split-queries) to find relevant documents. The search for `great` will allow only one typo (e.g. `create`) and take into account all variations of `great` (e.g. `greatest`) along with `fantastic`.
10+
11+
::: warning
12+
The number of search results may vary depending on changes to the `movies` dataset.
13+
:::
714

815
## Normalization
916

learn/core_concepts/indexes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Designate the distinct attribute using the [update settings endpoint](/reference
8181

8282
### Synonyms
8383

84-
Your dataset may contain words with similar meanings. For these, you can define a list of synonyms: words that will be treated as the same or similar for search purposes.
84+
Your dataset may contain words with similar meanings. For these, you can define a list of synonyms: words that will be treated as the same or similar for search purposes. Words set as synonyms won't always return the same results due to factors like typos and splitting the query.
8585

8686
Since synonyms are defined for a given index, they won't apply to any other index on the same Meilisearch instance. You can create your list of synonyms using the [update settings endpoint](/reference/api/settings.md#update-settings) or the [update synonyms endpoint](/reference/api/settings.md#update-synonyms).
8787

learn/getting_started/customizing_relevancy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ The `synonyms` array lets you associate certain words in your dataset, telling M
126126

127127
<CodeSamples id= "getting_started_synonyms" />
128128

129-
This will set `winnie` and `piglet` as synonyms; searching for either word will show the same results.
129+
This will set `winnie` and `piglet` as synonyms. Searching for either won't always return the same results due to factors like typos and splitting the query.
130130

131131
You can read more about it in our [dedicated guide](/learn/configuration/synonyms.md).
132132

0 commit comments

Comments
 (0)