0

What is the fastest way to perform multiple "_update_by_query" in elasticsearch

The brute force way is to just use a for that runs every single update, Another way for my problem would be searching for each document an then using BULK API to update the documents.

Update the documents with multiple "_update_by_query"

  • Maybe explain your use case in more details. As it is, it's impossible to tell what would work best for you. How many docs, update frequency, type of update, etc – Val Apr 29 '23 at 06:38

1 Answers1

1

Performing multiple _update_by_query operations can be time-consuming, especially if the number of documents to be updated is large. The following are some ways to optimize the process and speed it up:

  • Use the Elasticsearch Bulk API: Instead of running individual _update_by_query operations for each document, you can use the Bulk API to update multiple documents at once. This can significantly reduce the time taken to update the documents.

  • Use scroll API: If you have a large number of documents to be updated, using the Scroll API can be more efficient than using a simple search query. Scroll API allows you to retrieve large numbers of documents efficiently in batches, which can then be updated using the _update_by_query operation.