如何仅在弹簧数据弹性搜索中使用别名

发布于 2025-02-01 19:46:21 字数 233 浏览 2 评论 0原文

春季数据搜索版本为4.1.15。我将实体类定义为下面,并使用lasticsearchRepository进行crud和弹性搜索,以进行自定义查询。 @document(indexName =“ my_index”,createIndex = false)

现在我需要更新以使用别名。然后,当我们需要更新索引或reindex时,代码不会有任何更改,

但是我找不到任何示例仅在春季数据弹性搜索中使用别名。任何建议都得到高度赞赏。

Spring data search version is 4.1.15. I define entity class as below and use ElasticsearchRepository for CRUD and ElasticsearchOperations for customized query.
@Document(indexName = "my_index", createIndex = false)

Now I need to update to use alias only. Then there will be no change in the code when we need update index or reindex,

But I couldn't find any example to use alias only in spring data elastic search. Any suggestion is highly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文