-
Notifications
You must be signed in to change notification settings - Fork 688
Query String Query
The query language query allows humans to describe complex queries using a simple syntax.
Plain terms without any other syntax are interpreted as a match query for the term in the default field. The default field is _all
unless overridden in the index mapping.
Example: water
will perform a [Match Query](Match Query) for the term water
.
You can qualify the field for these searches by prefixing them with the name of the field separated by a colon.
Example: description:water
will perform a [Match Query](Match Query) for the term water
, in the description
field.
When you query string includes multiple items, by default these are placed into the SHOULD clause of a [Boolean Query](Boolean Query). You can change this by prefixing them with a +
or '-'. Prefixing with plus places that query in the MUST portion of the boolean query. Prefixing with a minus places that query in the MUST NOT portion of the boolean query.
Example: +description:water -light beer
will perform a [Boolean Query](Boolean Query) that MUST satisfy the Match Query for the term water
in the description
field, MUST NOT satisfy the Match Query for the term light
in the default field, and SHOULD satisfy the Match Query for the term beer
in the default field. Result documents satisfying the SHOULD clause will score higher than those that do not.