On Wed, Feb 09, 2022 at 09:23:20PM +0800, weijihui wrote:
On Wed, Feb 09, 2022 at 01:21:14PM +0800, Wu Fengguang wrote:
On Tue, Feb 08, 2022 at 03:10:57PM +0800, Wei Jihui wrote:
From: Wei Jihui weijihuiall@163.com
- /data_api/es/:index/es_search is es search by dsl
是这样的吧:
es_search => _search
yes
- /data_api/es/:index/es_search_by_sql is es search by sql
我看你后面用了
>+# curl -X POST localhost:10005/data_api/es/jobs/_search_by_sql
然后调用的是
>+ @client.perform_request('GET', '_nlpcn/sql', {}, search_sql)
但我们应该最终调用这个吧:
https://github.com/opendistro-for-elasticsearch/sql POST https://<host>:<port>/_opendistro/_sql { "query": "SELECT * FROM my-index LIMIT 50" }
相应的API是不是相应的写成
/data_api/_opendistro/_sql
这个接口需要安装的插件没有我们用的es版本 目前用的这个接口 _nlpcn/sql
可以计划下升级到 _opendistro 和与之匹配的ES。 API层面,可以先用 _opendistro 免得折腾。
-# curl -X POST localhost:10005/es_find -H 'Content-Type: application/json' -d '{ +# curl -X POST localhost:10005/data_api/es/jobs/_search -H 'Content-Type: application/json' -d '{ # "query": {"size":10, "sort": [{"start_time": {"order": "desc"}}]}, -# "index": "jobs", -# "my_token": "16132550-...", -# "my_account": "auto-submit", -# "query_type": "eql" # can be omitted in this scenario +# "cci_authorization": {
这个貌似不错:
credentials
cci_credentials?
Yes.
Thanks, Fengguang