I am getting below error when i try to create the mapping using create index request.
Elasticsearch exception [type=mapper_parsing_exception, reason=Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [recommendations : {recommendations={properties={events={type=nested, properties={recommendationData={type=nested, properties={recommendations={type=nested, properties={recommendationType={type=keyword}}}}}}}}}}]]
and the mapping is
{
"mappings": {
"recommendations": {
"properties": {
"events": {
"type": "nested",
"properties": {
"recommendationData": {
"type": "nested",
"properties": {
"recommendations": {
"type": "nested",
"properties": {
"recommendationType": {
"type": "keyword"
}
}
}
}
}
}
}
}
}
}
}
and the java code is
private void checkAndCreateDocumentMapping() throws IOException {
CreateIndexRequest createIndexRequest = new CreateIndexRequest(this.getIndexName());
String indexString = getStringFromFile("nested" + ".mapping");
createIndexRequest.source(indexString, XContentType.JSON);
client.indices().create(createIndexRequest, RequestOptions.DEFAULT);
}