Code Monkey home page Code Monkey logo

Comments (4)

flobernd avatar flobernd commented on August 16, 2024 1

Some additional context here.

Sadly, there won't be a fix for this before the above mentioned feature is implemented.

from elasticsearch-net.

andersosthus avatar andersosthus commented on August 16, 2024 1

Ah gotcha. I'll manage for now by wrapping them in a Convert.ToInt32() so no rush.

Question: According to your spec above, they are defined as nullable. Is this correct? I thought they were always present in the Index Settings?

from elasticsearch-net.

flobernd avatar flobernd commented on August 16, 2024 1

I think the fields are all nullable at the moment, to make sure some of the other clients don't break if a field is not present. The Java client e.g. fails to deserialize objects, if a required field is missing. The Elasticsearch server on the other hand tends to omit certain fields under certain shady conditions 😋 Modelling it like this was probably the most safe way - this surely must be checked in detail as well as soon as we get to improve the IndexSettings in the spec.

from elasticsearch-net.

flobernd avatar flobernd commented on August 16, 2024

Hi @andersosthus, the IndexSettings are not completely modelled in the specification at the moment.

This is how it currently looks for these 2 fields:

  /** @server_default 1 */
  number_of_shards?: integer | string // TODO: should be only int
  /** @server_default 0 */
  number_of_replicas?: integer | string // TODO: should be only int

As .NET does not support unions discriminated by type, the generator simplifies this construct as object. As you can see in your screenshot, the values are actually not ints, but strings containing a number.

The specification should probably be changed like this:

  /** @server_default 1 */
  number_of_shards?: Stringified<integer>
  /** @server_default 0 */
  number_of_replicas?: Stringified<integer>

from elasticsearch-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.