I use Nest Client for creating mapping and indexing data to Elasticsearch. I am facing now a problem which I don't understand how it comes.
I use AutoMap()
for mapping the object structure to index
var esClient = _esClientProvider.GetClient();
var response = esClient.Indices.Create(index,
index => index
.Settings(s => s.Setting("index.mapping.total_fields.limit", 2000))
.Map<EsProduct>(
x => x.AutoMap()
));
If I don't use Enabled=false
annotation in the class
public string AssetType { get; set; }
There will be 2 fields generated in the index (one with text and one with keyword)
I would like to remove the .keyword field so I use Enabled=false annotation
[Object(Enabled = false)]
public string AssetType { get; set; }
Then now there will be 2 other fields generated in the index (one with keyword and one with integer) and with different name.
I don't get the point now. I just want to skip ".keyword" field and keep the text field. Is Enabled=false not the correct solution?
Thank you in advance.