This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Span term query
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Span term query
editMatches spans containing a term. Here is an example:
resp = client.search( query={ "span_term": { "user.id": "kimchy" } }, ) print(resp)
response = client.search( body: { query: { span_term: { 'user.id' => 'kimchy' } } } ) puts response
const response = await client.search({ query: { span_term: { "user.id": "kimchy", }, }, }); console.log(response);
GET /_search { "query": { "span_term" : { "user.id" : "kimchy" } } }
A boost can also be associated with the query:
resp = client.search( query={ "span_term": { "user.id": { "value": "kimchy", "boost": 2 } } }, ) print(resp)
response = client.search( body: { query: { span_term: { 'user.id' => { value: 'kimchy', boost: 2 } } } } ) puts response
const response = await client.search({ query: { span_term: { "user.id": { value: "kimchy", boost: 2, }, }, }, }); console.log(response);
GET /_search { "query": { "span_term" : { "user.id" : { "value" : "kimchy", "boost" : 2.0 } } } }
Or :
resp = client.search( query={ "span_term": { "user.id": { "term": "kimchy", "boost": 2 } } }, ) print(resp)
response = client.search( body: { query: { span_term: { 'user.id' => { term: 'kimchy', boost: 2 } } } } ) puts response
const response = await client.search({ query: { span_term: { "user.id": { term: "kimchy", boost: 2, }, }, }, }); console.log(response);
GET /_search { "query": { "span_term" : { "user.id" : { "term" : "kimchy", "boost" : 2.0 } } } }
Was this helpful?
Thank you for your feedback.