-
Notifications
You must be signed in to change notification settings - Fork 274
Update synonyms documentation for Meilisearch #3579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -170,7 +170,20 @@ Suppose you set `San Francisco` and `SF` as synonyms with a [mutual association] | |||
|
|
||||
| </CodeGroup> | ||||
|
|
||||
| If you input `SF` as a search query, Meilisearch will also return results containing the phrase `San Francisco`. However, depending on the ranking rules, they might be considered less [relevant](/capabilities/full_text_search/relevancy/relevancy) than those containing `SF`. The reverse is also true: if your query is `San Francisco`, documents containing `San Francisco` may rank higher than those containing `SF`. | ||||
| If you input `SF` as a search query, Meilisearch will also return results containing the phrase `San Francisco`. | ||||
|
|
||||
|
|
||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
|
|
||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| However, depending on the ranking rules, they might be considered less [relevant](/capabilities/full_text_search/relevancy/relevancy) than those containing `SF`. The reverse is also true: if your query is `San Francisco`, documents containing `San Francisco` may rank higher than those containing `SF`. | ||||
|
|
||||
| ## Synonym term length limitation | ||||
|
|
||||
| Meilisearch only fetches synonyms for search terms that are between 1 and 3 words. Terms with 4 or more words will not return any synonym matches. | ||||
|
|
||||
| For example, if you set `"lord of the rings"` as a synonym for `"lotr"`, searching for `"lotr"` will return documents containing `"lord of the rings"`. However, if you search for `"lord of the rings"`, Meilisearch will not return documents containing `"lotr"` because the search term has more than 3 words. | ||||
|
|
||||
| This limitation applies regardless of how you configure your synonyms. To work around this, consider using shorter synonym terms or breaking longer phrases into multiple single-word synonyms. | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The workaround as written would lead to odd configurations like mapping 'of the ring' → 'lotr', which isn't really meaningful. Also, breaking "lord of the rings" into lord, rings etc. as synonyms for 'lotr' would match completely unrelated documents.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with you. I would prefer not to propose workarounds for now. I'll work on the synonyms storage this week if I have time, and maybe improve the situation around this limitation. |
||||
|
|
||||
|
|
||||
| ## Maximum number of synonyms per term | ||||
|
|
||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.