Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions text/0118-search-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ The grammar for the value of a filterable attribute is the same as the grammar f
- In:
* `attribute IN[value, value, etc.]`
* `attribute NOT IN[value, value, etc.]`
- IS EMPTY:
* `attribute IS EMPTY`
* `attribute IS NOT EMPTY`
- IS NULL:
* `attribute IS NULL`
* `attribute IS NOT NULL`
- AND: `filter AND filter`
- OR: `filter OR filter`
- NOT: `NOT filter`
Expand Down Expand Up @@ -374,6 +380,76 @@ is equivalent to:
}
```

###### 3.1.2.1.13 Is Empty

The `IS EMPTY` operator selects the documents for which the filterable attribute exists and is empty. If the attribute doesn't exists then it is not empty and the document will not be returned. It is a postfix operator that takes an attribute name as argument.

The negated form of `IS EMPTY` can be written in two ways:
```
attribute IS NOT EMPTY
NOT attribute IS EMPTY
```
Both forms are equivalent. They select the documents for which the attribute is not empty.

For example, with the documents:
```json
[{
"id": 0,
"colour": []
},
{
"id": 1,
"colour": null
},
{
"id": 2,
"colour": ""
},
{
"id": 3,
"colour": {}
},
{
"id": 4
}]
```
Then the filter `colour IS EMPTY` selects the document ids `[0,2,3]` while the filter `colour IS NOT EMPTY` or `NOT colour IS EMPTY` selects the document ids `[1,4]`.

###### 3.1.2.1.13 Is Null

The `IS NULL` operator selects the documents for which the filterable attribute exists and is `null`. If the attribute doesn't exists then it is not `null` and the document will not be returned. It is a postfix operator that takes an attribute name as argument.

The negated form of `IS NULL` can be written in two ways:
```
attribute IS NOT NULL
NOT attribute IS NULL
```
Both forms are equivalent. They select the documents for which the attribute is not `null`.

For example, with the documents:
```json
[{
"id": 0,
"colour": []
},
{
"id": 1,
"colour": null
},
{
"id": 2,
"colour": ""
},
{
"id": 3,
"colour": {}
},
{
"id": 4
}]
```
Then the filter `colour IS NULL` selects the document ids `[1]` while the filter `colour IS NOT NULL` or `NOT colour IS NULL` selects the document ids `[0,2,3,4]`.

#### 3.1.3. `sort`

- Type: Array of String (POST) | String (GET)
Expand Down