NEST uses sensible defaults for connecting to and interacting with an Elasticsearch cluster but provides numerous configuration options and components to change this behaviour
NEST’s default JSON serialization understands how to correctly serialize all request and response types, as well as correctly handle your POCOs. Sometimes however, you might want to change this behaviour, either by providing your own serializer, or by modifying how NEST’s serializer behaves.
To interact with Elasticsearch using NEST, we need to be able to contol how POCO types in our solution map to JSON documents and fields stored within the inverted index in Elasticsearch. This section describes all of the different functionality available within NEST that makes working with POCOs and Elasticsearch a breeze.
Explicitly mapping documents in Elasticsearch is crucial in providing bespoke search solutions for a given problem domain. Whilst Elasticsearch is able to infer the mapping for a given type in an index based upon the first document of that type that it encounters, the inferred mapping is sometimes not sufficient to building a great search experience.
To explicitly control mapping, an explicit type mapping can be specified when creating an index, or added to an existing index before indexing the first document of that type (because indexing a document without an explicit mapping will cause Elasticsearch to infer the mapping).
There are several ways to control mapping in NEST
and these can be combined to form an overall mapping approach. In addition, there are also ways to control
client-concepts/high-level/mapping/auto-map.asciidoc client-concepts/high-level/mapping/attribute-mapping.asciidoc client-concepts/high-level/mapping/fluent-mapping.asciidoc client-concepts/high-level/mapping/visitor-pattern-mapping.asciidoc client-concepts/high-level/mapping/parent-child-relationships.asciidoc client-concepts/high-level/mapping/ignoring-properties.asciidoc client-concepts/high-level/mapping/multi-fields.asciidoc
Analysis is the process of converting text, like the body of any email, into tokens or terms which are added to the inverted index for searching. Analysis is performed by an analyzer which can be either a built-in analyzer or a custom analyzer defined per index.
The {ref_current}/search-search.html[Search API] allows you to execute a search query and get back search hits that match the query. The search capabilities of Elasticsearch is likely one of the reasons you’re using it, and NEST exposes all of the different types of search available, along with some smarts to make working with Elasticsearch from a strongly typed language easier.
The aggregations framework helps provide aggregated data based on a search query. It is based on simple building blocks called aggregations, that can be composed in order to build complex summaries of the data.
There are a number of conventions that NEST uses for inference of
NEST has a number of types for working with Elasticsearch conventions for