Comparing two indexes in java


I am trying to efficiently compare two indexes, one index is formed of my own data (say of many nationalities and their average height) and the other index is incomplete data (only contains nationalities), where we both share a similar field to compare that is completed. The incomplete data index has more/less nationalities than my own data index, and i need to exact match all the names from the incomplete file to my own data file and update the incomplete file with a new height field with the heights from my data index. I was thinking of retrieving all the data from the incomplete file, multi-searching it for exact match, storing the corresponding height and either reindexing or updating the incomplete index. Is this the most efficient approach? I am doing all this in java. Open to all suggestions, Thanks!

Hi @always_improving123

It seems to me like a scenario where you can use the enricher processor. See this doc: Enrich your data | Elasticsearch Guide [8.14] | Elastic

I think you can reindex your incomplete index and in this process use the enricher processor to enrich the data and index it with the information you need.

1 Like