Span 首位查询

编辑

匹配字段开头附近的跨度。这是一个示例

resp = client.search(
    query={
        "span_first": {
            "match": {
                "span_term": {
                    "user.id": "kimchy"
                }
            },
            "end": 3
        }
    },
)
print(resp)
response = client.search(
  body: {
    query: {
      span_first: {
        match: {
          span_term: {
            'user.id' => 'kimchy'
          }
        },
        end: 3
      }
    }
  }
)
puts response
const response = await client.search({
  query: {
    span_first: {
      match: {
        span_term: {
          "user.id": "kimchy",
        },
      },
      end: 3,
    },
  },
});
console.log(response);
GET /_search
{
  "query": {
    "span_first": {
      "match": {
        "span_term": { "user.id": "kimchy" }
      },
      "end": 3
    }
  }
}

match 子句可以是任何其他 span 类型查询。end 控制匹配中允许的最大结束位置。