【问题标题】:Elasticsearch exception unrecognized parameter ccs_minimize_roundtripsElasticsearch异常无法识别参数ccs_minimize_roundtrips
【发布时间】:2022-01-02 00:32:16
【问题描述】:

通过spring data jpa从elasticsearch搜索数据时出现以下错误

23-11-2021 19:51:20.699 [http-nio-8990-exec-2] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=request [/dummy/_doc/_search] contains unrecognized parameter: [ccs_minimize_roundtrips]]]] with root cause

这是我的 maven 依赖项

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
            <version>2.2.2.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-elasticsearch</artifactId>
            <version>3.2.3.RELEASE</version>
        </dependency>

我认为 ES 服务器版本和 api 版本相同,但我仍然收到此错误。

注意这不是重复的,因为即使在旧版本中我也会收到此错误

【问题讨论】:

  • 3.2.3 spring-data-elasticsearch 版本requires Elastic 6.8.12。你能具体告诉我们你运行的是哪个 ES 版本吗?
  • 请出示您用于查询的代码
  • @Val 手动添加 elasticsearch 6.7.1 后,我遇到了几个错误,但随后添加了 elasticsearch-rest-client 6.8.4 和 elasticsearch-rest-high-level-client 6.8.4,现在可以正常工作。您可以将此添加为答案

标签: spring-boot elasticsearch spring-data-elasticsearch


【解决方案1】:

ccs_minimize_roundtrips 参数已添加到 7.0.0-beta1 中,因此我认为您使用的客户端版本比 Elasticsearch 服务器版本更新(即 7+)。

根据您的 Maven 依赖项,spring-data-elasticsearch:3.2.3depends on Elastic 6.8.12,因此客户端和服务器版本之间存在小的脱节。

【讨论】:

  • NB 这个答案解决了我的问题,但我还必须添加 elasticsearch 6.7.1、elasticsearch-rest-client 6.8.4 和 elasticsearch-rest-high-level-client 6.8.4
  • 酷,很高兴它有所帮助,但不清楚为什么需要混合 6.7.1 和 6.8.4 ?
猜你喜欢
  • 2017-07-07
  • 1970-01-01
  • 1970-01-01
  • 2020-11-16
  • 2014-10-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多