Commit Graph

54 Commits

Author SHA1 Message Date
9af69c151b Limit the maximum depth of filters
This should have no impact on the user but is there to safeguard
meilisearch against malicious inputs.
2022-08-18 11:31:38 +02:00
98f0da6b38 Simplify representation of nested NOT filters 2022-08-18 10:58:24 +02:00
b030efdc83 Fix parsing of IN[] filter followed by whitespace + factorise its impl 2022-08-18 10:58:04 +02:00
497f9817a2 Use snapshot testing for the filter parser 2022-08-17 17:35:01 +02:00
238a7be58d Fix filter parser handling of keywords and surrounding spaces
Now the following fragments are allowed:

AND(field =

AND'field' =

AND"field" =
2022-08-17 16:53:40 +02:00
b09a8f1b91 Filters: add explicit error message when using a keyword as value 2022-08-17 16:07:00 +02:00
196f79115a Run cargo fmt 2022-08-17 12:28:33 +02:00
4ecfb95d0c Improve syntax errors for IN filter 2022-08-17 12:28:33 +02:00
2fd20fadfc Implement the NOT IN syntax for negated IN filter 2022-08-17 12:28:33 +02:00
ca97cb0eda Implement the IN filter operator 2022-08-17 12:28:33 +02:00
90a304cb07 Fix tests after simplification of NOT filter 2022-08-17 12:28:33 +02:00
cc7415bb31 Simplify FilterCondition code, made possible by the new NOT operator 2022-08-17 12:28:33 +02:00
44744d9e67 Implement the simplified NOT operator 2022-08-17 12:28:33 +02:00
258c3dd563 Make AND+OR filters n-ary (store a vector of subfilters instead of 2)
NOTE: The token_at_depth is method is a bit useless now, as the only
cases where there would be a toke at depth 1000 are the cases where
the parser already stack-overflowed earlier.

Example: (((((... (x=1) ...)))))
2022-08-17 12:28:33 +02:00
1fe224f2c6 Update filter-parser/fuzz/.gitignore
Co-authored-by: Many the fish <many@meilisearch.com>
2022-07-21 16:12:01 +02:00
07003704a8 Merge branch 'filter/field-exist' 2022-07-21 14:51:41 +02:00
d5e9b7305b Update version for next release (v0.32.0) 2022-07-21 13:20:02 +04:00
ea0642c32d Make filter parser more strict regarding spacing around operators
OR, AND, NOT, TO must now be followed by spaces
2022-07-19 10:07:33 +02:00
392472f4bb Apply suggestions from code review
Co-authored-by: Tamo <tamo@meilisearch.com>
2022-07-19 10:07:33 +02:00
bd15f5625a Fix compiler warning 2022-07-19 10:07:33 +02:00
722db7b088 Ignore target directory of filter-parser/fuzz crate 2022-07-19 10:07:33 +02:00
a5c9162250 Improve parser for NOT EXISTS filter
Allow multiple spaces between NOT and EXISTS
2022-07-19 10:07:33 +02:00
dc64170a69 Improve syntax of EXISTS filter, allow “value NOT EXISTS” 2022-07-19 10:07:33 +02:00
72452f0cb2 Implements the EXIST filter operator 2022-07-19 10:07:33 +02:00
cc48992e79 Bump the milli version to 0.31.1 2022-06-22 17:05:51 +02:00
f5c3b951bc Bump the milli version to 0.31.0 2022-06-22 12:08:16 +02:00
31f749b5d8 Update version for next release (v0.30.0) 2022-06-20 12:09:57 +02:00
676187ba43 bump milli version 2022-06-09 16:53:32 +02:00
90afde435b fix escaped quotes in filter 2022-06-09 16:03:49 +02:00
56ee9cc21f Bump the version to 0.29.2 2022-06-08 16:00:06 +02:00
478dbfa45a Update version for next release (v0.29.1) 2022-06-07 18:59:33 +02:00
6ce1c6487a Update version for next release (v0.29.0) 2022-06-02 18:07:55 +02:00
c19c17eddb Update version to v0.28.1 2022-06-01 18:31:02 +02:00
895f5d8a26 Bump milli version 2022-05-18 10:37:12 +02:00
d138b3c704 Update version 2022-04-25 18:43:46 +02:00
fb192aaa9f Update the list of milli's subcrates 2022-04-25 15:55:38 +02:00
63682c2c9a Upgrade the dependencies 2022-03-15 11:17:44 +01:00
0f213f2202 Replace MeiliSearch by Meilisearch 2022-01-26 17:49:55 +01:00
660eac50b2 Merge #427
427: Handle escaped characters in filters r=Kerollmops a=irevoire



Co-authored-by: Tamo <tamo@meilisearch.com>
2022-01-10 15:01:23 +00:00
92804f6f45 apply clippy suggestions 2022-01-10 15:59:04 +01:00
0fcde35a20 Update filter-parser/src/value.rs
Co-authored-by: Clément Renault <clement@meilisearch.com>
2022-01-10 15:53:44 +01:00
3c7ea1d298 Apply code suggestions
Co-authored-by: Clément Renault <clement@meilisearch.com>
2022-01-10 15:19:21 +01:00
9bdcd42b9b reintroduce the gitignore for the fuzzer 2022-01-04 13:07:32 +01:00
02a21fd309 Handle the escapes of quote in the filters 2022-01-04 04:04:10 +01:00
ef59762d8e Prefer returning None instead of the Empty Filter state 2021-12-09 11:57:52 +01:00
32bd9f091f Detect the filters that are too deep and return an error 2021-12-07 17:20:11 +01:00
49c2db9485 Change the depth function to return the token depth 2021-12-07 16:06:10 +01:00
57502fcf6a Introduce the depth method on FilterCondition 2021-12-06 17:35:20 +01:00
7c3017734a re-ignore the ! symbol when generating a good error message 2021-11-09 17:08:04 +01:00
bff48681d2 Re-order the operator
Co-authored-by: Clément Renault <clement@meilisearch.com>
2021-11-09 17:05:36 +01:00