I would suggest you use the function request functionality offered by elasticsearch. The score function allows you to change the number of documents received on request.
In short, what you are doing is to add some post-processing of the search results by changing the rating of each document using the special function (or additional functions) that you provide.
You have various options for implementing the evaluation function, and your choice should depend on your specific case.
, field_value_factor, , . , (, "boost_factor" 1,5 1.0 - ). , .
field_value_factor": {
"field": "boost_factor",
"factor": 1.0,
"modifier": "none"
}
:
1.0 * doc['popularity'].value
, , , : https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#query-dsl-function-score-query