We recently upgraded our ES cluster from 6.4.2 to 6.8.2 without any changes to the data. One thing we notice is that the same search query takes a lot longer in 6.8.2, and after turning on profiling, we notice the significant time increase for
rewrite_time. I couldn't find anything through the release notes that indicate this change in behavior.
Here's our query: https://gist.github.com/imrimt/4bae846b627201de8dd0acf20f545cb7
Here's the profiling section when running against the 6.4.2 cluster: https://gist.github.com/imrimt/27fab2bf9bafa409ae34ae462c11cfc7
And here's the profiling section when running against the 6.8.2 cluster: https://gist.github.com/imrimt/dba81fea4950d99ebbd6013c2d9e0b12
If someone could take a look into this we would really appreciate it. Thanks in advance!
Updated: we were able to pin-point what was causing the increase in rewrite time -- it was the
field_value_factor function in the
function_score query within the
has_child query. When we change this to
random_score, the rewrite time significantly decreased to the speed we were seeing on 6.4.2. However, we still don't know why this is happening so would love some input from the ES team.