import type { TermQueryValuesInner } from './TermQueryValuesInner'; /** * @type TermQuery: A term query matches one or more values against one or more document fields. A document is considered a hit if one of the values matches exactly with at least one of the given fields. The operator `is` can only take one value, while `one_of` can take multiple values. If multiple fields are specified, they are combined using a logical `OR` operator. **Limitations:** * The `greater` and `less` operators are not supported under certain conditions. Both operators are permitted unless the API documentation states otherwise. * A subset of Commerce APIs handle queries with multiple fields differently. If the query has multiple fields, the query is internally handled as a logical `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. * * @property fields: The document fields that the values are matched against, combined with the operator. * * @property operator: Returns the operator to use for the term query. * * @property values: The values that the fields are compared against, combined with the operator. * */ export type TermQuery = { fields: Array; operator: TermQueryOperatorEnum; values?: Array; } & { [key: string]: any; }; export type TermQueryOperatorEnum = 'is' | 'one_of' | 'is_null' | 'is_not_null' | 'less' | 'greater' | 'not_in' | 'neq';