- .NET Clients: other versions:
- Introduction
- Getting started
- Installation
- Connecting
- Configuration
- Client concepts
- Using the .NET Client
- Troubleshooting
- Release notes
- Breaking changes policy
- Release notes v8.11.0
- Release notes v8.10.0
- Release notes v8.9.3
- Release notes v8.9.2
- Release notes v8.9.1
- Release notes v8.9.0
- Release notes v8.1.3
- Release notes v8.1.2
- Release notes v8.1.1
- Release notes v8.1.0
- Release notes v8.0.10
- Release notes v8.0.9
- Release notes v8.0.8
- Release notes v8.0.7
- Release notes v8.0.6
- Release notes v8.0.5
- Release notes v8.0.4
- Release notes v8.0.3
- Release notes v8.0.2
- Release notes v8.0.1
- Release notes v8.0.0
Custom mapping examples
editCustom mapping examples
editThis page demonstrates how to configure custom mappings on an index.
Configure mappings during index creation
editawait client.Indices.CreateAsync<Person>(index => index .Index("index") .Mappings(mappings => mappings .Properties(properties => properties .IntegerNumber(x => x.Age!) .Keyword(x => x.FirstName!, keyword => keyword.Index(false)) ) ) );
Configure mappings after index creation
editawait client.Indices.PutMappingAsync<Person>(mappings => mappings .Indices("index") .Properties(properties => properties .IntegerNumber(x => x.Age!) .Keyword(x => x.FirstName!, keyword => keyword.Index(false)) ) );
Was this helpful?
Thank you for your feedback.