Search and Pagination
The Python client can page through search results and load the full entity for each hit withpaginate_es().
Supported Entities
Besides the existing entity types, the client supports:- DataProduct: Data products, searched in
data_product_search_index. - Page: Context Center articles, searched in
knowledge_page_search_index.
Paginate Search Results
Pass the entity class topaginate_es() to iterate over every matching entity. The following example prints the fully qualified name of each data product.
entity: The entity class to page through, for exampleDataProductorPage.size: The number of hits per page. The default is100.query_filter: An optional search filter in JSON format.search_query: An optional query string to filter results.fields: An optional list of fields to load for each entity.sort_fieldandsort_order: The sort used to page. The defaults arefullyQualifiedNameanddesc.
SearchCursorStalledError
paginate_es() raises SearchCursorStalledError when the search index cannot sort on the id field that the server uses to move between pages. The error names the index and says Reindex it. It is raised before any page is returned, so a run never processes the same entity twice.