How to remove fields from response

search_month = model.search().query(q_objects)
search_month.aggs.bucket(
        source_month, 'date_histogram', field='date',
        interval=date_ranges[source_month].interval,
    )
response_month = search_month.execute()

Unfortunately, it gives me all data from the model - but how to show only results of aggregations - count of documents ?

Set size parameter to 0.

Unfortunately looks like cannot use size=0 on aggregations with date_histogram. Perhaps its just elasticsearch_dsl python library problem ?

TransportError(400, 'illegal_argument_exception', '[date_histogram] unknown field [size], parser not found')

I don't know this client but my guess is that it should be something like:

.search().query(q_objects).size(0)

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