4

My application is using dynamic data and fields are configurable by end user. It was working fine using Code Base Mapping similar that was described in NEST example on page Put Mapping example

var indexDefinition = new RootObjectMapping
{
    Properties = new Dictionary<PropertyNameMarker, IElasticType>(),
    Name = indexName
};

var property = new StringMapping
{
    Index = "not_analyzed"
};

var analyzedField = new StringMapping
{
    Index = "analyzed"
};

property.Fields.Add("name_analyzed", analyzedField);
indexDefinition.Properties.Add("name", property);
this.ConnectedClient.Map<object>(x => x.InitializeUsing(indexDefinition));

I wanted to convert my application to use elastic search 2.2 and nest 2.x but the problem is that most of classes that I've used are gone see breaking changes v2

I was using RootObjectMapping, MultiFieldMapping and StringMapping and all of those classes are gone.

The problems is that there is a lack of documentation for NEST 2.0.

Can somebody provide me example of code base mapping similar to example for code base mapping?

Thanks

Paweł Madurski
  • 121
  • 1
  • 4
  • 1
    Take a look at https://github.com/elastic/elasticsearch-net/blob/feature/documentation/docs/asciidoc/ClientConcepts/HighLevel/Mapping/AutoMap.doc.asciidoc. We are working on getting all of the documentation out for 2.0 right now :) – Russ Cam Feb 23 '16 at 01:27
  • Thanks Russ but I think that cannot use automapping. – Paweł Madurski Feb 23 '16 at 09:28

0 Answers0