# Span Term 查询

原文链接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.4/query-dsl-span-term-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/query-dsl-span-term-query.html)

译文链接 : [http://www.apache.wiki/pages/viewpage.action?pageId=10029265](http://www.apache.wiki/pages/viewpage.action?pageId=10029265)

贡献者 : [片刻](/display/~jiangzhonglian) [ApacheCN](/display/~apachecn) [Apache中文网](/display/~apachechina)

匹配包含术语的跨度。Span Term查询映射到Lucene SpanTermQuery。这是一个例子：

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

升级也可以与查询相关联：

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

或者 ：

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