Skip to content

Document and blog post about versioned clients #3923

@russcam

Description

@russcam

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions