Skip to content

IndexSettings NumberOfShards and NumberOfReplicas are objects, not int/long as expected #8248

Open
@andersosthus

Description

@andersosthus

Elastic.Clients.Elasticsearch version: 8.14.3

Elasticsearch version: 8.14.1

.NET runtime version: .net8

Operating system version: Ubuntu 20.04

Description of the problem including expected versus actual behavior:
When loading index settings with ElasticsearchClient.Indicies.GetAsync the resulting IndexSettings.Settings object has NumberOfShards and NumberOfReplicas defined as object? and gets populated with the string representation of the value.

I would expect these fields to be int (not even nullable because I believe they are always present?)

Steps to reproduce:

  1. Create index: curl -X PUT http://localhost:9200/testindex
  2. Get IndexSettings:
var client = new ElasticsearchClient(new Uri("http://localhost:9200"));
var indexReq = new GetIndexRequest("testindex");
var getResponse = await client.Indices.GetAsync(indexReq);
  1. Inspect the response and look at Settings.NumberOfShards and Settings.NumberOfReplicas. See attached screenshot.

Expected behavior
NumberOfShards and NumberOfReplicas should be of type int.

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions