Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOD-7009: Search and Query - Empty indexing #199

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions content/commands/ft.create/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ arguments:
optional: true
token: WITHSUFFIXTRIE
type: pure-token
- name: isempty
optional: true
token: ISEMPTY
type: pure-token
- arguments:
- name: sortable
token: SORTABLE
Expand Down Expand Up @@ -258,6 +262,8 @@ after the SCHEMA keyword, declares which fields to index:
- `CASESENSITIVE` for `TAG` attributes, keeps the original letter cases of the tags. If not specified, the characters are converted to lowercase.

- `WITHSUFFIXTRIE` for `TEXT` and `TAG` attributes, keeps a suffix trie with all terms which match the suffix. It is used to optimize `contains` (*foo*) and `suffix` (*foo) queries. Otherwise, a brute-force search on the trie is performed. If suffix trie exists for some fields, these queries will be disabled for other fields.

- `ISEMPTY` for `TEXT` and `TAG` attributes, allows you to index and search for empty strings. By default, empty strings are not indexed.
</details>

## Optional arguments
Expand Down
9 changes: 8 additions & 1 deletion content/develop/interact/search-and-query/query/combined.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,11 @@ Here is an example:
FT.SEARCH idx:bikes_vss "(@price:[500 1000] @condition:{new})=>[KNN 3 @vector $query_vector]" PARAMS 2 "query_vector" "Z\xf8\x15:\xf23\xa1\xbfZ\x1dI>\r\xca9..." DIALECT 2
```

The [vector search article]({{< relref "/develop/interact/search-and-query/query/vector-search" >}}) provides further details about vector queries in general.
The [vector search article]({{< relref "/develop/interact/search-and-query/query/vector-search" >}}) provides further details about vector queries in general.

## Empty values
You can use the simple `isempty(@field)` to query for fields containing empty values (i.e., empty strings for TEXT and TAG fields).

```
FT.SEARCH idx:bikes "isempty(@description) | @description:(kids | small)"
```