Commit Graph

28 Commits

Author SHA1 Message Date
bors[bot] 414b3fae89
Merge #3571
3571: Introduce two filters to select documents with `null` and empty fields r=irevoire a=Kerollmops

# Pull Request

## Related issue
This PR implements the `X IS NULL`, `X IS NOT NULL`, `X IS EMPTY`, `X IS NOT EMPTY` filters that [this comment](https://github.com/meilisearch/product/discussions/539#discussioncomment-5115884) is describing in a very detailed manner.

## What does this PR do?

### `IS NULL` and `IS NOT NULL`

This PR will be exposed as a prototype for now. Below is the copy/pasted version of a spec that defines this filter.

- `IS NULL` matches fields that `EXISTS` AND `= IS NULL`
- `IS NOT NULL` matches fields that `NOT EXISTS` OR `!= IS NULL`

1. `{"name": "A", "price": null}`
2. `{"name": "A", "price": 10}`
3. `{"name": "A"}`

`price IS NULL` would match 1
`price IS NOT NULL` or `NOT price IS NULL` would match 2,3
`price EXISTS` would match 1, 2
`price NOT EXISTS` or `NOT price EXISTS` would match 3

common query : `(price EXISTS) AND (price IS NOT NULL)` would match 2

### `IS EMPTY` and `IS NOT EMPTY`

- `IS EMPTY` matches Array `[]`, Object `{}`, or String `""` fields that `EXISTS` and are empty
- `IS NOT EMPTY` matches fields that `NOT EXISTS` OR are not empty.

1. `{"name": "A", "tags": null}`
2. `{"name": "A", "tags": [null]}`
3. `{"name": "A", "tags": []}`
4. `{"name": "A", "tags": ["hello","world"]}`
5. `{"name": "A", "tags": [""]}`
6. `{"name": "A"}`
7. `{"name": "A", "tags": {}}`
8. `{"name": "A", "tags": {"t1":"v1"}}`
9. `{"name": "A", "tags": {"t1":""}}`
10. `{"name": "A", "tags": ""}`

`tags IS EMPTY` would match 3,7,10
`tags IS NOT EMPTY` or `NOT tags IS EMPTY` would match 1,2,4,5,6,8,9
`tags IS NULL` would match 1
`tags IS NOT NULL` or `NOT tags IS NULL` would match 2,3,4,5,6,7,8,9,10
`tags EXISTS` would match 1,2,3,4,5,7,8,9,10
`tags NOT EXISTS` or `NOT tags EXISTS` would match 6

common query : `(tags EXISTS) AND (tags IS NOT NULL) AND (tags IS NOT EMPTY)` would match 2,4,5,8,9

## What should the reviewer do?

- Check that I tested the filters
- Check that I deleted the ids of the documents when deleting documents


Co-authored-by: Clément Renault <clement@meilisearch.com>
Co-authored-by: Kerollmops <clement@meilisearch.com>
2023-04-27 13:14:00 +00:00
filip f267bed352
remove a unnecessary comment
Co-authored-by: Tamo <irevoire@protonmail.ch>
2023-04-05 13:44:55 +02:00
Filip Bachul 0fba08cd72 fmt 2023-04-03 20:18:26 +02:00
Filip Bachul 189d4c3b70 add geoPoint integration tests 2023-04-03 20:18:26 +02:00
Filip Bachul 52b4090286 update integration tests 2023-04-03 20:18:26 +02:00
Clément Renault ea016d97af
Implementing an IS EMPTY filter 2023-03-15 14:12:34 +01:00
Clément Renault fa2ea4a379
Update the test to accept the new IS syntax 2023-03-14 10:31:27 +01:00
bors[bot] c88c3637b4
Merge #3461
3461: Bring v1 changes into main r=curquiza a=Kerollmops

Also bring back changes in milli (the remote repository) into main done during the pre-release

Co-authored-by: Loïc Lecrenier <loic.lecrenier@me.com>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Co-authored-by: curquiza <curquiza@users.noreply.github.com>
Co-authored-by: Tamo <tamo@meilisearch.com>
Co-authored-by: Philipp Ahlner <philipp@ahlner.com>
Co-authored-by: Kerollmops <clement@meilisearch.com>
2023-02-07 11:27:27 +00:00
Tamo 7a38fe624f
throw an error if the top left corner is found below the bottom right corner 2023-02-06 17:50:47 +01:00
Guillaume Mourier 426d63b01b
Update insta test suite 2023-02-02 12:27:56 +01:00
Louis Dureuil 57682cbabe
Fix test url after #3398 2023-01-23 15:43:17 +01:00
ManyTheFish 5dd582918d
Add test 2023-01-23 15:40:42 +01:00
Louis Dureuil 56db54486c
Add tests 2023-01-23 14:00:30 +01:00
Louis Dureuil d2420f5c8f
Fix non insta tests 2023-01-19 16:10:05 +01:00
Louis Dureuil 72e2b220ed
Fix tests 2023-01-19 15:48:20 +01:00
Louis Dureuil 3d8ca62c35
InvalidFacetDistribution returns invalid_search_facet 2023-01-19 13:41:26 +01:00
Loïc Lecrenier 9194508a0f Refactor query parameter deserialisation logic 2023-01-17 11:07:07 +01:00
Loïc Lecrenier 436ae4e466 Improve error messages generated by deserr
Split Json and Query Parameter error types
2023-01-17 09:43:07 +01:00
Tamo 6d658f4c52
fix a wrong error code + update some error messages 2023-01-11 19:14:11 +01:00
bors[bot] 808e184069
Merge #3324
3324: Add a test on the search route for each possible error codes r=irevoire a=irevoire



Co-authored-by: Tamo <tamo@meilisearch.com>
2023-01-11 16:08:19 +00:00
Tamo 7a30d98264
fix a flaky test 2023-01-11 14:54:29 +01:00
Tamo d0a85057a3 fix the bad filter test 2023-01-11 11:37:12 +01:00
Tamo d4157c0ce4
add a test on the search route for each possible error codes
snapshot the json directly instead of using the debug formatting
2023-01-10 17:59:24 +01:00
Tamo d308684395 remove two ununsed error codes + fix the sort error_code 2023-01-10 11:32:11 +01:00
Tamo ce3e8794a2
fix the tests after the rebase 2023-01-05 20:52:26 +01:00
Tamo 50ce0409bc
Integrate deserr on the most important routes 2023-01-05 20:48:29 +01:00
Loïc Lecrenier 2d74678b51 Replace underscores with hyphens in doc link to error code 2023-01-05 10:09:02 +01:00
Colby Allen ad2b1467da Renames meilisearch-http to meilisearch 2022-12-08 08:22:53 -07:00