How can I save the results of the DSL query directly to another index?


(Mr.xian) #1

It's like executing the following SQL statement:
INSERT INTO ANOTHER_TABLE SELECT * FROM ONE_TABLE WHERE age BETWEEN 16 AND 45;

Thank you very much for your answer:)


(Matija Bruncic) #2

You should take a look at reindex API https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html


(Mr.xian) #3

Great! that's the answer I want!!
In addition to being able to copy one index to another, reindex also supports adding query parameters
Thank you~


(Matija Bruncic) #4

I'm glad to help


(system) #5

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