我把产品数据插入到Es数据之后显示成功,并能通过返回的ID查询到该条数据
GET /index1/product/1086899
{
"_index": "productindex11",
"_type": "productesnew",
"_id": "1086899",
"_version": 1,
"found": true,
"_source": {
"ProductID": "66b75c46-3f12-44e1-92ea-2fa3aac2204e",
"ID": 1086899,
"BrandID": "59",
"ProductName": "SBAS70-04LT1G",
"BrandName": "ON Semiconductor",
"BrandNameEn": "ON Semiconductor",
"ProductClassID1": "85",
"ProductClassID2": "337",
"ClassName2": "肖特基二极管",
"ClassName1": "分立半导体器件",
"IsSell": 1,
"MinPrice": 0.1982,
"MaxPrice": 0.1982,
"StorageNumber": 50,
"DBStatus": 2,
"Package": "",
"Capsulation": "",
"Description": "70V,一对串联肖特基势垒二极管",
"AgentID": "",
"AgentType": "0",
"minUSDPrice": 0,
"maxUSDPrice": 0,
"attributes": {}
}
}
但是当我使用ProductName进行查询时就无法查询到该条数据
POST /index1/product/_search
{
"size": 2,
"query": {
"bool": {
"must": [
{
"term": { "productName": "SBAS70-04LT1G" }
}
]
}
}
}
{
"took": 43,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}