Learning to Rank not working for nested field type

Hi,
I am implementing learning to rank on a nested field type. It is working completely fine for object field type(non-nested). But in case of nested field we are using score_mode : "sum" to cumulate the score of child objects. The LTR rescoring in elastic-search is not working with score_mode. It is giving the same results as of normal search.

For example-
Search Query
{
"query":{
"nested":{
"path":"Order",
"query":{
"multi_match":{
"query":"smart",
"fields":[
"Order.Product.ProductName",
"Order.Product.ProductType"
]
}
},
"score_mode":"sum"
}
},
"rescore":{
"query":{
"rescore_query":{
"sltr":{
"params":{
"keywords":"smart"
},
"model":"model_v1"
}
}
}
}
}
Feature Set

{
"featureset":{
"name":"dummy",
"features":[
{
"name":"product_name_feature",
"params":[
"keywords"
],
"template_language":"mustache",
"template":{
"nested":{
"path":"Order",
"template":{
"match":{
"Order.Product.ProductName":"{{keywords}}"
}
},
"score_mode":"sum"
}
}
},
{
"name":"product_type_feature",
"params":[
"keywords"
],
"template_language":"mustache",
"template":{
"nested":{
"path":"Order",
"template":{
"match":{
"Order.Product.ProductType":"{{keywords}}"
}
},
"score_mode":"sum"
}
}
}
]
}
}

Can you please help in understanding the internal score computation of the rescore query or let us know if any extra parameters needs to be passed while rescoring with nested fields/score_mode.

@varunbharti48

Enter in the slack and search channel es-elastic-to-rank, maybe someone help you.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.