Attach a label to ES query so that to distinguish between the multiple responses


I am issuing multiple queries (MultiSearch in python Elasticsearch DSL) for ES index and I need a way to set a label 'type' (which could be one of several values) for each query, so that it would be present in the response and I would be able to differentiate between the responses. Just a string or a number would be enough, is it possible to do somehow?

Provided you are using boolean queries, you can provide a term-by-term _name that will be included in your results.

1 Like

I searched on Elasticsearch DSL page and I don't see how to do it there:

I am thinking that maybe it is extra properties section, but not sure:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.