スパン用語クエリ
用語を含むスパンに一致します。以下はその例です:
Python
resp = client.search(
query={
"span_term": {
"user.id": "kimchy"
}
},
)
print(resp)
Ruby
response = client.search(
body: {
query: {
span_term: {
'user.id' => 'kimchy'
}
}
}
)
puts response
Js
const response = await client.search({
query: {
span_term: {
"user.id": "kimchy",
},
},
});
console.log(response);
コンソール
GET /_search
{
"query": {
"span_term" : { "user.id" : "kimchy" }
}
}
クエリに関連付けられるブーストもあります:
Python
resp = client.search(
query={
"span_term": {
"user.id": {
"value": "kimchy",
"boost": 2
}
}
},
)
print(resp)
Ruby
response = client.search(
body: {
query: {
span_term: {
'user.id' => {
value: 'kimchy',
boost: 2
}
}
}
}
)
puts response
Js
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 } }
}
}
または:
Python
resp = client.search(
query={
"span_term": {
"user.id": {
"term": "kimchy",
"boost": 2
}
}
},
)
print(resp)
Ruby
response = client.search(
body: {
query: {
span_term: {
'user.id' => {
term: 'kimchy',
boost: 2
}
}
}
}
)
puts response
Js
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 } }
}
}