ElasticSearch Mapping Visitor Pattern Not Applied on Dynamic Object
The joy of learning new technology is learning new constraints. There is never enough documentation. I need to insert dynamic objects into ElasticSearch. For the sake of consistency, I need some properties mapped to specify types and the rest will be mapped text. One amazing thing is the ElasticSearch automagical conversion called AutoMap. Seems like AutoMap with visitor pattern and properties override will meet my requirements, so I have something like this in my code: public class MapToTextPropertyVisitor : NoopPropertyVisitor { public override IProperty Visit(PropertyInfo propertyInfo, ElasticsearchPropertyAttributeBase attribute) => new TextProperty(); } var createIndexResponse = _client.Indices.Create("<index_name>", c => c .Map<dynamic>(m => m .AutoMap(new MapToTextPropertyVisitor() ) ...