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

Update tantivy to fix json path search escaping '.' #2329

Merged
merged 2 commits into from
Nov 17, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions docs/reference/query-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ title:"barack obama" AND president

Note that a query like `title:barack obama` will find only `barack` in the title and `obama` in the default fields. If no default field has been set on the index, this will result in an error.

### Searching structures nested in documents.

Quickwit is designed to index structured data.
If you search into some object nested into your document, whether it is an `object`, a `json` object, or a whether it was caught through the `dynamic` mode, the query language is the same. You simply need to chain the different steps to reach your value from the root of the document.

For instance, the document `{"product": {"attributes": {color": "red"}}}` is returned if you query `product.attributes.color:red`.
If a dot `.` exists in one of the key of your object, you need to escape it.
For instance, the document `{"attributes": {"server.name": "elephant"}}` is returned if you query `attributes:server\.name:elephant`.

### Boolean Operators

Quickwit supports `AND`, `+`, `OR`, `NOT` and `-` as Boolean operators (case sensitive). By default, the `AND` is chosen, this means that if you omit it in a query like `title:"barack obama" president` Quickwit will interpret the query as `title:"barack obama" AND president`.
Expand All @@ -46,7 +55,7 @@ Slop queries can only be used on field indexed with the [record option](./../con
#### Examples:

With the following corpus:
```json
```json
[
{"id": 1, "body": "a red bike"},
{"id": 2, "body": "a small blue bike"},
Expand All @@ -55,14 +64,14 @@ With the following corpus:
{"id": 5, "body": "a tiny shelter"}
]
```
The following queries will output:
The following queries will output:

- `body:"small bird"~2`: no match []
- `body:"red bike"~2`: matches [1]
- `body:"small blue bike"~3`: matches [2]
- `body:"small bike"`: matches [4]
- `body:"small bike"~1`: matches [2, 4]
- `body:"small bike"~2`: matches [2, 4]
- `body:"small bike"~2`: matches [2, 4]
- `body:"small bike"~3`: matches [2, 3, 4]

### Escaping Special Characters
Expand Down
12 changes: 6 additions & 6 deletions quickwit/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions quickwit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ quickwit-serve = { version = "0.3.1", path = "./quickwit-serve" }
quickwit-storage = { version = "0.3.1", path = "./quickwit-storage" }
quickwit-telemetry = { version = "0.3.1", path = "./quickwit-telemetry" }

fastfield_codecs = { git = "https://github.com/quickwit-oss/tantivy/", rev = "55a9d80" }
tantivy = { git = "https://github.com/quickwit-oss/tantivy/", rev = "55a9d80", default-features = false, features = [
fastfield_codecs = { git = "https://github.com/quickwit-oss/tantivy/", rev = "2a39289" }
tantivy = { git = "https://github.com/quickwit-oss/tantivy/", rev = "2a39289", default-features = false, features = [
"mmap",
"lz4-compression",
"zstd-compression",
"quickwit",
] }
tantivy-query-grammar = { git = "https://github.com/quickwit-oss/tantivy/", rev = "55a9d80" }
tantivy-query-grammar = { git = "https://github.com/quickwit-oss/tantivy/", rev = "2a39289" }

# This is actually not used directly the goal is to fix the version
# used by reqwest. 0.8.30 has an unclear license.
Expand Down