Skip to content

Function Score generates double array #242

@trylika

Description

@trylika

when passing array of functions to FunctionScoreQuery, it generates final query with double array ( https://github.com/ongr-io/ElasticsearchBundle/blob/master/DSL/Query/FunctionScoreQuery.php#L66 ).

Generated query: "function_score": { "query": { "match_all": {} }, "functions": [ [ { "boost_factor": 2, "filter": { "term": { "provider": "faker", "_cache": false } } } ] ], "score_mode": "sum", "boost_mode": "sum" }

passed arguments:

[
            'boost_factor' => $this->boost,
            'filter' => [
                'term' => [
                    $this->field => $value,
                    '_cache' => false,
                ],
            ],
        ],
];

new FunctionScoreQuery(new MatchAllQuery(), $functions);```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions