栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

es报错all shards failed:Fielddata is disabled on text fields by default. Set fielddata=true on

es报错all shards failed:Fielddata is disabled on text fields by default. Set fielddata=true on

今天新环境es客户端查询的时候发现这个异常
java.lang.IllegalArgumentException: Fielddata is disabled on text fields by default. Set fielddata=true on [node_id] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.

java.lang.IllegalArgumentException: Fielddata is disabled on text fields by default. Set fielddata=true on [node_id] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.
        at org.elasticsearch.index.mapper.TextFieldMapper$TextFieldType.fielddataBuilder(TextFieldMapper.java:336)
        at org.elasticsearch.index.fielddata.IndexFieldDataService.getForField(IndexFieldDataService.java:111)
        at org.elasticsearch.index.query.QueryShardContext.getForField(QueryShardContext.java:166)
        at org.elasticsearch.search.aggregations.support.ValuesSourceConfig.resolve(ValuesSourceConfig.java:97)
        at org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.resolveConfig(ValuesSourceAggregationBuilder.java:297)
        at org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:290)
        at org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder.doBuild(ValuesSourceAggregationBuilder.java:39)
        at org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:126)
        at org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:333)
        at org.elasticsearch.search.SearchService.parseSource(SearchService.java:642)
        at org.elasticsearch.search.SearchService.createContext(SearchService.java:472)
        at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:448)
        at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:252)
        at org.elasticsearch.action.search.SearchTransportService$6.messageReceived(SearchTransportService.java:339)


网上其他的也可以看看 但是没有解决我的问题
我的es是5.4.x版本的
然后开始冥思
说明一下

我们使用了es的索引模板

很有可能是在索引模板未创建时,此时就存入数据

故导致客户端代码进行排序或者分组的时候 出现 all shards failed

然后开始尝试
1.加入索引模板

还是不行

2.清除之前未有索引模板创建的索引及数据
重启,问题解决

命令为:curl -XDELETE http://ip:9200/索引名

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/706983.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号