I have successfully created a descriptor for my Index. Have already created the index. The response generated is a valid response. I am not sure how to use descriptor thereafter.
var defaultIndex = "mynestclient";
var node = new Uri("http://localhost:9200");
var settings = new ConnectionSettings(node
).DefaultIndex(defaultIndex);
var client = new ElasticClient(settings);
var clientcreated= client.CreateIndex(defaultIndex);
Console.WriteLine("Index Created");
var descriptor = new CreateIndexDescriptor(defaultIndex)
.Settings(s => s
.Analysis(a => a
.TokenFilters(t => t
.NGram("my_filter", ng => ng.MaxGram(32).MinGram(1)))
.Analyzers(an => an
.Custom("my_analyzer", ca => ca
.Tokenizer("standard")
.Filters("my_filter", "lowercase")
)
)
)
)
.Mappings(ms => ms
.Map<Investor>(m => m
.Properties(props => props
.Text(t => t
.Name(p => p.Name)
.Analyzer("my_analyzer")
)
.Text(t => t
.Name(p => p.SomeOtherField)
.Analyzer("my_analyzer"))
.Boolean(b => b
.Name(p => p.IsActive))));
I have been through the documentation. Not much around using Descriptors. Also, if anybody could point me to a documentation around NEST that specifies difference between PutMappingDescriptors and CreateIndexDescriptors, or Likewise, that would be helpful. Any inputs greatly appreciated.