Skip to content

Synonyms can create excessively complex search queries #3125

@loiclec

Description

@loiclec

When a word has a multi-word synonym, for example:

"btw" -> "by the way"

or, worse, multiple multi-word synonyms, such as:

"poc" -> ["person of colour", "proof of concept"]

then search queries containing these synonyms will take much longer to resolve, especially if the queries are already long and contain many words with synonyms.

The reason for this slowdown mostly comes down to the fact that we treat a multi-word synonym not as a phrase but as a list of regular search query terms.

Therefore the following search query:

btw I am going to nyc soon

gets mapped to:

by the way I am going to New York City soon

as opposed to:

"by the way" I am going to "New York City" soon

It is worth considering the impact of treating multi-word synonyms as phrases in terms of relevancy. If the impact is neutral or just slightly negative, then we should make this change to ensure good search performance.


TODO

  • Implement changes in Milli
  • Release a Milli version containing these changes
  • Bump this new Milli version in Meilisearch and merge it into main

Metadata

Metadata

Assignees

Labels

impacts docsThis issue involves changes in the Meilisearch's documentationmilliRelated to the milli workspaceperformanceRelated to the performance in term of search/indexation speed or RAM/CPU/Disk consumptionv1.0.0PRs/issues solved in v1.0.0 released on 2023-02-06

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions