In this article, we are going to review how to enhance the speed of the queries that are done with using Elasticsearch where it is beneficial.
There are some hints in Nuxeo documentation about recommended tuning of Elasticsearch node, in which it includes having half of the total memory (RAM) size for the Elasticsearch Heap Size (in the example, 6g in a machine with a total of 12g). But this post is mainly about setting Page Provider to query over Elasticsearch instead of a less efficient SQL Database. In our experience, this can improve slow queries of 5, 7 or 10 seconds to under 1 second, and typically in the range of 0 to 200 ms .
One of the few Page Providers NOT to use with Elasticsearch is the one used by the content view orderable_document_content.
The reason why is because this involves reindexing the position of documents, which has a high cost.
To summarize: enabling a separate physical or virtual machine with an Elasticsearch separate instance (it's not recommended to use the by-default embedded version that Nuxeo provides) will enhance performance a great deal, by adding the Page Providers discussed.