I need to copy fields from an index to another one using an ingest plugin. I have used the following query:
SearchResponse response = client.prepareSearch("index1", "index2")
.setQuery(QueryBuilders.termQuery("multi", "test")) // Query
.setPostFilter(QueryBuilders.rangeQuery("age").from(12).to(18)) // Filter
In the new index I can see the fields added in it but the problem that ES increase the number of documents in the new index continuously but in reality, I have to found the same number of documents of the original index.