karmi/tire — Issue #158: Pagination using the Tire REST DSL
Author: digitalplaywright
Created: 2011-12-02 20:18:48+00:00
State: open

We need to paginate some queries that require the REST DSL, but have not found a way to do so.

The REST DSL queries are implemented like:
https://github.com/karmi/tire/wiki/Using-elasticsearch-query-DSL-directly-%28or%3A-doing-queries-not-supported-by-the-DSL%29

We tried to paginate by applying the methodology described in the Tire unit tests:
https://github.com/karmi/tire/blob/master/test/integration/active_record_searchable_test.rb#L83

However, this does not seem to work with a query hash (e.g ':query => {"match_all" => {}}') and as far as I know translating the query hash to a query string is not feasible for advanced queries that use geo, facets, filters etc.

Any advice on how to paginate a REST DSL query is greatly appreciated.

Best,
Andy