elasticsearch异常query does not support [auto_generate_synonyms_phrase_query]

java | 2022-03-04 16:32:13

1.异常

elasticsearch 报错如下:

Caused by: ElasticsearchStatusException[Elasticsearch exception [type=parsing_exception, reason=[multi_match] query does not support [auto_generate_synonyms_phrase_query]]]
        at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:187)
        at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1892)
        at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1869)
        at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1626)
        at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1583)
        at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1553)
        at org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:1069)
        at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.lambda$search$10(ElasticsearchRestTemplate.java:256)
        at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.execute(ElasticsearchRestTemplate.java:343)
        ... 69 more
        Suppressed: org.elasticsearch.client.ResponseException: method [POST], host [http://192.168.10.6:9200], URI [/filesearch/_search?typed_keys=true&max_concurrent_shard_requests=5&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&search_type=dfs_query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=true], status line [HTTP/1.1 400 Bad Request]
{"error":{"root_cause":[{"type":"parsing_exception","reason":"[multi_match] query does not support [auto_generate_synonyms_phrase_query]","line":1,"col":307}],"type":"parsing_exception","reason":"[multi_match] query does not support [auto_generate_synonyms_phrase_query]","line":1,"col":307},"status":400}
                at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:302)
                at org.elasticsearch.client.RestClient.performRequest(RestClient.java:272)
                at org.elasticsearch.client.RestClient.performRequest(RestClient.java:246)
                at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1613)
                ... 74 more

2.配置

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

版本是2.4.1

进去

<dependency>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-elasticsearch</artifactId>
      <version>4.1.2</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>transport</artifactId>
          <groupId>org.elasticsearch.client</groupId>
        </exclusion>
      </exclusions>
    </dependency>

 

3.解决方法

把elasticsearch版本改到6

docker run -itd --name es-file-manage --network net-platform --ip 192.168.10.6 -e "discovery.type=single-node" elasticsearch:6.8.22

抛出异常

 contains unrecognized parameter: [ccs_minimize_roundtrips]]]

只好先去查版本对应关系

https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#preface.versions

所以我需要一个7.9.3版本的 elasticsearch

docker run -itd --name es-file-manage --network net-platform --ip 192.168.10.6 -e "discovery.type=single-node" elasticsearch:7.9.3

 

 

 

登录后即可回复 登录 | 注册
    
相关文章
ehcache异常net.sf.ehcache.cacheexception value is not serializable解决解决spark hive插入数据异常spark currently does not populate bucketed outputspark hive 异常version information not found in metastorespark异常 could not locate executable null bin winutils.exe in the hadoop binariesspark on yarn 异常 spark shuffle does not existjdbc连接phoenix hbase 异常the node /hbase is not in zookeeperjintellitype异常could not load jintellitype.dllspark hive 异常 could not connect to meta store using any of the uris providedphp ibm db2 函数 returns the auto generated id of the last insert query that successfully executed on this connectionphp maxdb 函数 returns the auto generated id used in the last queryphp sqlite 函数 opens an sqlite database and create the database if it does not existphp sqlite 函数 opens a persistent handle to an sqlite database and create the database if it does not existphp sqlite 函数 execute a query that does not prefetch and buffer all dataphp sybase 函数 send a sybase query and do not blockphp mysqlnduhconnection returns the auto generated id used in the last queryphp solrdismaxquery specifies the amount of slop permitted on phrase queries explicitly included in the user s query string qf parameter 解决 php 腾讯企业 发送 邮件异常SMTP Error: Could not authenticateChrome DevTools Protocol异常PrintToPDF is not implementedjacob异常Dispatch not hooked to windows memoryelasticsearch异常query does not support [auto_generate_synonyms_phrase_query]
关注编程学问公众号