We always create elastic search query in sense and then create corresponding version of it in NEST.
What is benefit of using NEST client and not directly putting JSON e
There are 2 major reasons to use a strongly typed library like NEST.
1. It protects you from attempting most invalid requests
The DSL can feel cumbersome at first, but once you get used to it you realize that it's strict structure prevents you from chaining filters and aggregations together in an invalid way. This means that errors can be caught when you're writing the code, and ready to fix it...and not later in production.
#2 Give IDEs like Visual Studio and Code everything they need for code completion
Just like Kibana helps you writing Elasticsearch queries in the dev tools, your IDE can provide syntax highlighting and code completion that can save you time running back and forth to the docs or Kibana. This is really useful when you are dynamically constructing queries.
Source: I wrote a blog about this recently, on the benefits of using a strongly-typed library like NEST for generating Elasticsearch queries
Here's a non-exhaustive list of reasons why you might choose to use NEST, the high level client for Elasticsearch:
BulkAll
, ScrollAll
, Reindex
IConnection
, IRequestPipeline
, IElasticsearchSerializer
, etc.