1

I want to do fluent mapping in my .NET Core 6 project with Elastic.Clients.Elasticsearch library, but I couldn't find anything in the documentation.

Usage in NEST library:

var createIndexResponse = _client.Indices.Create("myindex", c => c
     .Map<Company>(m => m
         .Properties(ps => ps
             .Text(s => s
                 .Name(n => n.Name)
             )
             .Object<Employee>(o => o
                 .Name(n => n.Employees)
                 .Properties(eps => eps
                     .Text(s => s
                         .Name(e => e.FirstName)
                     )
                     .Text(s => s
                         .Name(e => e.LastName)
                     )
                     .Number(n => n
                         .Name(e => e.Salary)
                         .Type(NumberType.Integer)
                     )
                 )
             )
         )
     )
 );

Is there a way to use the above example with the Elastic.Clients.Elasticsearch library? There is no method called Map in this library.

Or what is the method I can resort to to do this? Should I go back to the NEST library?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

0 Answers0