Profile Usageedit

Warning

This functionality is experimental and may be changed or removed completely in a future release.

The Profile API provides detailed timing information about the execution of individual components in a query. It gives the user insight into how queries are executed at a low level so that the user can understand why certain queries are slow, and take steps to improve their slow queries.

The output from the Profile API is very verbose, especially for complicated queries executed across many shards. Pretty-printing the response is recommended to help understand the output

See the Elasticsearch documentation on Profile API for more detail.

Fluent DSL exampleedit

s => s
.Profile()
.Query(q => q
    .Term(p => p.Name, "elasticsearch")
)

Object Initializer syntax exampleedit

new SearchRequest<Project>
{
    Profile = true,
    Query = new TermQuery
    {
        Field = "name",
        Value = "elasticsearch"
    }
}

Example json output. 

{
  "profile": true,
  "query": {
    "term": {
      "name": {
        "value": "elasticsearch"
      }
    }
  }
}