We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents eb473d4 + f0db4bd commit 5a2d2b2Copy full SHA for 5a2d2b2
README.md
@@ -229,6 +229,23 @@ Typesense.configuration = {
229
}
230
```
231
232
+### Pagination & Search in a controller with Pagy
233
+
234
+```ruby
235
+class ProductsController < ApplicationController
236
+ def index
237
+ # If `params[:q]` is blank, Typesense will automatically use "*" to return all documents
238
+ @pagy, @products = Product.search(params[:q], "name,description")
239
+ end
240
+end
241
+```
242
243
+```erb
244
+<h1>Search results for <%= params[:q] %></h1>
245
+<%= render @products %>
246
+<%== pagy_nav(@pagy) if @pagy.pages > 1 %>
247
248
249
## Testing
250
251
To run the test suite:
0 commit comments