I'm using Elasticsearch DSL and I would like to paginate through the results. To do that, I need to know the total number of results in the search. How should I best do that?
Do I do one search, then execute twice, one generally for the .hits.total and the other sliced for items? Something like this:
response = Link.search().filter("term", run_id=run_id)
total = response.execute().hits.total
links = response[start:end].execute()