Span Within 查询

原文链接 : https://www.elastic.co/guide/en/elasticsearch/reference/5.4/query-dsl-span-within-query.html

译文链接 : http://www.apache.wiki/pages/viewpage.action?pageId=10029290

贡献者 : 片刻 ApacheCN Apache中文网

返回在另一个span查询中包含的匹配。查询内的范围映射到Lucene SpanWithinQuery。这是一个例子:

  1. GET /_search
  2. {
  3. "query": {
  4. "span_within" : {
  5. "little" : {
  6. "span_term" : { "field1" : "foo" }
  7. },
  8. "big" : {
  9. "span_near" : {
  10. "clauses" : [
  11. { "span_term" : { "field1" : "bar" } },
  12. { "span_term" : { "field1" : "baz" } }
  13. ],
  14. "slop" : 5,
  15. "in_order" : true
  16. }
  17. }
  18. }
  19. }
  20. }

big和little的子句可以是任何span类型查询。在big中从已关闭的little匹配跨度返回。