my index mapping
"mapping":{
"test":{
"descript": {
"properties": {
"prop": {
"type": "long"
},
"value": {
"analyzer": "english",
"type": "text"
}
}
},
"id":{
"type":"long"
}
}
}
my index data
{
"id": 1,
"descript": [
{
"prop": 15,
"value": "led light"
},
{
"prop": 10,
"value": "led lamp"
}
]
}
{
"id": 2,
"descript": [
{
"prop": 5,
"value": "lamp"
},
{
"prop": 10,
"value": "light"
}
]
}
my query
GET test/_search
{
"query": {
"match": {
"descript.value": "led"
}
}
}
This query will match id 1 and id 2. But I want the descript field from _source to look something like this
"_source" : {
"id": 1,
"descript": [
{
"prop": 15,
"value": "led light"
}
]
}
I want to take only the highest match or the highest value of prop
in the matched multi-value field descript
I'm hoping for some help from the gurus.
thinks