Skip to content

Commit

Permalink
updated docs notes for the searchkick and elasticsearch_rails extras
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Mar 9, 2019
1 parent 0ca5539 commit 5bd7c0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/extras/elasticsearch_rails.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This constructor accepts an `Elasticsearch::Model::Response::Response` as the fi
@pagy = Pagy.new_from_elasticsearch_rails(@response, ...)
```

**Notice**: you have to take care of managing all the params manually. If you prefer to manage the pagination automatically, see below.
**Notice**: you have to take care of manually manage all the params for your search, however the method extracts/calculates the `:items`, `:page` and `:count` from the response object, so you don't need to pass that again. If you prefer to manage the pagination automatically, see below.

## Pagy::Search

Expand Down
4 changes: 2 additions & 2 deletions docs/extras/searchkick.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ This extra is composed of 1 file:

## Pagy.new_from_searchkick

This constructor accepts an `Searchkick::Results` as the first argument, plus the usual optional variable hash. It sets the `:items`, `:page` and `:count` pagy variables extracted/calculated out of the `Searchkick::Results` object.
This constructor accepts a `Searchkick::Results` as the first argument, plus the usual optional variable hash. It sets the `:items`, `:page` and `:count` pagy variables extracted/calculated out of the `Searchkick::Results` object.

```ruby
@results = Model.search('*', page: 2; per_page: 10, ...)
@pagy = Pagy.new_from_searchkick(@results, ...)
```

**Notice**: you have to take care of managing all the params manually. If you prefer to manage the pagination automatically, see below.
**Notice**: you have to take care of manually manage all the params for your search, however the method extracts the `:items`, `:page` and `:count` from the results object, so you don't need to pass that again. If you prefer to manage the pagination automatically, see below.

## Pagy::Search

Expand Down

0 comments on commit 5bd7c0a

Please sign in to comment.