Elasticsearch filter query score

Is there a way to get the score from a query with filter? Or do I need to restructure my query without filters?
I would need a score between 0-1.

Now it looks like this:
{
"from": 0,
"size": 10,
"query": {
"bool": {
"must": {
"bool": {
"filter": [
{
"term": {
"lastName.normalize": {
"value": "Doe"
}
}
},
{
"term": {
"type.normalize": {
"value": "Individual"
}
}
}
]
}
}
}
}
}

A filter by definition does not return a score. All you need to do in your query is change the filter into a must. You will get the exact same set of hits, but now with a score.

1 Like

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