less
and greater
operators are not compatible with some search types.
To query based on numeric bounds in those cases, you can use a range filter on a
filtered query.
Elastic only: If used with multiple fields, the query is internally handled as a boolean OR of DisjointMaxQueries (with the dismax
matching a value against all fields). The dismax makes sure that a document carrying a single term in
multiple fields does not get higher scores than a document matching multiple terms in multiple fields.
Example: (id="my_id")
query: { term_query: { fields: ["id"], operator: "is", values: ["my_id"] } }Example: (id IN ("my_id","other_id"))
query: { term_query: { fields: ["id"], operator: "one_of", values: ["my_id","other_id"] } }Example: (id=null)
query: { term_query: { fields: ["description"], operator: "is_null" } }Example: ((id IN ('generic', 'keyword')) OR (description IN ('generic', 'keyword'))
query: { term_query: { fields: ["id", "description"], operator: "one_of", values: ["generic","keyword"] } }
Property | Type | Constraints | Description |
---|---|---|---|
fields |
[String] | mandatory=true, minItems=1, nullable=false | The document field(s), the value(s) are matched against, combined with the operator. |
operator |
Enum {is, one_of, is_null, is_not_null, less, greater, not_in, neq} | mandatory=true, nullable=false | Returns the operator to use for the term query. |
values |
[Object] | The values, the field(s) are compared against, combined with the operator. |