原英文版地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/query-dsl-span-term-query.html, 原文档版权归 www.elastic.co 所有
本地英文版地址: ../en/query-dsl-span-term-query.html

span_term 查询

匹配包含指定词项的 span。它对一个 Lucene 的 SpanTermQuery。这里是一个例子:

GET /_search
{
    "query": {
        "span_term" : { "user" : "kimchy" }
    }
}

增强(boost)也可以与查询相关联:

GET /_search
{
    "query": {
       "span_term" : { "user" : { "value" : "kimchy", "boost" : 2.0 } }
    }
}

或者:

GET /_search
{
    "query": {
        "span_term" : { "user" : { "term" : "kimchy", "boost" : 2.0 } }
    }
}