Skip to content

Commit fc97e16

Browse files
committed
Merge branch 'enhancement/2.x-great-docs-update' into 2.x
2 parents db7474f + 56436ef commit fc97e16

File tree

403 files changed

+17334
-8615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

403 files changed

+17334
-8615
lines changed

build/scripts/Building.fsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ module Build =
5353
)
5454

5555
let private compileDesktop() =
56-
Tooling.MsBuild.Rebuild DotNetFramework.Net45.Identifier
57-
Tooling.MsBuild.Rebuild DotNetFramework.Net46.Identifier
56+
Tooling.MsBuild.Rebuild DotNetFramework.Net45
57+
Tooling.MsBuild.Rebuild DotNetFramework.Net46
5858

5959
let private gitLink() =
6060
DotNetProject.AllPublishable
@@ -70,7 +70,7 @@ module Build =
7070

7171
let Compile() =
7272
match quickBuild with
73-
| true -> Tooling.MsBuild.Build DotNetFramework.Net45.Identifier
73+
| true -> Tooling.MsBuild.Build DotNetFramework.Net45
7474
| false ->
7575
compileDesktop()
7676
compileCore()

build/scripts/Tooling.fsx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,16 @@ module Tooling =
158158
let DotNet = new DotNetTooling("dotnet.exe")
159159

160160
type MsBuildTooling() =
161-
162-
member this.Build (framework:Projects.DotNetFrameworkIdentifier) =
163-
let solution = Paths.Source "Elasticsearch.sln";
161+
// Exclude DocGenerator from .NET 4.5 build as it depends on a Roslyn library
162+
// that is built against .NET 4.5.2
163+
let solutionForFramework framework =
164+
match framework with
165+
| Net45 -> Paths.Source "Elasticsearch.Net45.sln"
166+
| _ -> Paths.Source "Elasticsearch.sln"
167+
168+
member this.Build (framework:Projects.DotNetFramework) =
169+
let solution = solutionForFramework framework
170+
let identifier = framework.Identifier
164171
let setParams defaults =
165172
{ defaults with
166173
Verbosity = Some(Quiet)
@@ -169,14 +176,15 @@ module Tooling =
169176
[
170177
"Optimize", "True"
171178
"Configuration", "Release"
172-
"TargetFrameworkVersion", framework.MSBuild
173-
"DefineConstants", framework.DefineConstants
179+
"TargetFrameworkVersion", identifier.MSBuild
180+
"DefineConstants", identifier.DefineConstants
174181
]
175182
}
176183
build setParams solution
177184

178-
member this.Rebuild (framework:Projects.DotNetFrameworkIdentifier) =
179-
let solution = Paths.Source "Elasticsearch.sln";
185+
member this.Rebuild (framework:Projects.DotNetFramework) =
186+
let solution = solutionForFramework framework
187+
let identifier = framework.Identifier
180188
let setParams defaults =
181189
{ defaults with
182190
Verbosity = Some(Quiet)
@@ -186,8 +194,8 @@ module Tooling =
186194
"OutputPathBaseDir", Path.GetFullPath "build\\output"
187195
"Optimize", "True"
188196
"Configuration", "Release"
189-
"TargetFrameworkVersion", framework.MSBuild
190-
"DefineConstants", framework.DefineConstants
197+
"TargetFrameworkVersion", identifier.MSBuild
198+
"DefineConstants", identifier.DefineConstants
191199
]
192200
}
193201

docs/2.0-breaking-changes/elasticsearch-net-breaking-changes.asciidoc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
:github: https://github.com/elastic/elasticsearch-net
2-
32
:stackoverflow: http://stackoverflow.com
43

54
[[elasticsearch-net-breaking-changes]]
@@ -8,6 +7,7 @@
87
This document rudimentally documents the breaking changes from 1.x to 2.x; Our 2.0 refactor comprises 1000+ commits and nearly six months of work, so if we missed anything
98
{github}/issues[feel free to give us a shout]!
109

10+
[float]
1111
=== Dependency graph changes
1212

1313
The first thing you might notice is that the dependency graph for the client has changed slightly. It has also been renamed from `IElasticsearchClient` to `ILowLevelElasticClient`, to align better with the high level (NEST) client and better differentiate itself.
@@ -61,12 +61,13 @@ var client = new ElasticLowLevelClient(pool);
6161
----
6262

