I've following data in elastic search
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "<index>",
"_type": "<type>",
"_id": "75559264",
"_score": 1,
"_source": {
"request": {
"parts": [
{
"lineCode": "GAT",
"partId": 0,
"reQty": 1,
"description": "Serpentine Belt",
"partNumber": "K040398",
"lineNumber": 1,
"brand": "BBSC"
},
{
"lineCode": "GAT",
"partId": 0,
"reQty": 1,
"description": "Timing Belt Kit With Water Pump",
"partNumber": "TCKWP312",
"lineNumber": 30,
"brand": "BBSC"
}, <and so on>
]
},
"response": {
"parts": [
{
"lineCode": "AC",
"partId": 0,
"reQty": 1,
"description": "Serpentine Belt",
"partNumber": "4K398",
"locations": [
{
"core": 0,
"cost": 10,
"called": "Store 4",
"availQty": 4,
"list": 12
},
{
"core": 0,
"cost": 10,
"called": "Store 5",
"availQty": 5,
"list": 12
}
],
"lineNumber": 13,
"brand": "BCVC",
"status": "Original"
},<and so on>
]
},
"header": {
"lookup": "EPE",
"ymme": "2001 HONDA CIVIC 4-1668 1.7L SOHC",
"transid": "1a97ebd4-514c-43be-be19-2121f2d2b452",
"created": "2017-12-01T05:37:32",
"channel": "Pb",
"errFlg": 0,
"action": "INQ",
"id": 75559264
},
"documentTimeStamp": "2017-12-01T05:37:47.668+0000"
}
}
]
}
}
Now I want to fetch the data(corresponding parts ) as per linecode (eg: "GAT").
I've gone through with this document and executed the following query
GET <myindex>/<type>/_search
{
"query": {
"bool": {
"must": [
{
"nested": {
"path": "request.parts",
"score_mode": "max",
"query": {
"bool": {
"must": [
{
"match": {"parts.lineCode": "GAT"}
}
]
}
}
}
}
]
}
}
}
But here I'm not getting any data instead it is showing the following response.
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
I'm new to the elastic search. so any help for getting data as per my requirement is so much appreciated.
Thanks in advance!! :)