NativeSearchQuery 上的自定义 rescorer

发布于 2025-01-09 22:58:20 字数 198 浏览 2 评论 0原文

我在 Elasticsearch 上安装了自定义 rescorer 插件,但找不到使用 ElasticsearchOperations 调用它的方法。 我正在使用由 NativeSearchQueryBuilder 构建的 NativeSearchQuery,但我只能找到一种添加 QueryRescore 的方法,而不是自定义方法。 有没有办法使用自定义 rescorer 插件?

I installed a custom rescorer plugin on Elasticsearch but I couldn't find a way to call it by using ElasticsearchOperations.
I'm using the NativeSearchQuery built by a NativeSearchQueryBuilder but I could only find a method to add a QueryRescore and not a custom one.
Is there a way to use a custom rescorer plugin?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

渡你暖光 2025-01-16 22:58:20

实际上我在 org.elasticsearch.search.builder.SearchSourceBuilder 的代码中没有看到这种可能性。有方法 addRescorer(RescorerBuilder rescoreBuilder) 但 Elasticsearch 提供的唯一 RescorerBuilderorg.elasticsearch.search.rescore.QueryRescorerBuilder代码>.

因此,对于 Spring Data Elasticsearch 目前无法添加自定义 rescorer。

Actually I don't see such a possibility in the code of org.elasticsearch.search.builder.SearchSourceBuilder. There is the method addRescorer(RescorerBuilder<?> rescoreBuilder) but the only RescorerBuilder that Elasticsearch offers is the org.elasticsearch.search.rescore.QueryRescorerBuilder.

So for Spring Data Elasticsearch there is currently no way to add custom rescorers.

花伊自在美 2025-01-16 22:58:20

Elasticserach 提供了抽象类 org.elasticsearch.search.rescore.RescorerBuilder,可以扩展以进行自定义实现。
是否有机会使用 org.springframework.data.elasticsearch.core.RequestFactory#prepareSearchRequest 方法和 org.springframework.data.elasticsearch.core.query.Query 接口接受通用的RescorerBuilder而不仅仅是elasticsearch提供的实现?

Elasticserach offer the abstract class org.elasticsearch.search.rescore.RescorerBuilder that can be extented for custom implementation.
Is there any chance to work in org.springframework.data.elasticsearch.core.RequestFactory#prepareSearchRequest method and org.springframework.data.elasticsearch.core.query.Query interface to accept generic RescorerBuilder<RB extends RescorerBuilder> and not only the elasticsearch provided implementation ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文