Term query #
Returns documents that contain an exact term in a provided field.
You can use the term query to find documents based on a precise value such as a price, a product ID, or a username.
Inside a
nestedquery: supported — the value is matched per array element. Ontextfields prefermatch;termtargets exact keyword / numeric / date values.
Examples #
GET /_search
{
"query": {
"term": {
"field": "org.id",
"value": "infini"
}
}
}
Parameters for term
#
field
(Required, string) Field you wish to search.value
(Required, string) Term you wish to find in the providedfield. To return a document, the term must exactly match the field value, including whitespace and capitalization.case_insensitive
(Optional, boolean) Allows ASCII case insensitive matching of the value with the indexed field values when set totrue. Default isfalse.boost
(Optional, float, default:1.0) Decrease or increase the relevance scores of the query.