Can Elasticsearch log how many result found for a slow query?

I'm trying to have a log for the following three things:

  1. how long it ran
  2. how many result it found
  3. what the query is

slow log can give me 1 and 3, but not 2. So is there any way for me to get that?]

Appreciate it!

That sounds like a good idea to me. Can you open an issue for it on GitHub?
Maybe there already is an issue for it? If so go and comment on it!

One fun thing is that the slow logos per shard nor for the whole query,
iirc. In that case only the number of hits on that shard are available, not
the total.

Thank you Nik! Just added the issue here: https://github.com/elastic/elasticsearch/issues/20648

1 Like