我有2個索引用戶和URL。我想根據索引在不同的字段上運行查詢。如何在elasticsearch中使用multi_match和索引?
在USER索引,查詢應該名和ID現場進行搜索。 但在URL搜索必須執行標題和id字段。
POST /_search
{
"query":{
"indices":[
{
"indices":[
"URL"
],
"query":{
"multi_match":{
"query":"SMU ",
"fields":[
"title",
"id"
]
}
}
},
{
"indices":[
"USER"
],
"query":{
"multi_match":{
"query":"SMU ",
"fields":[
"name",
"id"
]
}
}
}
]
}
}
以上查詢不起作用。需要做些什麼才能使其發揮作用。 如何將multi_match搜索與索引搜索合併?
你使用哪個ES版本?什麼不適用於當前查詢? – Val
目前,我正在使用ES 5.1。示例查詢不起作用。我在尋找這樣的工作。 –