Fielddata is disabled on text fields by default报错
程序员文章站
2022-07-14 22:32:05
...
学习es的时候,进行分组查询
GET /ecommerce/product/_search
{
"aggs": {
"group_by_tags": {
"terms": {
"field": "tags"
}
}
}
}
报错:
按照教程修改:
PUT /ecommerce/_mapping/product
{
"properties": {
"tags": {
"type": "text",
"fielddata": true
}
}
}
还是有问题:
后面找到资料,加入关键字keyword即可搜索:
GET /ecommerce/product/_search
{
"aggs": {
"group_by_tags": {
"terms": {
"field": "tags.keyword"
}
}
}
}
问题解决
上一篇: python 字符串、列表、元组、字典
下一篇: 字符串、列表、元组、字典05