I'm not quite sure where to get started with this query. I'm using the opensearch quickstart data to try to explain. The documents have the following fields for example:
{
...
"customer_first_name": "Sonya",
"customer_full_name": "Sonya Foster",
"customer_last_name": "Foster",
...
}
I'm applying a simple filter like this:
{
"query": {
"match": {
"customer_first_name": "Sonya"
}
}
}
The part where I'm not sure what to do is how to score the results after the filtering is done. The scoring includes aggregation and a calculation of coverage of a category. For example, if we have documents where the customer_first_name = "Sonya" and all of the last names returned are:
"Foster", "Johnson", "Lincoln", "Wells"
The user would like to pass in the selections:
"Foster", "Lincoln"
And the scoring function would calculate that the score for customer_first_name "Sonya" = 50% because they passed in half of the values.
I appreciate it if any of you could point me in the right direction. I just don't see how to approach it yet. Thanks,