ES 查询时 排序报错(fielddata is disabled on text fileds by default ... )解决方法

背景:elasticsearch 进行排序的时候,可能会排序数字、日期。但是在排序text类型的时候就会出现上述错误 
原因(参考):
https://blog.csdn.net/wild46cat/article/details/62889554
https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html
解决方法:
<1> kibana中
PUT 索引名称/_mapping/type名称/
{
   "properties":{
        "字段名称":{
               "type":"text",
               "fielddata":true
        }    
    }    
}

猜你喜欢

转载自www.cnblogs.com/lvlin241/p/9713417.html