First, make sure you've read the Profiler API docs and this recent article since they discuss what some of the timings mean.
Now, to your question, merge time isn't currently profiled. It's essentially just inserting values into a priority queue of size n
, using the shard-local score as the sort value for the priority queue. I don't quite remember how ES implements it, but priority queues are usually implemented as heaps. So insertion/removal is probably O(log n)
I would not expect the merge time of hits to be a significant contributor to latency, especially relative to actually scoring documents and touching the disk. But it'd be nice if we could add it to the profiler eventually.
Now, if you're talking about merging aggregations together (e.g. in map-reduce fashion), that is timed under the reduce
method. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/_profiling_aggregations.html for more details