query: { bool_query: { must: [ { term_query: { fields: ["id"], operator: "is", values: ["foo"] } }, { text_query: { fields: ["description"], search_phrase: "bar" } } ] } }Example: (id = 'foo' OR description LIKE 'bar')
query: { bool_query: { should: [ { term_query: { fields: ["id"], operator: "is", values: ["foo"] } }, { text_query: { fields: ["description"], search_phrase: "bar" } } ] } }Example: (NOT (id = 'foo' OR description LIKE 'bar'))
query: { bool_query: { must_not: [ { term_query: { fields: ["id"], operator: "is", values: ["foo"] } }, { text_query: { fields: ["description"], search_phrase: "bar" } } ] } }Example: ((coupon_id LIKE "limit" AND description LIKE "limit per customer") AND NOT (enabled=false))
query: { bool_query: { must: [ { text_query: { fields: [ "coupon_id" ], search_phrase: "limit" } }, { text_query: { fields: [ "description" ], search_phrase: "limit per customer" } } ], must_not: [ { term_query: { fields: [ "enabled" ], operator: "is", values: [false] } } ] } }
Property | Type | Constraints | Description |
---|---|---|---|
must |
[Query {BoolQuery, FilteredQuery, MatchAllQuery, NestedQuery, TermQuery, TextQuery}] | List of queries that must match. | |
must_not |
[Query {BoolQuery, FilteredQuery, MatchAllQuery, NestedQuery, TermQuery, TextQuery}] | List of queries that must not match. | |
should |
[Query {BoolQuery, FilteredQuery, MatchAllQuery, NestedQuery, TermQuery, TextQuery}] | List of queries that should match. |