How can you verify if index_name property works correctly in elasticsearch. ie how to verify if elasticsearch internally stores field key using index_name.
Below is my mapping.
POST testalias
{
"mappings": {
"test": {
"properties": {
"keywords" : { "type" : "string", "index_name": "kd" }
}
}
}
}
I store data as below
POST testalias/test/
{
"keywords": "mykey123"
}
When I lookup http://localhost:9200/testalias/_search?q= *&pretty I get the response with
"_source":{
"keywords": "mykey123"
}
So the response shows the field name "keywords", but how can I confirm internally es stores it as "kd". This is important because my field names are very long and I want to use index_name to save disk space. My business reason is based on this post cost of keys in JSON document database (mongodb, elasticsearch)
You can try to search with query dsl and you use kd field : ( http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html )
You can check the mapping. If you have kd field and keywords field, it's wrong. Try to index with "kd" field and not "keywords".
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.