Fabrizio Fortino created OAK-9311:
-------------------------------------

             Summary: oak-search-elastic: use low-level client for critical 
operations
                 Key: OAK-9311
                 URL: https://issues.apache.org/jira/browse/OAK-9311
             Project: Jackrabbit Oak
          Issue Type: Improvement
            Reporter: Fabrizio Fortino


We are currently using the Java High-Level Rest Client [1] to interact with 
Elastic. While this is quite handy to use it does not seem to be the best 
option in terms of performance [2]. 

Using the low-level client would mean to write more code in OAK with the 
advantage of having better performances and flexibility. For example, we could 
instruct ES to return only the response we are interested in [3]. In our 
searches, we are usually interested in the path field and, when requested the 
facets fields. ES for each document returns the index name. Since we use pretty 
long index names, only removing this would decrease the payload size by 20/30%.

To have good performance and nice code we could keep using the query builders 
provided by ES. The query builders output should then be used to perform the 
request to ES through low-level client. The response needs to be parsed in OAK. 

[1] 
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-high.html

[2] 
https://discuss.elastic.co/t/performance-difference-between-java-high-level-rest-client-vs-low-level-rest-client/125775

[3] 
https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#common-options-response-filtering

Options



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to