NativeSearchQuery 上的自定义 rescorer
我在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上我在 org.elasticsearch.search.builder.SearchSourceBuilder 的代码中没有看到这种可能性。有方法
addRescorer(RescorerBuilder rescoreBuilder)
但 Elasticsearch 提供的唯一RescorerBuilder
是org.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 methodaddRescorer(RescorerBuilder<?> rescoreBuilder)
but the onlyRescorerBuilder
that Elasticsearch offers is theorg.elasticsearch.search.rescore.QueryRescorerBuilder
.So for Spring Data Elasticsearch there is currently no way to add custom rescorers.
Elasticserach 提供了抽象类 org.elasticsearch.search.rescore.RescorerBuilder,可以扩展以进行自定义实现。 而不仅仅是elasticsearch提供的实现?
是否有机会使用 org.springframework.data.elasticsearch.core.RequestFactory#prepareSearchRequest 方法和 org.springframework.data.elasticsearch.core.query.Query 接口接受通用的RescorerBuilder
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 ?