forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
217 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
// Match all queries | ||
* | ||
*:* | ||
(*:*) | ||
|
||
// Queries with no field | ||
200 | ||
foo | ||
foo bar | ||
(foo bar) | ||
foo* | ||
*foo | ||
f*oo | ||
"foo bar" | ||
|
||
// Queries with all fields | ||
*:200 | ||
*:foo | ||
*:foo bar | ||
*:foo* | ||
*:f*oo | ||
*: *foo | ||
*:"foo bar" | ||
|
||
// Querying a field | ||
foo_field:200 | ||
foo_field:foo | ||
foo_field:foo bar | ||
foo_field:(foo bar) | ||
foo_field:foo* | ||
foo_field: f*oo | ||
foo_field: *foo | ||
foo_field:"foo bar" | ||
foo_field.subfield:foo | ||
foo_*_field:foo | ||
foo_field:* | ||
foo_*:* | ||
|
||
// Range queries | ||
foo_field<200 | ||
foo_field<foo | ||
foo_field<"foo bar" | ||
foo_field>=200 | ||
foo_field>=foo | ||
foo_field>"foo bar" | ||
foo_field<=foo | ||
foo_field>=foo | ||
|
||
// Boolean queries | ||
NOT foo | ||
NOT foo bar | ||
NOT foo_field:foo | ||
NOT foo_field<foo | ||
foo_field:foo AND foo_field:foo bar | ||
foo_field<foo AND foo_field>bar | ||
(foo_field:foo) AND (foo_field:foo bar) | ||
foo_field:foo OR foo_field:foo bar | ||
NOT(foo_field:foo OR foo_field:foo bar) | ||
NOT(foo_field:foo AND foo_field:foo bar) | ||
NOT foo_field:foo AND NOT foo_field:foo bar | ||
(NOT foo_field:foo) AND (NOT foo_field:foo bar) | ||
NOT(foo_field:foo) AND NOT(foo_field:foo bar) | ||
foo_field:foo AND foo_field:foo bar AND foo bar | ||
foo_field:foo AND foo_field:foo bar OR foo bar | ||
foo_field:foo OR foo_field:foo bar OR foo bar | ||
foo_field:foo OR foo_field:foo bar AND foo bar | ||
foo_field:foo AND (foo_field:foo bar OR foo bar) | ||
foo_field:foo AND (foo_field:foo bar OR foo bar) | ||
foo_field:foo OR (foo_field:foo bar OR foo bar) | ||
|
||
// Nested queries | ||
nested_field: { NOT foo } | ||
nested_field: { NOT foo bar } | ||
nested_field: { NOT foo_field:foo } | ||
nested_field: { foo_field:foo AND foo_field:foo bar } | ||
nested_field: { foo_field<foo AND foo_field>bar } | ||
nested_field: { (foo_field:foo) AND (foo_field:foo bar) } | ||
nested_field: { foo_field:foo OR foo_field:foo bar } | ||
nested_field: { NOT(foo_field:foo OR foo_field:foo bar) } | ||
nested_field: { NOT(foo_field:foo AND foo_field:foo bar) } | ||
nested_field: { NOT foo_field:foo AND NOT foo_field:foo bar } | ||
nested_field: { (NOT foo_field:foo) AND (NOT foo_field:foo bar) } | ||
nested_field: { NOT(foo_field:foo) AND NOT(foo_field:foo bar) } | ||
nested_field: { foo_field:foo AND foo_field:foo bar AND foo bar } | ||
nested_field: { foo_field:foo AND foo_field:foo bar OR foo bar } | ||
nested_field: { foo_field:foo OR foo_field:foo bar OR foo bar } | ||
nested_field: { foo_field:foo OR foo_field:foo bar AND foo bar } | ||
nested_field: { foo_field:foo AND (foo_field:foo bar OR foo bar) } | ||
nested_field: { foo_field:foo AND (foo_field:foo bar OR foo bar) } | ||
nested_field: { foo_field:foo OR (foo_field:foo bar OR foo bar) } | ||
nested_field: { sub_nested_field : { foo_field:foo } AND foo_field:foo bar } | ||
|
||
// Queries with escape sequences | ||
foo_field : (foo\(bar\)) | ||
foo_field : foo\:bar | ||
foo_field : (foo \and bar) | ||
foo_field : (foo \or bar) | ||
foo_field : foo \not bar | ||
foo_field : foo \{bar\} | ||
foo_field : foo \(bar\) | ||
foo_field : foo \\ bar | ||
foo_field : foo \"bar\" | ||
|
||
foo_field : "foo and bar" | ||
foo_field : "foo not bar" | ||
foo_field : "foo or bar" | ||
foo_field : "foo : bar" | ||
foo_field : "foo { bar }" | ||
foo_field : "foo (bar)" | ||
foo_field : "foo \\ bar" | ||
foo_field : "foo \"bar\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
// Incomplete expressions | ||
foo_field : | ||
foo_field < | ||
foo_field > | ||
foo_field >= | ||
foo_field <= | ||
|
||
// Parentheses mismatch | ||
foo_field: (foo bar | ||
foo_field: foo bar) | ||
NOT foo_field:foo OR foo_field:foo bar) | ||
NOT (foo_field:foo AND) foo_field:foo bar | ||
|
||
// Quotes mismatch | ||
foo_field: "foo bar | ||
foo_field: foo bar" | ||
|
||
|
||
// Invalid boolean queries | ||
foo AND | ||
AND foo | ||
foo OR | ||
OR foo | ||
NOT foo: | ||
|
||
// Can't nest grouping terms parentheses | ||
foo_field:(foo (bar)) | ||
|
||
// Bad syntax for nested fields: | ||
nested_field { foo: bar } | ||
|
||
// Missing escape sequences: | ||
foo_field: foo:bar | ||
foo_field: (foo and bar) | ||
foo_field: (foo or bar) | ||
foo_field: foo not bar | ||
foo_field: foo { bar } | ||
foo_field: foo (bar) | ||
foo_field: foo "bar" | ||
foo_field: "foo\ bar" | ||
foo_field: "foo "bar"" |