错误案例
1、创建商品索引product1
PUT /product1
{
"mappings": {
"properties": {
"brand_name": {
"type": "text"
},
"product_name": {
"type": "text"
},
"color": {
"type": "text"
},
"attr": {
"type": "text"
},
"price": {
"type": "long"
}
}
}
}
2、增加商品数据如下:
POST /product1/_bulk
{"index":{"_index":"product1","_id":"1"}}
{"brand_name":"李宁","product_name":"夏日清凉短袖","color":"白色","price":99,"attr":"短袖"}
{"index":{"_index":"product1","_id":"2"}}
{"brand_name":"李宁","product_name":"夏日清凉短袖","color":"黑色","price":99,"attr":"短袖"}
{"index":{"_index":"product1","_id":"3"}}
{"brand_name":"李宁","product_name":"夏日清凉长袖","color":"白色","price":99,"attr":"长袖"}
{"index":{"_index":"product1","_id":"4"}}
{"brand_name&#