这里的AWS文档表明支持SQL查询:https://aws.amazon.com/about-aws/whats-new/2019/05/amazon-elasticsearch-service-sql-support/
此页显示语法:https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/sql-support.html
POST elasticsearch_domain/_opendistro/_sql
{
"query": "SELECT * FROM my-index LIMIT 50"
}在Kibana开发工具中运行以下命令
POST my_domain/_opendistro/_sql
{
"query": "SELECT * FROM my-index LIMIT 50"
}给出了错误
{
"error": {
"root_cause": [
{
"type": "invalid_type_name_exception",
"reason": "Document mapping type name can't start with '_', found: [_opendistro]"
}
],
"type": "invalid_type_name_exception",
"reason": "Document mapping type name can't start with '_', found: [_opendistro]"
},
"status": 400
}我的ElasticSearch版本是6.7。
发布于 2020-03-04 20:40:13
由于elasticsearch是由AWS驱动的,并且您使用的是Kibana Dev工具,因此您可以通过以下方式获取查询结果
POST _opendistro/_sql
{
"query": "SELECT * FROM your_index "
}您不需要输入域名。这对我很管用。
https://stackoverflow.com/questions/56927503
复制相似问题