Como ocultar essa consulta de pontuação funcional de pesquisa elástica para a API java

Como converter a consulta ES abaixo em API Java? Estou usando a pesquisa elástica 2.3.3

 GET /schema_name/_search
 {
"from": 0,
"size": 200,
"query": {
    "function_score": {
        "query": {
            "match_all": {}
        },
        "boost": "5",
        "functions": [{
                "filter": {
                    "term": {
                        "alert_code": "event_rule_1"
                    }
                },
                "weight": 50
            },
            {
                "filter": {
                    "term": {
                        "alert_code": "event_rule_2"
                    }
                },
                "weight": 30
            },
            {
                "filter": {
                    "term": {
                        "alert_code": "event_rule_3"
                    }
                },
                "weight": 10
            },
            {
                "filter": {
                    "term": {
                        "alert_code": "event_rule_4"
                    }
                },
                "weight": 10
            },
            {
                "filter": {
                    "term": {
                        "alert_code": "event_rule_5"
                    }
                },
                "weight": 50
            },
            {
                "filter": {
                    "term": {
                        "alert_code": "event_rule_6"
                    }
                },
                "weight": 50
            }
        ],
        "max_boost": 50,
        "score_mode": "max",
        "boost_mode": "replace",
        "min_score": 0
      }
    }
 }

Eu já tentei escrever esta consulta ES usando a API Java usando o link abaixoConsulta do Elasticsearch FunctionScore usando a API Java

Mas o link abaixo parece ser para uma versão ES mais antiga e não consigo encontrar essas funções estáticas na pesquisa elástica 2.3.3.

questionAnswers(1)

yourAnswerToTheQuestion