Below is mapping which i have
{
"defaultBoostValue":1.01,
"boostDetails": [
{
"Type": "Type1",
"value": 1.0001
},
{
"Type": "Type2",
"value": 1.002
},
{
"Type": "Type3",
"value": 1.0005
}
]
}
I want to apply boost type based on type , so if boostType is Type3 then boostFactor should be 1.0005, and if it does not have that boostType, it should apply "defaultBoostValue" as boost
below is the query which i have tried
{
"query": {
"function_score": {
"boost_mode": "multiply",
"functions": [
{
"filter": {
"match": {
"boostDetails.Type": "Type1"
}
},
"field_value_factor": {
"field": "boostDetails.value",
"factor": 1,
"missing": 1
}
}
]
}
}
}
it is not working as expected as boostDetails is array of object, how can we apply filter on such case
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…