简体   繁体   中英

How to verify index_name works in elasticsearch

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)

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM