测试环境使用  elasticsearch-rest-high-level-client  做为基础包发起es调用出现如下异常:

{"error":{"root_cause":[{"type":"parsing_exception","reason":"[match] query does not support [auto_generate_synonyms_phrase_query]","line":1,"col":337}],"type":"parsing_exception","reason":"[match] query does not support [auto_generate_synonyms_phrase_query]","line":1,"col":337},"status":400}
at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:705) ~[elasticsearch-rest-client-6.3.0.jar:6.3.0]
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:235) ~[elasticsearch-rest-client-6.3.0.jar:6.3.0]
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:198) ~[elasticsearch-rest-client-6.3.0.jar:6.3.0]
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:522) ~[elasticsearch-rest-high-level-client-6.3.0.jar:6.3.0]
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:508) ~[elasticsearch-rest-high-level-client-6.3.0.jar:6.3.0]
at org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:404) ~[elasticsearch-rest-high-level-client-6.3.0.jar:6.3.0]
at com.sf.ccsp.syn

百度发现版本不一致 生产环境使用的es版本是5.4.1。其他答案是版本不一致就让本地的 es版本和服务器的版本保持一致,这的确是一个方法,但是本地封装了很多jar包了,我也尝试了降级但是必须  elasticsearch-rest-high-level-client 版本与elasticsearch版本一同降级,但是 elasticsearch-rest-high-level-client 降到5.x版本还会出现新的问题,和现有的不兼容。

解决办法就是使用6.0.0 的 包 elasticsearch-rest-high-level-client 与elasticsearch  都使用这个版本的包,这个版本MatchQueryBuilder  还没有参数auto_generate_synonyms_phrase_query,MatchPhraseQueryBuilder也没有zero_terms_query多余的参数,详情可以见源码自己查看。

        <dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.0.0</version>
<exclusions>
<exclusion>
<artifactId>elasticsearch</artifactId>
<groupId>org.elasticsearch</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>6.0.0</version>
</dependency>

												

ES query does not support [auto_generate_synonyms_phrase_query]的更多相关文章

  1. Elasticsearch.Net 异常:[match] query doesn't support multiple fields, found [field] and [query]

    用Elasticsearch.Net检索数据,报异常: )); ElasticLowLevelClient client = new ElasticLowLevelClient(settings); ...

  2. es过滤集提升权重

    es { "query":{ "function_score":{ "query":{ "match":{ " ...

  3. 2017 ES GZ Meetup分享:Data Warehouse with ElasticSearch in Datastory

    以下是我在2017 ES 广州 meetup的分享 ppt:https://elasticsearch.cn/slides/11#page=22 摘要 ES最多使用的场景是搜索和日志分析,然而ES强大 ...

  4. es与hive整合

    在hive classpath中添加elasticsearch-hadoop.jar,以下方法任一种均可: 1.启动hiveserver2 前,在hive-site.xml文件中更改hive.aux. ...

  5. ios7 sdk 新特性

    iOS 7 is a major update with compelling features for developers to incorporate into their apps. The ...

  6. springBoot系列教程01:elasticsearch的集成及使用

    1.首先安装elasticsearch 集群环境,参考 http://www.cnblogs.com/xiaochangwei/p/8033773.html 注意:由于我的代码采用的是springbo ...

  7. PlainElastic.Net

    PlainElastic.Net PlainElastic.Net The really plain Elastic Search .Net client. Idea Installation How ...

  8. Known BREAKING CHANGES from NH3.3.3.GA to 4.0.0

    Build 4.0.0.Alpha1 =============================   ** Known BREAKING CHANGES from NH3.3.3.GA to 4.0. ...

  9. ElasticSearch搜索term和terms的区别

    今天同事使用ES查询印地语的文章.发现查询报错,查询语句和错误信息如下: 查询语句:{    "query":{        "bool":{         ...

随机推荐

  1. 2_02_MSSQL课程_where查询和like模糊查询

    1.where 条件过滤 常见的表达式过滤:比如: select * from 表 where Id>10; 多条件过滤: and or not    (优先级:not > and > ...

  2. Java中Compareable和Comparator两种比较器的区别

    Java中Compareable和Comparator两种比较器的区别 参考原文链接:https://www.cnblogs.com/ldy-blogs/p/8488138.html 1.引言 在ja ...

  3. Git安装及基本配置

    一.在Linux上安装 1.Linux系统安装 使用Linux发布版包含的基础软件包管理工具可以很容易安装Git.例如,在Ubuntu系统上可使用以下指令安装Git: $ sudo apt-get i ...

  4. sklearn中调用PCA算法

    sklearn中调用PCA算法 PCA算法是一种数据降维的方法,它可以对于数据进行维度降低,实现提高数据计算和训练的效率,而不丢失数据的重要信息,其sklearn中调用PCA算法的具体操作和代码如下所 ...

  5. Matplotlib 饼图

    章节 Matplotlib 安装 Matplotlib 入门 Matplotlib 基本概念 Matplotlib 图形绘制 Matplotlib 多个图形 Matplotlib 其他类型图形 Mat ...

  6. Bar Chart _Study

    ---恢复内容开始--- 以“3D BarChart”为例. 1.Select a theme.(选择一个主题模板) 2.Set up categories and groups.(设置类型和组) 3 ...

  7. P1093 字符串A+B

    1093 字符串A+B (20分)   给定两个字符串 A 和 B,本题要求你输出 A+B,即两个字符串的并集.要求先输出 A,再输出 B,但重复的字符必须被剔除. 输入格式: 输入在两行中分别给出  ...

  8. Rolling Update【转】

    滚动更新是一次只更新一小部分副本,成功后,再更新更多的副本,最终完成所有副本的更新.滚动更新的最大的好处是零停机,整个更新过程始终有副本在运行,从而保证了业务的连续性. 下面我们部署三副本应用,初始镜 ...

  9. express 配置 https 服务 ( 以阿里云服务器为例), 探索一周终于搞定

    首先最重要的是 你要明白 https接口的接收或者发送 的形式 是  https://域名:端口号   而不是 https://ip:端口号   一,首先,去阿里云注册免费ssl证书   1,在搜索框 ...

  10. R 《回归分析与线性统计模型》page141,5.2

    rm(list = ls()) library(car) library(MASS) library(openxlsx) A = read.xlsx("data141.xlsx") ...