I'm working with elasticsearch 6.2.4 and using the following code to create an index.
CreateIndexRequest request = new CreateIndexRequest(indexName);
request.source(jsonSource, XContentType.JSON);
CreateIndexResponse cir = esClient.indices().create(request);
The json is something like this
> { > "mappings": { > "info": { > "properties": { > "id": { > "analyzer": "ik_smart", > "type": "text" > }, > "sex": { > "analyzer": "ik_smart", > "type": "text" > }, > "name": { > "analyzer": "ik_smart", > "type": "text" > } > } > } > } > }
It creates the index and gives me all uppercase field .
"mappings": {
"info": {
"properties": {
"ID": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"SEX": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"NAME": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"id": {
"type": "text",
"analyzer": "ik_smart"
},
"sex": {
"type": "text",
"analyzer": "ik_smart"
},
"name": {
"type": "text",
"analyzer": "ik_smart"
}
}
Why would this happen and Can you guys offer me a solution?