For the attribute part, is there any form to tell NEST to use copy to by attributes? I want to create my mapping dynamically, so that I don't code the field property when creating my CreateIndexDescriptor
object.
Example of attribute mapping:
[String(Analyzer="analyzer_shingles")]
public string company_no { get; set; }
Now for the reflection part...
Is there any way to use the Map<T>
method dynamically?
Example of non-dynamic Mapping:
var mapperTemplate = new CreateIndexDescriptor(string.Format("customers"))
.Settings(s => s
.Analysis(a => a
.Analyzers(an => an
.UserDefined("analyzer_shingles", shingles)
.UserDefined("didYouMean", didYouMean)
)
)
);
var customer = mapperTemplate.Mappings(ms => ms
.Map<customer>(m => m
.AllField(a => a.Analyzer("analyzer_shingles"))
.AutoMap()
)
);
I've tried obtaining the methods and passing new lambdas, but I'm stuck at passing parameters to the Map
method.
I can't find a form to use MakeGenericType
on:
new Func<TypeMappingDescriptor<T>, ITypeMapping>
Also, Map
with a TypeName
parameter doesn't seem to do the work.
Help is much appreciated.