Query elastic search with linq using NEST

Is there a way to query Elasticsearch with a NEST client using linq or lambda expressions.

I want to do something like this:

client.Search<MyClass>(s => s.MyProperty.Contains("value") &&
                            (s.MySecondProperty == 123 ||
                             s.ThirdProperty > 12)) ;

or

var query = from m in MyContext.MyClass
            where ...
            select m

I read a little about ElasticLinq , but it seems that it is no longer active. The latest nuget package was published in October 2015.

What I want to do is create a method that receives the Expression as parameter from the caller and searches for it. Caller must not be dependent on ES or NEST API

+4
source share
2 answers

In short, no.

: ElasticLINQ LINQ, API Elasticsearch.

LINQ, IQueryable<T> et. al , API DSL REST API Elasticsearch, , LINQ, . - Holt-Winters?

, LINQ, , DSL- LINQ.

DSL REST API , NEST, Elasticsearch.Net HttpClient. , .

LINQ, :)

+4

, , ElasticLINQ.

- . , ( ), OR, AND.

+4

All Articles