MeiliSearch/meilisearch/tests/search
meili-bors[bot] 5509bafff8
Merge #4535
4535: Support Negative Keywords r=ManyTheFish a=Kerollmops

This PR fixes #4422 by supporting `-` before any word in the query.

The minus symbol `-`, from the ASCII table, is not the only character that can be considered the negative operator. You can see the two other matching characters under the `Based on "-" (U+002D)` section on [this unicode reference website](https://www.compart.com/en/unicode/U+002D).

It's important to notice the strange behavior when a query includes and excludes the same word; only the derivative ( synonyms and split) will be kept:
 - If you input `progamer -progamer`, the engine will still search for `pro gamer`.
 - If you have the synonym `like = love` and you input `like -like`, it will still search for `love`.

## TODO
 - [x] Add analytics
 - [x] Add support to the `-` operator
 - [x] Make sure to support spaces around `-` well
 - [x] Support phrase negation
 - [x] Add tests


Co-authored-by: Clément Renault <clement@meilisearch.com>
2024-04-04 13:10:27 +00:00
..
distinct.rs Make clippy happy 2023-11-23 14:11:38 +01:00
errors.rs refactor the tests suite slightly 2023-09-11 16:56:26 +02:00
facet_search.rs Add tests to sortFacetValuesBy count 2024-03-13 11:59:39 +01:00
formatted.rs refactor the tests suite slightly 2023-09-11 16:56:26 +02:00
geo.rs Make clippy happy 2023-11-23 14:11:38 +01:00
hybrid.rs Add test 2024-03-27 14:02:09 +01:00
mod.rs Merge #4535 2024-04-04 13:10:27 +00:00
multi.rs Tests pass 2023-12-14 16:08:41 +01:00
pagination.rs refactor the tests suite slightly 2023-09-11 16:56:26 +02:00
restrict_searchable.rs Add test reproducing #4232 2023-11-27 11:39:11 +01:00
search_queue.rs fix a flaky test 2024-03-26 21:06:55 +01:00