Query an index an put it into another index in Ingest plugin

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")
.setTypes("type1", "type2")
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.setQuery(QueryBuilders.termQuery("multi", "test")) // Query
.setPostFilter(QueryBuilders.rangeQuery("age").from(12).to(18)) // Filter
.setFrom(0).setSize(60).setExplain(true)
.get();

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.

It's super unclear...

How this query is related to the reindex operation?
How is it related to an ingest plugin? Which one?

Then I'm not sure I'm understanding this part:

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.

And finally, please format your code using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.