Mpdreamz/NEST — pull request #455 by Mpdreamz (2014-02-06 13:23:47+00:00)
Title: NEST 0.90

This PR introduces some pretty big breaking changes as its a pretty much rewritten `IElasticClient`

## Precursor

NEST dates back to 2010 some of the choices that have been made have proven not to scale in terms of maintainability.

* Way too many convenience overloads, meant that there we around 20+ different Index related methods. The original thinking was that each call would have an *Async and *Raw and RawAsync variant. But with `IElasticClient` being quite bulky alot of calls were simply missing the async and raw variants.
* Descriptors vs methods with arguments. Not all the calls exposed descriptors and so were limited in what they could describe. This meant that adding unmapped body/request parameters was exercise in juggling overloads without introducing breaking changes.

Starting with NEST 0.11.7.0 a completely generated `IRawElasticClient` was introduced. This meant that `IElasticClient` was no longer tasked with exposing raw calls.

# A new IElasticClient

This PR has a completely rewritten IElasticClient, dispatching into the IRawElasticClient. Prior to this release both `IRawElasticClient` and `IRawElasticClient` did their own url building and both called the connection directly. Since the url building in `IRawElasticClient` is generated from the official spec it makes a lot of sense to rely on that. This means that the god class `PathResolver` tasked with translating descriptors to paths is no more.

This PR takes it one step further though and even generates the dispatching that takes a descriptor and calls the right overload of `IRawElasticClient`

see: https://github.com/Mpdreamz/NEST/blob/api-changes/src/Nest/RawDispatch.generated.cs

This means that `IElasticClient` is not tasked with writing tedious/error prone if statements to choose the correct `IRawElasticClient` overload and in most cases only consists of a single line.

compare the old:
https://github.com/Mpdreamz/NEST/blob/master/src/Nest/ElasticClient-ClearCache.cs

vs the new:
https://github.com/Mpdreamz/NEST/blob/api-changes/src/Nest/ElasticClient-ClearCache.cs

This leans on the fact that descriptor classes are tasked with describing the path, query, and body of a request. The query portion of the descriptors is generated as can be seen here: