You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Elasticsearch 1.0 comes with it's own set of breaking changes which <ahref="http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/breaking-changes.html">are all documented in the elasticsearch documentation</a>. This page describes breaking changes NEST introduces in its 1.0 release and to an extend how you should handle Elasticsearch 1.0 changes in your exisiting code base using NEST prior to NEST 1.0.</p>
5
5
<h2id="nest-1-0">NEST 1.0</h2>
6
-
<h3id="strong-named-packages">Strong named packages</h3>
6
+
<h3id="strong-named-packages">Strong Named Packages</h3>
7
7
<p>Prior to 1.0 NEST came with a <code>NEST</code> and <code>NEST.Signed</code> nuget package. In 1.0 there is one package called <code>NEST</code> which is a signed strong named assembly. We follow the example of JSON.NET and only change our <code>AssemblyVersion</code> on major releases only update the <code>AssemblyFileVersion</code> for every release. This way you get most of the benefits of unsigned assemblies while still providing support for developers who's business guidelines mandates the usage of signed assemblies.</p>
8
8
<h3id="ielasticclient">IElasticClient</h3>
9
9
<p>The outer layer of NEST has been completely rewritten from scratch. Many calls will now have a different signature. Although the most common ones have been reimplemented as <ahref="http://github.com/elasticsearch/elasticsearch-net/tree/master/src/Nest/ConvenienceExtensions">extensions methods</a>. Two notable changes should be outlined though. </p>
@@ -12,7 +12,26 @@ <h4 id="get-is-now-called-source-">Get() is now called Source()</h4>
12
12
Similarily <code>GetMany()</code> is now called <code>SourceMany()</code>.</p>
13
13
<h3id="renamed-queryresponse-to-searchresponse">Renamed QueryResponse to SearchResponse</h3>
14
14
<p>The fact that <code>client.Search<T>()</code> returns a <code>QueryResponse<T></code> and not a <code>SearchResponse<T></code> never felt right to me, NEST 1.0 therefor renamed <code>QueryResponse<T></code> to <code>SearchResponse<T></code></p>
<p>IResponse.Error.Exception no longer exists, it is inlined to IResponse.OriginalException. The Error property did not hold any information that was not available on IResponse.ConnectionStatus.</p>
<p>Attributes are to limited in what they can specify so <code>[ElasticType()]</code> can now only specify the type name and the id property.
25
+
All the other anotations have been removed from <code>[ElasticType()]</code>. The properties on <code>[ElasticProperty()]</code> still exists an can be applied like this:</p>
26
+
<pre><code>var x = this._client.CreateIndex(index, s => s
27
+
.AddMapping<ElasticsearchProject>(m => m
28
+
.MapFromAttributes()
29
+
.DateDetection()
30
+
.IndexAnalyzer())
31
+
);
32
+
</code></pre><p>Or in a separate put mapping call:</p>
<p>NEST 0.12.0 had some alias helpers, <code>SwapAlias()</code>, <code>GetIndicesPointingToAlias()</code> these have been removed in favor of just <code>Alias()</code> and <code>GetAliases()</code>. Especially the later could benefit from some extension methods that make the common use cases a bit easier to program with. These did not make the beta release.</p>
17
36
<h4id="fields-vs-sourceinclude-">Fields() vs SourceInclude()</h4>
18
37
<p>Prior to Elasticsearch you could specify to return only certain fields and they would return like this:</p>
<p>This section decribes how to build requests to Elasticsearch.</p>
4
-
<h2id="calling-an-api-endpoint">Calling an API endpoint</h2>
4
+
<h2id="calling-an-api-endpoint">Calling an API Endpoint</h2>
5
5
<p><code>Elasticsearch.Net</code> maps <strong>all</strong> the <code>Elasticsearch</code> API endpoints to methods. The reason it can do this is because all these methods are generated from
6
6
<ahref="https://github.com/elasticsearch/elasticsearch/tree/master/rest-api-spec/api">the official client rest specification</a>. This specification documents all
7
7
the URL's (paths and querystrings) but does not map any of the API request and response bodies.</p>
@@ -17,7 +17,7 @@ <h2 id="calling-an-api-endpoint">Calling an API endpoint</h2>
17
17
.Add("key","value")
18
18
);
19
19
</code></pre><p>The querystring parameter is always optional.</p>
<p><code>Elasticsearch.Net</code> will not throw if it gets an http response other then 200 from Elasticsearch. The response object's <code>Success</code> property will be false and <code>.Error</code> will contain information on the failed response.</p>
4
4
<p>You can throw custom exceptions if you need too by specifying a custom connectionhandler</p>
0 commit comments