Hello there. After profiling some ES queries, I noticed that the minimum request time was about 300 milliseconds and found out that this is in large (the 200ms, about 65%) due to the multiple ping()$version$number checks in search_POST() and search_GET(). You may have not noticed it during development with a local server, but makes a large difference when ES is behind a distant network. (In my use case, each ping() roundtrip takes about 80-110 ms)
# in ES >= v5, lenient param droppped
if (gsub("\\.", "", ping()$version$number) >= 500) args$lenient <- NULL
# in ES >= v5, fields param changed to stored_fields
if (gsub("\\.", "", ping()$version$number) >= 500) { ... }
the second ping() call could be saved by saving the result of the first call. Or probably totally avoided if the version is cached in the session variables during the first ping() call in that session (should be invalidated after a next connect() call, since the server and version may be different).
Hello there. After profiling some ES queries, I noticed that the minimum request time was about 300 milliseconds and found out that this is in large (the 200ms, about 65%) due to the multiple
ping()$version$number
checks insearch_POST()
andsearch_GET()
. You may have not noticed it during development with a local server, but makes a large difference when ES is behind a distant network. (In my use case, each ping() roundtrip takes about 80-110 ms)e.g. at search.r and Search_uri.R
the second ping() call could be saved by saving the result of the first call. Or probably totally avoided if the version is cached in the session variables during the first
ping()
call in that session (should be invalidated after a next connect() call, since the server and version may be different).