MeiliSearch/milli/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
..
documents Add tracing to milli 2024-02-08 15:03:31 +01:00
facet update milli with the new parser_filter 2021-11-04 15:02:36 +01:00
heed_codec Clarify an unreachable unwrap 2023-11-28 14:26:31 +01:00
prompt Remove prompt strategy and fallback 2023-12-14 16:08:41 +01:00
search Support negative phrases 2024-03-28 15:51:43 +01:00
snapshots/index.rs Fix tests 2023-06-14 13:30:52 +02:00
update Merge #4537 2024-04-03 09:08:58 +00:00
vector Finer granularity for embedder needs reindex 2024-03-27 12:01:34 +01:00
asc_desc.rs fmt 2023-03-30 23:37:26 +02:00
criterion.rs update the syntax of the geoboundingbox filter to uses brackets instead of parens around lat and lng 2023-02-06 16:50:27 +01:00
error.rs Check validity of the URL setting 2024-03-25 11:23:16 +01:00
external_documents_ids.rs Make clippy happy 2023-11-23 14:11:38 +01:00
fields_ids_map.rs Rename trait 2023-11-13 13:38:36 +01:00
index.rs Merge #4535 2024-04-04 13:10:27 +00:00
lib.rs Revert "Revert "Merge remote-tracking branch 'origin/main' into release-v1.7.1"" 2024-03-20 10:08:28 +01:00
order_by_map.rs Revert "Revert "Merge remote-tracking branch 'origin/main' into release-v1.7.1"" 2024-03-20 10:08:28 +01:00
proximity.rs Change the naming of attributeScale and wordScale into byAttribute and byWord 2023-12-14 16:31:00 +01:00
score_details.rs return the order in the score details 2024-03-19 15:45:04 +01:00
snapshot_tests.rs Update tests 2023-11-13 13:36:39 +01:00