How can I fix a query dsl so that ALL documents are boosted in the function_score?

I have dsl query with structure

{
    "query": {
        "function_score": {
            "query": {
                "bool": {
                    "must": {
                        "multi_match": {
                            "query": "TEST QUERY",
                            "type": "best_fields",
                            "fields": [ ....... ],
                            "operator": "and"
                        }
                    }
                }
            },
            "field_value_factor": {
                "field": "SearchTuning.FIELD_WHICH_INCREASE_SCORE",
                "factor": 100,
                "missing": 0
            },
            "boost_mode": "replace"
        }
    }
}

I expect that all documents in the index, not just those that match with "TEST QUERY" and "query" section, will be modified through "field_value_factor" and documents with the field "FIELD_WHICH_INCREASE_SCORE" will receive maximum score.

However, in fact, the “hits” array shows that only documents that satisfy the query section are received. All resulting documents in "hits" have score = 0.0 and there is no document in which the field "SearchTuning.FIELD_WHICH_INCREASE_SCORE" exists.

How to correct the query to get the desired result?

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