Dude, I wanna help you, but you gotta help me do it in the first place and you can do it following a simple rule:
When you receive a reply, try following it, googling what you don't know and, if you find nothing, asking here that specific thing.
Now, you didn't speak of Logstash in the first place (plus we're in the Kibana section here), then why should I? If I meant something external I would name it. You can create an index by simply using the Dev Tools section of kibana (which is basically a fancy way to make cURL calls). Typing
PUT /test-index2
{
"mappings" : {
"properties" : {
"salary" : { "type" : "float" }
}
}
}
You would have known it, if only you'd googled "create index elasticsearch".
Then, in order not to lose your current data, I specifically asked you to reindex you data. Which means to copy your data from one index (the old one) to another index (the one you've just created with the right mapping). Which you can do (again in the Dev Tools) by typing:
POST _reindex
{
"source": {
"index": "test-index"
},
"dest": {
"index": "test-index2"
}
}
Again, you would have known it if only you'd googled "reindex elasticsearch". And if you didn't know the reindex and didn't make the effort to google it, at least ask here what it is.
Now, once you've checked all the docs have been copied from one index to the other (Management>Index Management and see the number of docs of the 2 indices) and that the new index docs have a salary field of type "float", then you can delete the old index (in the Management>Index Management section flagging it and deleting it or in the Dev Tools typing DELETE test-index
), create again the test-index index with the proper mapping as you did for test-index2, reindex data (this time from test-index2 to test-index) and delete the test-index2.
Also, you have to answers all the questions that are asked you, because they might be fundamental to establish the best approach to achieve what you want.
I specifically asked you (and you didn't reply)
How many docs are now in your index?
This is useful to know because the reindex takes a time proportional to the number of docs it has to copy from one index to the other.
Also, now you mention Logstash so, are the data still flowing? Because as you started your post I assumed you had a static situation.
If the data are flowing you need to redirect your flow to the new test-index2 while reindexing (obviously make the right mapping first or it'll be useless) and then switch the flow back to test-index before reindexing back.
Not to have any problem with chronological order of the docs, though, they must have a timestamp field, which I believe they have.
Another unreplied question of mine (made to simplify your work and write for you some ready-to-use calls) is:
What's the name of the index?