-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Relates: #3913 (comment)
We have been releasing versioned clients to our CI package repository. A versioned client is IL-rewritten such that the assembly name and all namespaces are changed, allowing a versioned client to be referenced within a project in addition to an official release client package from nuget.
For example, with a CI nuget package source configured in a Nuget.config file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Appveyor CI" value="https://ci.appveyor.com/nuget/elasticsearch-net" />
</packageSources>
</configuration>A project can pull in the latest Nest.v6 package from CI, in addition to Nest package version 7.0.0 from Nuget. For example,
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NEST" Version="7.0.0" />
<PackageReference Include="NEST.v6" Version="6.9.0-ci20190620T132817" />
</ItemGroup>
</Project>Then, both can be used in the project side by side
public static void Main()
{
// 6.x client from Nest.v6 package
var settings6x = new Nest6.ConnectionSettings(new Elasticsearch.Net6.SingleNodeConnectionPool(uri))
.DefaultIndex("posts");
var client6x = new Nest6.ElasticClient(settings6x);
// 7.x client from Nest 7.0.0 package
var settings = new ConnectionSettings(new SingleNodeConnectionPool(uri))
.DefaultIndex("posts");
var client = new ElasticClient(settings);
}and custom logic can be implemented to determine which client to use.
The intention with providing these is to help in the short-term in upgrading the client to the next major version, at the same time as upgrading Elasticsearch.
Documentation and a blog post should be provided to highlight.