Skip to content

Unable to use descriptors to set Fields in MultiMatchQueryDescriptor query #8013

Closed
@ashitanojoe

Description

@ashitanojoe

Is your feature request related to a problem? Please describe.
When trying to migrate our Nest code to the new client I ran into a problem migrating a Multimatch query. In Nest, we could use descriptors to set with fields the multimatch should use for the query. This is not available in the new client, forcing me to use magic strings.

Here is the MultiMatch portion of the query using the new client, with the Nest code commented out.

.MultiMatch(mm => mm
    .Type(TextQueryType.BestFields)
    .Fields(new[]
    {
        "name.lownerngram",
        "tags.lowerekeyword"
    })
    //.Fields(fds => fds
    //    .Field(f => f.Name.Suffix("lowerngram"))
    //    .Field(f => f.Tags.Suffix("lowerkeyword"))
    //)
    .Query(queryString)
)

Describe the solution you'd like
Would like to use descriptors to set the fields the multimatch query will use in a way similar to the commented out code.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions