Search code examples
elasticsearchnestelasticsearch-net

What is the equivalent of FilterDescriptor in NEST 2.3.3


I am in the process of upgrading NEST from 1.6.2 to 2.3.3. Getting type not found for FilterDescriptor, FilterContainer.

What are the equivalent types in NEST 2.3.3?

Thanks in advance.

UPDATE


Based on the response from @RussCam, here is what I got in 1.6.2

public static Func<FilterDescriptor<Property>, FilterContainer> AddressComponents(string address)
    {
        return filter => filter
            .Query(q => q
                .MultiMatch(multimatch => multimatch
                    .OnFields(
                        f => f.Address,
                        f => f.Address.Suffix("shingles"))
                    .Query(address)
                    .Type(TextQueryType.CrossFields)
                    .Operator(Operator.And)
                )
            );
    }

to 2.3.3

    public static Func<QueryContainerDescriptor<Property>, QueryContainer> AddressComponents(string address)
    {
        return q => q
            .MultiMatch(multimatch => multimatch
                .Fields(f => f
                    .Field(p => p.Address)
                    .Field(p => p.Address.Suffix("shingles")))
                .Query(address)
                .Type(TextQueryType.CrossFields)
                .Operator(Operator.And)
            );
    }

Solution

  • The equivalent types in NEST 2.3.3 are QueryContainerDescriptor<T> and QueryContainer; filters and queries merged in Elasticsearch 2.0 into one concept, queries, that can be used in either a query context or a filter context, so the change in NEST reflects this.

    There's a blog post talking about the high level changes, as well as some documentation for 2.x clients.