You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| term |`field:token`|`app_name:tantivy` <br/> `process_id:1234` <br/> `word`| A term clause tests the existence of avalue in the field's tokens | yes |
33
-
| term prefix |`field:prefix*`|`app_name:tant*` <br/> `quick*`| A term clause tests the existence of a token starting with the provided value | yes |
34
-
| term set |`field:IN [token token ..]`|`severity:IN [error warn]`| A term set clause tests the existence of any of the provided value in the field's tokens| yes |
35
-
| phrase |`field:"sequence of tokens"`|`full_name:"john doe"`| A phrase clause tests the existence of the provided sequence of tokens | yes |
36
-
| phrase prefix |`field:"sequence of tokens"*`|`title:"how to m"*`| A phrase prefix clause tests the exsitence of a sequence of tokens, the last one used like in a prefix clause | yes |
32
+
| term |`field:token`|`app_name:tantivy` <br/> `process_id:1234` <br/> `word`| A term clause tests the existence of avalue in the field's tokens | yes |
33
+
| term prefix |`field:prefix*`|`app_name:tant*` <br/> `quick*`| A term clause tests the existence of a token starting with the provided value | yes |
34
+
| term set |`field:IN [token token ..]`|`severity:IN [error warn]`| A term set clause tests the existence of any of the provided value in the field's tokens| yes |
35
+
| phrase |`field:"sequence of tokens"`|`full_name:"john doe"`| A phrase clause tests the existence of the provided sequence of tokens | yes |
36
+
| phrase prefix |`field:"sequence of tokens"*`|`title:"how to m"*`| A phrase prefix clause tests the exsitence of a sequence of tokens, the last one used like in a prefix clause | yes |
37
37
| all |`*`|`*`| A match-all clause will match every document | no |
38
-
| exist |`field:*`|`error:*`| An exist clause tests the existence of any value for the field, it will match only if the field exists | no |
39
-
| range |`field:bounds`|`duration:[0 1000}` <br/> `last_name: [banner miller]`| A term clause tests the existence of a token between the provided bounds | no |
38
+
| exist |`field:*`|`error:*`| An exist clause tests the existence of any value for the field, it will match only if the field exists | no |
39
+
| range |`field:bounds`|`duration:[0 TO 1000}` <br/> `last_name: [banner TO miller]`| A term clause tests the existence of a token between the provided bounds | no |
Special reserved characters are: `+` , `^`, `` ` ``, `:`, `{`, `}`, `"`, `[`, `]`, `(`, `)`, `~`, `!`, `\\`, `*`, `SPACE`. Such characters can still appear in query terms, but they need to be escaped by an anti-slash `\`.
30
+
Some characters need to be escaped in non quoted terms because they are syntactically significant otherwise: special reserved characters are: `+` , `^`, `` ` ``, `:`, `{`, `}`, `"`, `[`, `]`, `(`, `)`, `~`, `!`, `\\`, `*`, `SPACE`. If such such characters appear in query terms, they need to be escaped by prefixing them with an anti-slash `\`.
30
31
31
-
<!-- NEED CLARIFICATION: where is escaping necessary ? non-quoted terms ? field names ?-->
32
+
In quoted terms, the quote character in use `'` or `"` needs to be escaped.
32
33
33
-
### Allowed characters in field names
34
-
<!-- NEED CLARIFICATION: this should refer to a section of the index documentation that explains allowed field names -->
34
+
###### Allowed characters in field names
35
+
36
+
See the [Field name validation rules](https://quickwit.io/docs/configuration/index-config#field-name-validation-rules) in the index config documentation.
35
37
36
38
### Addressing nested structures
37
39
@@ -66,7 +68,7 @@ There is no support for searching for a range of IP using CIDR notation, but you
66
68
67
69
### Term `field:term`
68
70
```
69
-
term: term_char+
71
+
term = term_char+
70
72
```
71
73
72
74
Matches documents if the targeted field contains a token equal to the provided term.
@@ -75,15 +77,14 @@ Matches documents if the targeted field contains a token equal to the provided t
75
77
76
78
### Term Prefix `field:prefix*`
77
79
```
78
-
term_prefix: term '*'
80
+
term_prefix = term '*'
79
81
```
80
82
81
83
Matches documents if the targeted field contains a token which starts with the provided value.
82
84
83
85
`field:quick*` will match any document where the field 'field' has a token like `quickwit` or `quickstart`, but not `qui` or `abcd`.
84
86
85
-
86
-
### Term set `field: IN [a b c]`
87
+
### Term set `field:IN [a b c]`
87
88
```
88
89
term_set = 'IN' '[' term_list ']'
89
90
term_list = term_list term
@@ -92,7 +93,7 @@ term_list = term_list term
92
93
Matches if the document contains any of the tokens provided.
93
94
94
95
###### Examples
95
-
`field:IN [ab cd]` will match 'ab' or 'cd', but nothing else.
96
+
`field:IN [ab cd]` will match 'ab' or 'cd', but nothing else.
96
97
97
98
###### Perfomance Note
98
99
This is a lot like writing `field:ab OR field:cd`. When there are only a handful of terms to search for, using ORs is usually faster.
@@ -133,24 +134,20 @@ There is no slop for phrase prefix queries.
133
134
134
135
###### Limitation
135
136
136
-
Quickwit may trim some results matched by this clause in some cases. If you search for `"thanks for your co"*`, it will enumerate the first 50 tokens which start with "co", and search for any documents where "thanks for your" is followed by any of these tokens.
137
+
Quickwit may trim some results matched by this clause in some cases. If you search for `"thanks for your co"*`, it will enumerate the first 50 tokens which start with "co" (in their storage order), and search for any documents where "thanks for your" is followed by any of these tokens.
137
138
138
139
If there are many tokens starting with "co", "contribution" might not be one of the 50 selected tokens, and the query won't match a document containing "thanks for your contribution". Normal prefix queries don't suffer from this issue.
139
140
140
-
141
-
<!-- NEEDS CLARIFICATION : what does "first 50 tokens" mean ? in what order ? can the value be tuned ? -->
@@ -171,7 +168,7 @@ Exclusive bounds are represented by curly brackets `{}`. They will not match tok
171
168
You can make an half open range by using `*` as one of the bounds. `field:[b TO *]` will match 'bb' and 'zz', but not 'ab'.
172
169
You can also use a comparison based syntax:`field:<b`, `field:>b`, `field:<=b` or `field:>=b`.
173
170
174
-
<!--NEEDS CLARIFICATION : ordering of empty values ?-->
171
+
<!--NOTE : empty avlues likely not indexed-->
175
172
176
173
###### Examples
177
174
- Inclusive Range: `ip:[127.0.0.1 TO 127.0.0.50]`
@@ -224,13 +221,9 @@ Without parentheses, `AND` takes precedence over `OR`. That is, `a AND b OR c` i
224
221
## Other considerations
225
222
226
223
### Default Search Fields
227
-
In many case it is possible to omit the field you search if it was configured in the `default_search_fields` array of the index configuration.
228
-
229
-
<!-- NEED CLARIFICATION : default fields clauses behavior on an array is combined using OR or AND ? -->
224
+
In many case it is possible to omit the field you search if it was configured in the `default_search_fields` array of the index configuration. If more than one field is configured as default, the resulting implicit clauses are combined using a conjunction ('OR').
230
225
231
226
### Tokenization
232
227
Note that the result of a query can depend on the tokenizer used for the field getting searched. Hence this document always speaks of tokens, which may be the exact value the document contain (in case of the raw tokenizer), or a subset of it (for instance any tokenizer cutting on spaces).
233
228
234
229
<!-- NOTE : should dig deeper ? -->
235
-
Quickwit uses a query mini-language which is used by providing a `query` parameter to the search endpoints.
236
-
<!-- todo also used in some place in ES: where? -->
0 commit comments