Assume i have indices with names carssdata_original, carssdata_stage
The data in the carsspark_original is given below.
{
"_index": "carssdata_original",
"_type": "doc",
"_score": 1,
"_source": {
"carid": "1",
"carname": "BMW1",
"enginetype": "Petrol",
"cost": "20000",
"countryId": "1",
"modelnumber": "10"
}
}
The data in the carsspark_stage is given below.
{
"_index": "carssdata_stage",
"_type": "doc",
"_score": 1,
"_source": {
"carid": "2",
"carname": "BMW2",
"enginetype": "Petrol",
"cost": "20000",
"countryId": "1",
"modelnumber": "10"
}
}
With Re-Indexing:
POST _reindex
{
"source": {
"index": ["carssdata_original", "carssdata_stage"]
},
"dest": {
"index": "carsspark_final"
}
}
The data in the carsspark_final is given below.
{
"_index": "carssdata_original",
"_type": "doc",
"_score": 1,
"_source": {
"carid": "1",
"carname": "BMW1",
"enginetype": "Petrol",
"cost": "20000",
"countryId": "1",
"modelnumber": "10"
}
}
{
"_index": "carssdata_stage",
"_type": "doc",
"_score": 1,
"_source": {
"carid": "2",
"carname": "BMW2",
"enginetype": "Petrol",
"cost": "20000",
"countryId": "1",
"modelnumber": "10"
}
}
Which is expected.
But my requirement is not to create one more index by combining 2-indexes data into 3rd index, rather i would want to merge or copy carssdata_stage data to carssdata_original index. Once data copied later i can delete carssdata_stage index. So that i can have only one index which is having both the data in single index.
Could you please help me on this.