Elasticsearch-dsl-py: Support profile api

Created on 11 Sep 2016  路  2Comments  路  Source: elastic/elasticsearch-dsl-py

Details of the profile api on Elasticsearch documentation.

We need the ability to add to a query using dsl-py the profile flag, probably something similar to extra properties and parameters . In addition, the response should hold the profile result.

Most helpful comment

I understand the use case, but it is also supported by the extra method and doesn't require it's own API:

s = Search().query(...)
s = s.extra(profile=True)
response = s.execute()

for shard in response.profile.shards:
    print(shard.id)
    for search in shard.searches:
        for query in search.query:
            print(query.query_type, query.lucene, query.time)

Currently I don't see the need to support this API in a more explicit way. Or is there anything in particular you are missing?

Thank you!

All 2 comments

I understand the use case, but it is also supported by the extra method and doesn't require it's own API:

s = Search().query(...)
s = s.extra(profile=True)
response = s.execute()

for shard in response.profile.shards:
    print(shard.id)
    for search in shard.searches:
        for query in search.query:
            print(query.query_type, query.lucene, query.time)

Currently I don't see the need to support this API in a more explicit way. Or is there anything in particular you are missing?

Thank you!

Cool,
Maybe this kind of example should be on the docs? I am not sure it is trivial.

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zahir-koradia picture zahir-koradia  路  3Comments

SalahAdDin picture SalahAdDin  路  4Comments

primoz-k picture primoz-k  路  4Comments

mortada picture mortada  路  3Comments

MauriJHN picture MauriJHN  路  4Comments