Russell Reed
Russell Reed

Reputation: 464

How can I see what is happening under the covers when an Elasticsearch query is executed?

For Elasticsearch 1.7.5 (or earlier), how can I see what steps Elasticsearch takes to handle my queries?

I attempted to turn debugging on by setting es.logger.level=DEBUG, but while that produced a fair amount of information at startup and shutdown, it doesn't produce anything when queries are executed. Looking at the source code, apparently most of the debug logging for searches is just for exceptional situations.

I am trying to understand query performance. We're seeing Elasticsearch do way more I/O than we expected, on a very simple term query on an unanalyzed field.

Upvotes: 0

Views: 66

Answers (1)

Val
Val

Reputation: 217274

With ES 1.7.5 and earlier versions, you can use the ?explain=true URL parameter when sending your query and you'll get some more insights into how the score was computed.

Also starting with ES 2.2, there is a new Profile API which you can use to get more insights into timing information while the different query components are being executed. Simply add "profile": true to the search body payload and you're good to go.

Upvotes: 2

Related Questions