Giter VIP home page Giter VIP logo

Comments (5)

cguedel avatar cguedel commented on July 21, 2024

Here's a repo (xunit):

    [InlineData(10000)]
    [InlineData(long.MaxValue)]
    public async Task Should_get_index_with_mapping_nested_fields_limit_set_to_maximum(long limit)
    {
        // Arrange
        var indexName = $"{Guid.NewGuid():N}";
        var client = TestElasticsearchClientFactory.Instance; // returns an ElasticsearchClient instance

        try
        {
            var descriptor = new CreateIndexRequestDescriptor(indexName);
            descriptor.Settings(s => s.OtherSettings(sd => sd.Add("index.mapping.nested_fields.limit", limit.ToString())));

            var createIndexResponse = await client.Indices.CreateAsync(descriptor);
            createIndexResponse.ThrowIfInvalid();

            // Act
            var index = await client.Indices.GetAsync(indexName);

            // Assert
            var indexState = index.Indices.Should().ContainSingle().Which.Value;
            var limitRetrievedFromSettings = indexState.Settings?.Index?.Mapping?.NestedFields?.Limit;

            limitRetrievedFromSettings.Should().Be((int)limit); // TODO: fix assertions
        }
        finally
        {
            try
            {
                await client.Indices.DeleteAsync(indexName);
            }
            catch
            {
                // ignored
            }
        }
    }

works with 10000, but doesn't work with long.MaxValue. In both cases, the server returns the property in question as a string.

from elasticsearch-net.

flobernd avatar flobernd commented on July 21, 2024

Hi @cguedel, thank yo for the reproducer 🙂

It seems like the type of limit is incorrectly modelled as int instead of long in our specification.

from elasticsearch-net.

cguedel avatar cguedel commented on July 21, 2024

@flobernd Are you sure this is fixed? From my repro it still fails and from https://github.com/elastic/elasticsearch-net/blob/main/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/MappingLimitSettingsNestedObjects.g.cs#L36 it looks like this is still an int and not a long

from elasticsearch-net.

flobernd avatar flobernd commented on July 21, 2024

@cguedel Yes, I noticed as well. Something went wrong when generating the new client. The preprocessing of the specification was not completed. I'll push a follow up fix soon.

from elasticsearch-net.

cguedel avatar cguedel commented on July 21, 2024

Confirm that this is fixed in 8.13.15, thanks for the quick response!

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.