spring data elasticsearch多索引查询
2021-05-17 09:27
标签:hits pre add agg response search int return str 一次查询多个索引数据 es里可以这样写 GET 索引1,索引2,索引3/_search 也可以这样 给索引创建别名,多个索引可以使用一个别名 或者 删除别名 java查询多个索引 spring data elasticsearch多索引查询 标签:hits pre add agg response search int return str 原文地址:https://www.cnblogs.com/double-yuan/p/9740494.htmlPOST /_aliases
{
"actions": [
{
"add": {
"index": "myindex2",
"alias": "myalias"
}
},{
"add": {
"index": "myindex3",
"alias": "myalias"
}
}
]
}
PUT /myindex2/_alias/myalias
POST /_aliases
{
"actions": [
{
"remove": {
"index": "myindex3",
"alias": "my_index_alias"
}
}
]
}
SearchQuery searchQuery = new NativeSearchQueryBuilder()
.withIndices("myindex2","myindex4") //可以直接使用别名
.withQuery(queryBuilder)
//.addAggregation(sumBuilder)
.build();
List
上一篇:各种windows10下的快捷键
下一篇:Java23种设计模式
文章标题:spring data elasticsearch多索引查询
文章链接:http://soscw.com/index.php/essay/86650.html