我正在使用ES查询,如下所示。我可以将查询另存为ES索引上的模板/函数并从代码中调用它吗?
Current Query: "should": [
{
"bool": {
"must": [
{
"terms": {
"bbc.keyword": ["technology"]
}
}
]
},
{ "must": [
{
"terms": {
"cnn.keyword": ["technology"]
}
}
]
}
}]
寻找:“应该”:[
{
曾经有一些东西出现(模板名称或函数名称执行与上面相同的操作)}]
最佳答案
新版本的Elasticsearch支持search templates,它支持带有 mustache 语言的模板
关于elasticsearch - ElasticSearch查询模板/功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47876645/