Elasticsearch-dsl-py: How to set source filtering in query?

Created on 30 Jan 2015  路  2Comments  路  Source: elastic/elasticsearch-dsl-py

I would like to set the source filter. Is this feature supported by the DSL? If not, would you add this?

Most helpful comment

Currently it is not supported directly. You can, however, use the extra method:

s = Search()
s = s.extra(_source={'include': ['title', 'body']})

I am not sure this is super useful to add as a separate method since it can be done this easily, but if more people request it I will add it.

Hope this helps.

All 2 comments

Currently it is not supported directly. You can, however, use the extra method:

s = Search()
s = s.extra(_source={'include': ['title', 'body']})

I am not sure this is super useful to add as a separate method since it can be done this easily, but if more people request it I will add it.

Hope this helps.

Thanks for the answer. I will use .extra().

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mortada picture mortada  路  3Comments

beanaroo picture beanaroo  路  4Comments

quasiben picture quasiben  路  4Comments

amih90 picture amih90  路  4Comments

SalahAdDin picture SalahAdDin  路  4Comments