我在 Kibana 中有一個名為test的欄位。如何撰寫 DSL 查詢來查找test值為“一二三”或“四五六”的檔案?
uj5u.com熱心網友回復:
您可以將bool/should子句與match_phrase查詢一起使用
{
"query": {
"bool": {
"should": [
{
"match_phrase": {
"test": "one two three"
}
},
{
"match_phrase": {
"test": "four five six"
}
}
]
}
}
}
或者您可以在欄位上使用術語查詢test.keyword
{
"query": {
"terms": {
"test.keyword": [
"one two three",
"four five six"
]
}
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/456488.html
