如何在Elasticsearch 5.x中获取搜索模板列表?

时间:2017-05-03 19:00:47

标签: templates search elasticsearch elasticsearch-5

此版本中似乎不再存在.scripts索引,因此我不能只执行http:\\<elasticsearchserver>:9200\.scripts\_search

根据文档,脚本应位于config\scripts目录中,但\etc\elasticsearch\scripts文件夹在我的环境中为空。我现在有一个模板,所以在我看来应该有一些东西。

1 个答案:

答案 0 :(得分:0)

对我来说,我们的一些模板下的"code"非常庞大,模糊了模板的名称,这就是我想要的。此代码段将使用jq实用程序解析模板名称:curl 'localhost:9200/_cluster/state' | jq '.metadata.stored_scripts | keys'