mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
Improvement includes: 1. Remove reference to Lucene queries (this information is not necessary for Elastic users, and can be outdated) 2. For `span_field_masking` include a node to use "require_field_match" : false parameter for highlighters to work. Closes #101804
41 lines
853 B
Text
41 lines
853 B
Text
[[query-dsl-span-term-query]]
|
|
=== Span term query
|
|
++++
|
|
<titleabbrev>Span term</titleabbrev>
|
|
++++
|
|
|
|
Matches spans containing a term. Here is an example:
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
GET /_search
|
|
{
|
|
"query": {
|
|
"span_term" : { "user.id" : "kimchy" }
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
|
|
A boost can also be associated with the query:
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
GET /_search
|
|
{
|
|
"query": {
|
|
"span_term" : { "user.id" : { "value" : "kimchy", "boost" : 2.0 } }
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
|
|
Or :
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
GET /_search
|
|
{
|
|
"query": {
|
|
"span_term" : { "user.id" : { "term" : "kimchy", "boost" : 2.0 } }
|
|
}
|
|
}
|
|
--------------------------------------------------
|