Span within 查询
编辑Span within 查询
编辑返回被包含在另一个 span 查询内的匹配项。这里有一个例子
resp = client.search( query={ "span_within": { "little": { "span_term": { "field1": "foo" } }, "big": { "span_near": { "clauses": [ { "span_term": { "field1": "bar" } }, { "span_term": { "field1": "baz" } } ], "slop": 5, "in_order": True } } } }, ) print(resp)
response = client.search( body: { query: { span_within: { little: { span_term: { "field1": 'foo' } }, big: { span_near: { clauses: [ { span_term: { "field1": 'bar' } }, { span_term: { "field1": 'baz' } } ], slop: 5, in_order: true } } } } } ) puts response
const response = await client.search({ query: { span_within: { little: { span_term: { field1: "foo", }, }, big: { span_near: { clauses: [ { span_term: { field1: "bar", }, }, { span_term: { field1: "baz", }, }, ], slop: 5, in_order: true, }, }, }, }, }); console.log(response);
GET /_search { "query": { "span_within": { "little": { "span_term": { "field1": "foo" } }, "big": { "span_near": { "clauses": [ { "span_term": { "field1": "bar" } }, { "span_term": { "field1": "baz" } } ], "slop": 5, "in_order": true } } } } }
big
和 little
子句可以是任何 span 类型查询。返回 little
中被包含在 big
内的匹配 span。