elasticsearch-dsl using from and size elasticsearch-dsl using from and size elasticsearch elasticsearch

elasticsearch-dsl using from and size


The answer to this question can be found in their documentation under the Pagination Section of the Search DSL:

Pagination

To specify the from/size parameters, use the Python slicing API:

s = s[10:20]# {"from": 10, "size": 10}

The correct usage of these parameters with the Search DSL is just as you would with a Python list, slicing from the starting index to the end index. The size parameter would be implicitly defined as the end index minus the start index.

Hope this clears things up!


Try to pass from and size params as below:

search = Search(using=elastic_conn, index='my_index'). \        filter("terms", organization_id=org_list). \        extra(from_=10, size=20)result = search.execute()