Skip to content

Ambigous call on QueryContainerDescriptor<T>.Wildcard(field, value) #2805

@Schoof-T

Description

@Schoof-T

NEST/Elasticsearch.Net version: 5.4

Elasticsearch version: 5.5

Description of the problem including expected versus actual behavior: After upgrading to NEST 5.4 (from 5.2.2) I get an exception on QueryContainerDescriptor.Wildcard(field, value).

The call is ambiguous between the following methods or properties: 'QueryContainerDescriptor<T>.Wildcard(Expression<Func<T, object>>, string, double?, RewriteMultiTerm?, string)' and 'QueryContainerDescriptor<T>.Wildcard(Expression<Func<T, object>>, string, double?, MultiTermQueryRewrite, string)'

I use this feature to do Wildcard searches, because the alternative Term does not work like a 'like' search.

var query = value.Contains("*") ? (Func<QueryContainerDescriptor<T>, QueryContainer>)
                            (bs => bs.Wildcard(propConfig.KeySelector, value)) : // wildcard search
                            (bs => bs.Term(propConfig.KeySelector, value)); // default term search

Steps to reproduce:

  1. call .Wildcard on a QueryContainerDescriptor with 2 parameters: field, value

Misc:
I also noticed that .Wildcard is new deprecated. What is the recommended method to replace this? I can't find this in any release notes.

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