Strategy for Input join parent child relation with two statements?

Hi I need to Sync Postgres with Elasticsearch. I used jdbc_input_plugin and these is the main idea:

  • I have a index with parent child relation join type
  • I have one querys for index parents: (users)
  • I have second query for indexing childs (insights)
  • Can't go with one query cause is to expensive in performance for postgres.

The process is:

  1. Index all the parent and then sync with updated_at
    2 Indexing all the childs an then sync with updated_at

The second query depend on the query 1 has already executed. because we we don't want to index children without parents.

Is possible to stop the second input query until que first has already indexing?
If yes how to do this?

Or there is another strategy?
I will appreciate your response

Update: Order of indexing parent and childs documents there is no necessary.

There is no problem with indexing childs document without already indexed the parent.
When the parent is indexing later the query works without problem.

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