MeiliSearch/milli/src/search
bors[bot] d85cd9bf1a
Merge #689
689: Handle non-finite floats consistently in filters r=irevoire a=dureuill

# Pull Request

## Related issue

Related meilisearch/meilisearch#3000

## What does this PR do?

### User

- Filters using `field = inf`, (or `infinite`, `NaN`) now match the value as a string rather than returning an internal error.
- Filters using `field < inf` (or other comparison operators) now return an invalid_filter error rather than returning an internal error, much like when using `field < aaa`.

### Implementation

- Add new `NonFiniteFloat` error variants to the filter-parser errors
- Add `Token::parse_as_finite_float` that can fail both when the string is not a float and when the float is not finite
- Refactor `Filter::inner_evaluate` to always use `parse_as_finite_float` instead of just `parse`
- Add corresponding tests

## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: Louis Dureuil <louis@meilisearch.com>
2022-11-08 13:24:38 +00:00
..
criteria Execute cargo fmt 2022-11-04 08:59:58 +09:00
distinct Fix cargo clippy errors 2022-10-27 01:04:23 +09:00
facet tests: Tests filter with non-finite floats 2022-11-08 13:56:55 +01:00
matches Fix clippy errors 2022-11-04 09:27:46 +09:00
fst_utils.rs custom fst automatons 2022-03-15 17:38:35 +01:00
mod.rs Further unify facet databases of f64s and strings 2022-10-26 13:47:04 +02:00
query_tree.rs Execute cargo fmt 2022-11-04 08:59:58 +09:00