我正在使用ES查询如下。我可以将我的查询保存为ES索引上的模板/函数并从我的代码中调用它吗?
Current Query: "should": [
{
"bool": {
"must": [
{
"terms": {
"bbc.keyword": ["technology"]
}
}
]
},
{ "must": [
{
"terms": {
"cnn.keyword": ["technology"]
}
}
]
}
}]
寻找:“应该”:[{某事来到这里(模板名称或功能名称与上述相同)}]
新版本的Elasticsearch支持search templates,它支持使用胡须语言的模板
您始终可以使用索引别名和过滤器来存储模板。您可以在此处找到有关它的更多信息https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-aliases.html