Skip to content

MultiMatch with empty string on function score #477

@andreabalducci

Description

@andreabalducci

I'm upgrading from my old fork to the master and I've found that the MultiMatch with empty query produces

query: {}

instead of

query: { match_all : {} }

Is that right and we have to check the query string to change our QueryDescriptor or the multimatch should fallback on match_all ?

var s = new SearchDescriptor<ElasticsearchProject>().From(0).Size(10)
                .Query(q => q
                    .FunctionScore(fs => fs
                        .Query(qq => qq.MultiMatch(mm => mm.OnFields(f=>f.Country, f=>f.FloatValue).Query("")))
                        .Functions(
                            f => f.Gauss(x => x.StartedOn, d => d.Scale("42w")),
                            f => f.Linear(x => x.FloatValue, d => d.Scale("0.3")),
                            f => f.Exp(x => x.DoubleValue, d => d.Scale("0.5")),
                            f => f.BoostFactor(2)
                        )
                        .ScoreMode(FunctionScoreMode.sum)
                    )
                ).Fields(x => x.Content);

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