1

I have ElasticSearch client which has default settings.

elasticClient = new ElasticLowLevelClient();

Also I have a simple post entity.

[ElasticsearchType(IdProperty = "Id", Name = "post")]
    public class Post
    {
        [Number(Name = "id")]
        public int Id { get; set; }
        [Text(Name = "title")]
        public string Title { get; set; }
        [Text(Name = "description")]
        public string Description { get; set; }
    }

I want to execute the query which is similar to query from Es documentation:

var searchResults = client.Search<Post>(p=>p
    .From(0)
    .Size(10)
    .Query(q=>q
         .Term(p=>p.Title, "stackoverflow")
    )
);

But I think that ES API was changed. The first argument should be PostData. That's why I don't know how my query should look.

Version of my ElasticSearch is 2.3.5 Version of NEST is 5.0.1

Maybe I need a lower version of NEST?

1 Answer 1

1

You're instantiating an instance of the low level client from Elasticsearch.Net.

If you change to using the high level client from NEST, all will be well

var elasticClient = new ElasticClient();

Internally, NEST uses the low level client, which is why Elasticsearch.Net is brought in as a dependency.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.