如何像这样转换SQL查询
ID
在Elasticsearch-query(v6.x)中吗?
答案 0 :(得分:0)
赞:
POST /IndexA/_search -d '
{
"query" : {
"bool" : {
"must" : [
{
"wildcard" : {
"name" : "*stics*"
}
},
{
"terms" : {
"_id" : ["1", "2", "3"]
}
}
]
}
}
}'
答案 1 :(得分:0)
在ES7中,可以轻松完成以下操作:
curl -H "Content-Type:application/json" -XPOST 127.0.0.1:9200/_xpack/sql/translate?pretty -d '{"query" : "select IndexA.* from IndexA where IndexA.NAME like ('%stics%') and IndexA.ID in (1,2,3,4)"}'