Hi,
Im trying to create index for a very simple class. My class :
public class ElasticSearchDto
{
public string Id { get; set; }
public string ApplicationNumber { get; set; }
}
Using the following code to create my index (using Elasticsearch.Net.Aws as im using aws elastic search service)
var httpConnection = new AwsHttpConnection();
var pool = new SingleNodeConnectionPool(uri);
var config = new ConnectionSettings(pool, httpConnection).DisableDirectStreaming().PrettyJson();
var client = new ElasticClient(config);
var result = client.Indices.Create("Test", x => x
.Map<ElasticSearchDto>(m => m
.Properties(ps => ps
.Text(t => t.Name(n => n.Id))
.Text(t => t.Name(n => n.ApplicationNumber)))
)
);
Also tried auto mapping, nothing work. Getting the following response.
# Request:
{"mappings":{"properties":{"id":{"type":"text"},"applicationNumber":{"type":"text"}}}}
# Response:
{
"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters: [applicationNumber : {type=text}] [id : {type=text}]"
}
],
"type" : "mapper_parsing_exception",
"reason" : "Failed to parse mapping [properties]: Root mapping definition has unsupported parameters: [applicationNumber : {type=text}] [id : {type=text}]",
"caused_by" : {
"type" : "mapper_parsing_exception",
"reason" : "Root mapping definition has unsupported parameters: [applicationNumber : {type=text}] [id : {type=text}]"
}
},
"status" : 400
}
I will really appreciate some help on this.
Kind regards,
Shahed