Mappings are not getting updated in ElasticSearch using java code -


i have tried updating mappings in elastic search using java code. dismay mappings not getting updated

following code

string settingsasjson =getjsonstring("settingfile"); client.admin().indices().close(new        closeindexrequest(indexname)).actionget().isacknowledged(); boolean settingsack =   client.admin().indices().prepareupdatesettings().setsettings(settingsasjson).setindices(indexname).execute().actionget().isacknowledged(); system.out.println("applied settings "+ settingsack); string mappingasjson = getjsonstring("mappingfile"); boolean mappingack = client.admin().indices().prepareputmapping().setindices(indexname).settype(indextype).setsource(mappingasjson).execute().actionget().isacknowledged(); system.out.println("applied mappings "+ mappingack); client.admin().indices().open(new openindexrequest(indexname)); client.admin().indices().prepareflush(indexname); 

following mapping file

{ "profiles": {  "dynamic" : "true",  "_all": {  "type": "string",  "analyzer": "standard"  },  "properties": {  "employee_id": {  "type": "integer",   "analyzer":"standard"   } } } } 

also note, dynamic property changes rest new updation on mappings dont updated. there other way update mappings using java code?


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -