MeiliSearch/meilisearch/src
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
..
analytics Merge #4535 2024-04-04 13:10:27 +00:00
extractors add an experimental cli parameter to allow specifying your task id 2024-02-26 13:58:03 +01:00
routes Merge #4533 2024-03-28 16:02:53 +00:00
error.rs Improve error message 2024-03-27 17:34:49 +01:00
lib.rs rename the method to get a permit and use it in all search requests 2024-03-26 17:28:03 +01:00
main.rs Merge branch 'main' into tmp-release-v1.7.0 2024-03-11 15:39:51 +01:00
metrics.rs Merge #4530 2024-03-25 12:23:31 +00:00
middleware.rs feat: add status code label to prometheus http request counter 2024-03-25 10:49:40 +05:30
option.rs update the discussion link 2024-03-26 19:18:32 +01:00
search_queue.rs connect the search queue with the health route 2024-03-27 15:49:43 +01:00
search.rs Add analytics for the negative operator 2024-03-26 18:01:27 +01:00