Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixed last remaining failing unit tests * Split serializer into request/response AND source serializer. Scrub json.net related classes from public API * Writing test for source serialization, making sure it respects the custom user serializer * formatting * validated more API's are using source serializer correctly for writing * we now randomly seed when running on the commandline and we show replay command at the end of the run always * test framework can now run with or without source serializer this is random on the commandline and pinnable on both commandline and vanilla test runners. unit tests succeeds for both with and without source serializer, onwards to integration tests * Don't bleed Union<T,T> into JoinField, since its expected to be on folks documents it does not play well with SourceSerializer's, had it working in a previous commit but this limits the ammount of places that need patching. * clearly separate Source and RequestResponse Serializers by name * We can now offer a custom json net serializer that will fallback to our serializer for known NEST types in _source e.g JoinField, or QueryContainer when indexing percolation queries * RevertBackToBuiltInConverter now works as expected * fixed failing unit test due to new property on Project * Several improvements LazyDocument is now source serializer aware. Explain() Search() MultiGet() SimulatePipeline() Get() now all have integration tests for custom source deserialization * Suggest() is now source serializer aware * fixed all unit tests, reverted changes to source converter and documentjson converter since the proposed optimization still used the internal writer and thus the internal serializer settings * ApiTestBase now uses source convverter by default as well, more like this query document now uses source converter * TopHits aggregations now support custom source serializer * Scripted metric now uses source serializer * FieldsValues is now also source serializer aware * update unit tests now that we have a non nullable int in Project * update paket targets file * ILRepack internalizes JSON.NET, Mono.Cecil rewrites its namespace * updated Mono.Cecil to the latest beta, this one does not lock the assembly file and explicitly allows overwriting existing files * Introduced new nuget package NEST.JsonNetSerializer which folks can reference should they need to customize the way their _source and field values are (de)serialized using Json.NET * added new documentation around customizing serialization' * attempt 1 * attempt 2 * All unit tests now pass when testing against local nuget package for NEST. Simplified Serialization testbase Return of Gimme.Lock started seeing Bogus blocking on Populate again. * canary builds now test the nuget package at the end of its build run. * make appveyor run the canary build and include appveyor.yml as solution item * ILRepack and mono do not mix, prevent calling canary/release on mono systems for now * move to async token read in json.net 10.0.1, idea being that its less bad to buffer in a JObject than to read the stream in a blocking fashion. cc @codebrain @russcam * Add SerializeAsync to interface * Prevent boxing on PostData<object> `PostData<object>` was was introduced as a union'esque type that `byte[]/string/object/IEnumerable<string>/<IEnumerable<object>` could all implicitly converter to automagically making the lowel client easy to use without exploding the already massive method list on ILowLevelClient. This abstraction meant that we always boxed for NEST types to object. In preparation for all the serialization/perf work we want to do in 6.x it would be great if we can take `T` that we we want to serialize all the way to the `IElasticsearchSerializer` which we can do with this PR now. We sacrifice on the implicit operators in the low level client (for the most part: byte[] and string still do). TBF most of the time I've seen people use the low level client they would instantiate `PostData<object>` directly already. Or worse see: #2656. We weren't really helping anyone here. `PostData<object>` now has a base class `PostData` that we use throughout. There is also `SerializableData<T>` subclass that we now use for anything that needs serializing. This dispatcher is now aware of what generics an `IRequest` implementation has. Because of this our hack to make `Index(document)` and `CreateIndex(document)` work when document == IIndexRequest or not no longer works. Rather than fighting C# resolution of overloads (and its lack of not constraints :() the methods are now called `IndexDocument()` and `CreateDocument()`. * update travis to dotnet 2.0.3 * walkthrough review comments from @codebrain and @russcam, updated travis.yml to support netcore 2 building netcoreapp1.x on linux * suspicion skipping first time experience on the dotnet cli breaks setting up nuget caches properly * put back DOTNET_SKIP_FIRST_EXPERIENCE, as it did not solve travis build * build.sh was alway doing an install because it was checking for add an empty paket file in src to prevent paket from adding targets to csproj file on paket install * make sure dotnet SDK 1.0.4 is available * 1.0.5 not 1.0.4
- Loading branch information
Showing
264 changed files
with
4,590 additions
and
3,816 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> | ||
<metadata> | ||
<id>NEST.JsonNetSerializer</id> | ||
<version>$version$</version> | ||
<title>Hook up your own Json.Net serializer in NEST in an isolated fashion</title> | ||
<authors>Elastic and contributors</authors> | ||
<owners>Elastic</owners> | ||
<licenseUrl>https://github.com/elastic/elasticsearch-net/blob/master/license.txt</licenseUrl> | ||
<projectUrl>https://github.com/elastic/elasticsearch-net</projectUrl> | ||
<iconUrl>https://raw.githubusercontent.com/elastic/elasticsearch-net/master/build/nuget-icon.png</iconUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>NEST 6.x ships with an internalized Json.NET, this package opens the (de)serialization up for your own custom Json.NET serializer</description> | ||
<summary>NEST 6.x ships with an internalized Json.NET, this package opens the (de)serialization up for your own custom Json.NET serializer</summary> | ||
<releaseNotes>See https://github.com/elastic/elasticsearch-net/releases/tag/$version$</releaseNotes> | ||
<copyright>2017-$year$ Elasticsearch BV</copyright> | ||
<tags>elasticsearch,elastic,search,lucene,nest,serializer,json</tags> | ||
<dependencies> | ||
<group targetFramework=".NETFramework4.5"> | ||
<dependency id="NEST" version="[$version$, $nextMajorVersion$)" /> | ||
<dependency id="Newtonsoft.Json" version="[$jsonDotNetCurrentVersion$, $jsonDotNetNextVersion$)" /> | ||
</group> | ||
<group targetFramework=".NETFramework4.6"> | ||
<dependency id="NEST" version="[$version$, $nextMajorVersion$)" /> | ||
<dependency id="Newtonsoft.Json" version="[$jsonDotNetCurrentVersion$, $jsonDotNetNextVersion$)" /> | ||
</group> | ||
<group targetFramework=".NETStandard1.3"> | ||
<dependency id="NETStandard.Library" version="[1.6.0, )" /> | ||
<dependency id="NEST" version="[$version$, $nextMajorVersion$)" /> | ||
<dependency id="Newtonsoft.Json" version="[$jsonDotNetCurrentVersion$, $jsonDotNetNextVersion$)" /> | ||
</group> | ||
</dependencies> | ||
</metadata> | ||
<files> | ||
<file src="output\Nest.JsonNetSerializer\net45\Nest.JsonNetSerializer.dll" target="lib\net45"/> | ||
<file src="output\Nest.JsonNetSerializer\net45\Nest.JsonNetSerializer.XML" target="lib\net45"/> | ||
|
||
<file src="output\Nest.JsonNetSerializer\net46\Nest.JsonNetSerializer.dll" target="lib\net46"/> | ||
<file src="output\Nest.JsonNetSerializer\net46\Nest.JsonNetSerializer.XML" target="lib\net46"/> | ||
|
||
<file src="output\Nest.JsonNetSerializer\netstandard1.3\Nest.JsonNetSerializer.dll" target="lib\netstandard1.3"/> | ||
<file src="output\Nest.JsonNetSerializer\netstandard1.3\Nest.JsonNetSerializer.xml" target="lib\netstandard1.3"/> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.