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
Copy file name to clipboardExpand all lines: docs/2.0-breaking-changes/nest-breaking-changes.md
+42-3Lines changed: 42 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ Our implementation of `ITransport` can be injected with a custom `IRequestPipeli
55
55
56
56
Each individual moving part is further explained in the documentation
57
57
58
-
# Infered types
58
+
# Inferred types
59
59
60
60
Many places that only took a string now take a more strongly typed object, `Id`, `Field`, `Fields`, `Index`, `Indices`, `Type`, `Types`, `DocumentPath<T>`.
61
61
Its good to know that in most cases you can still implicitly convert to them from `string`, `long`, `Guid` where it makes sense.
@@ -102,11 +102,10 @@ In `NEST 2.0` this discrapency is gone.
102
102
103
103
This happens in more places e.g index settings and mappings.
104
104
105
-
# Aggregotor
105
+
# Aggregator
106
106
107
107
If you are using the object initializer syntax `*Aggregator` is now `*Aggregation`
108
108
109
-
110
109
# Attribute-based mapping
111
110
112
111
The single `ElasticPropertyAttribute` has been broken up into individual attributes per property type.
@@ -167,6 +166,46 @@ Aside from a simpler and cleaner API, this allows each attribute to only reflect
167
166
168
167
`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.
169
168
169
+
## `TimeSpan` automapped as `long` (ticks)
170
+
171
+
`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
0 commit comments