6363
This is what we call internally if you use the previous `ElasticLowLevelClient` constructor.
64-
Our implementation of <<transports,`ITransport`>> can be injected with a custom <<request-pipeline,`IRequestPipelineFactory`>>, <<date-time-providers,`IDateTimeProvider`>> and `IMemoryStreamFactory`.
64+
Our implementation of <<transports,`ITransport`>> can be injected with a custom <<request-pipelines,`IRequestPipelineFactory`>>, <<date-time-providers,`IDateTimeProvider`>> and `IMemoryStreamFactory`.
6565

6666
<<transports,`Transport`>> is in control of managing our request pipelining, asking connection pools for other nodes to fall over to and marking nodes dead or alive.
6767

6868
Each individual moving part is further explained in the index.html[documentation].
6969

70+
[float]
7071
=== ConnectionSettings Changes
7172

7273
This lists the methods that have been renamed or removed on ConnectionConfiguration
@@ -140,6 +141,7 @@ interface IConnectionConfigurationValues
140141
+ prop: PrettyJson
141142
----
142143

144+
[float]
143145
==== IConnectionPool
144146

145147
The interface for `IConnectionPool` has been greatly simplified, its no longer in charge of mark nodes alive or dead
@@ -156,6 +158,7 @@ interface IConnectionPool
156158
+ method: Reseed
157159
----
158160

161+
[float]
159162
==== IConnection
160163

161164
The connection interface has been stripped to the bare minimum it now only has a `Request` and `RequestAsync` method
@@ -180,6 +183,7 @@ interface IConnection
180183

181184
The methods take a `RequestData` a new state object that holds all the information to build the request.
182185

186+
[float]
183187
==== Renamed Types
184188

185189
This lists the types that have been renamed
@@ -244,6 +248,7 @@ This lists the types that have been renamed
244248
+ class IndexTemplateExistsRequestParameters
245249
----
246250

251+
[float]
247252
==== Removed Types
248253

249254
This lists the removed types
@@ -296,6 +301,7 @@ This lists the removed types
296301
- class UpdateSettingsRequestParameters
297302
----
298303

304+
[float]
299305
==== Member Changes
300306

301307
This lists changes of class members that might bite you during the upgrade
@@ -496,3 +502,4 @@ class UpdateRequestParameters
496502
class ValidateQueryRequestParameters
497503
- method: Q
498504
----
505+

docs/2.0-breaking-changes/nest-breaking-changes.asciidoc

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
:github: https://github.com/elastic/elasticsearch-net
2-
3-
:stackoverflow: http://stackoverflow.com
4-
51
[[nest-breaking-changes]]
62
== NEST breaking changes
73

84
This document rudimentally documents the breaking changes from 1.x to 2.x; Our 2.0 refactor comprises 1000+ commits and nearly six months of work, so if we missed anything
95
{github}/issues[feel free to give us a shout]!
106

7+
[float]
118
=== Dependency graph changes
129

1310
The first thing you might notice is that the dependency graph for the client has changed slightly
@@ -61,15 +58,16 @@ var client = new ElasticClient(pool);
6158
----
6259

6360
This is what we call internally if you use the previous `ElasticClient` constructor.
64-
Our implementation of <<transports,`ITransport`>> can be injected with a custom <<request-pipeline,`IRequestPipelineFactory`>>, <<date-time-providers,`IDateTimeProvider`>> and `IMemoryStreamFactory`.
61+
Our implementation of <<transports,`ITransport`>> can be injected with a custom <<request-pipelines,`IRequestPipelineFactory`>>, <<date-time-providers,`IDateTimeProvider`>> and `IMemoryStreamFactory`.
6562

6663
<<transports,`Transport`>> is in control of managing our request pipelining, asking connection pools for other nodes to fall over to and marking nodes dead or alive.
6764

6865
Each individual moving part is further explained in the index.html[documentation].
6966

67+
[float]
7068
=== Inferred types
7169

72-
Many places that only took a string now take a more strongly typed object, <<`Id`,ids-inference>>, <<field-inference,`Field`>>, <<field-inference,`Fields`>>, <<index-name-inference,`Index`>>, <<indices-paths,`Indices`>>, `Type`, `Types`, <<document-paths,`DocumentPath<T>`>>. It's good to know that in most cases you can still implicitly convert to them from `string`, `long`, `Guid` where it makes sense.
70+
Many places that only took a string now take a more strongly typed object, <`Id`,ids-inference>>, <<field-inference,`Field`>>, <<field-inference,`Fields`>>, <<index-name-inference,`Index`>>, <<indices-paths,`Indices`>>, `Type`, `Types`, <<document-paths,`DocumentPath<T>`>>. It's good to know that in most cases you can still implicitly convert to them from `string`, `long`, `Guid` where it makes sense.
7371

