Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Fielddata is disabled on text fields by default. Set fielddata=true on [category] 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.]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Fielddata is disabled on text fields by default. Set fielddata=true on [category] 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.]];] with root cause
时间: 2024-04-28 10:19:20 浏览: 249
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception
这个异常信息是关于 Elasticsearch 的,大致意思是:在执行搜索时,所有分片都失败了。原因是在查询中使用了文本字段(text fields)的聚合(aggregation)功能,但是默认情况下,文本字段是禁用了 Fielddata(一个 ElasticSearch 中的内存结构,用于支持聚合、排序等操作)的。要解决这个问题,可以在查询中设置 `fielddata=true`,或者使用关键字字段(keyword field)代替文本字段。
阅读全文