7472
If you are using `C# 6` you can also staticly import `using static Nest.Infer`. This will allow you to write
7573

@@ -96,11 +94,13 @@ for `Index` and so on and so forth.
9694

9795
If you are using the fluent API, using these is not required (but still possible), as the fluent API is already expression based.
9896

97+
[float]
9998
=== Filters are **GONE**
10099

101100
In `Elasticsearch 2.0` https://www.elastic.co/guide/en/elasticsearch/reference/2.3/breaking_20_query_dsl_changes.html#_queries_and_filters_merged[queries and filter constructs have merged into one concept called queries], `NEST 2.0` reflects this, so if you are looking for the `AndFilter` it is now
102101
called the `AndQuery` but beware that some of these filters have been obsoleted and chances are high https://www.elastic.co/blog/all-about-elasticsearch-filter-bitsets[you were using them wrong!].
103102

103+
[float]
104104
=== Isolated descriptors
105105

106106
In `NEST 1.x` we took pride in being a 1 to 1 mapping with the Elasticsearch API, however in some cases we hid the real depth of parameters.
@@ -133,10 +133,12 @@ This encapsulates all of the sort options properly and adheres stricter to the 1
133133

134134
This happens in more places e.g index settings and mappings.
135135

136+
[float]
136137
=== Aggregator
137138

138139
If you are using the object initializer syntax `*Aggregator` is now `*Aggregation`
139140

141+
[float]
140142
=== Attribute-based mapping
141143

142144
The single `ElasticPropertyAttribute` has been broken up into individual attributes per property type.
@@ -199,6 +201,7 @@ Aside from a simpler and cleaner API, this allows each attribute to only reflect
199201

200202
`MapFromAttributes()` has also been renamed to `AutoMap()` to better reflect that it doesn't only depend on properties being marked with attributes. It will also infer the type based on the CLR type if no attribute is present.
201203

204+
[float]
202205
=== `TimeSpan` automapped as `long` (ticks)
203206

204207
`System.TimeSpan` is now automatically mapped as a `long` representing the number of ticks within the timeSpan, allowing for range in addition to term queries. NEst 1.x automatically mapped `TimeSpan` as a string and whilst NEST 2.0 is able to deserialize strings into `TimeSpan` instances as before, it will not automatically serialize `TimeSpan` ***into*** strings when indexing. In order to achieve this, you will need to register a json converter, either by deriving from `JsonNetSerializer` and overriding `ContractConverters` or by attributing the property with `[JsonConverter(typeof(ConverterTypeName))]`. A example of a converter for serializing/deserializing string values for `TimeSpan` is
@@ -239,11 +242,11 @@ public class StringTimeSpanConverter : JsonConverter
239242
}
240243
----
241244

245+
[float]
242246
=== Serialization settings
243247

244248
Serialization settings are now configurable through `ConnectionSettings` constructor taking a factory function that returns an instance of `IElasticsearchSerializer`.
245249

246-
247250
[source,csharp]
248251
----
249252
var setting = new ConnectionSettings(/** settings */);
@@ -278,6 +281,7 @@ public class MyJsonNetSerializer : JsonNetSerializer
278281
}
279282
----
280283

284+
[float]
281285
=== Renamed Types
282286

283287
[source,diff]
@@ -706,6 +710,7 @@ public class MyJsonNetSerializer : JsonNetSerializer
706710
+ class ValueCountAggregation
707711
----
708712

713+
[float]
709714
==== Removed Types
710715

711716
[source,diff]
@@ -1399,6 +1404,7 @@ public class MyJsonNetSerializer : JsonNetSerializer
13991404
- class YesNoBoolConverter
14001405
----
14011406

1407+
[float]
14021408
==== Member Changes
14031409

14041410
[source,diff]
@@ -3225,3 +3231,4 @@ class VerifyRepositoryResponse
32253231
+ prop: ApiCall
32263232
- prop: Infer
32273233
----
3234+

docs/aggregations-usage.asciidoc

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)