Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search API limited to 10 results #251

Closed
stefanmedack opened this issue Sep 26, 2017 · 3 comments
Closed

Search API limited to 10 results #251

stefanmedack opened this issue Sep 26, 2017 · 3 comments
Labels

Comments

@stefanmedack
Copy link
Contributor

stefanmedack commented Sep 26, 2017

Hey there,

thanks for providing the search API publicly, I was really looking forward to it. Sadly, it only provides a maximum of 10 items at the moment and is not pageable.
Is it possible to provide more search results or have the result set delivered in multiple pages?

@dedeibel
Copy link
Contributor

Hi, the API uses rails api-pagination and should support it. Have you looked into the headers or tried the page parameter?

See https://github.com/davidcelis/api-pagination/blob/master/README.md

@dedeibel
Copy link
Contributor

If it does not work, please tell us of course.

@manno
Copy link
Member

manno commented Sep 26, 2017

Hm I think we have a bug there, pagination is never used because we only get 10 results...

curl -v -H "CONTENT-TYPE: application/json" 'https://media.ccc.de/public/events/search?q=fnord?page=2' | jq '.events[] | .slug'

It seems to work for the HTML search forms, but how do we set up elasticsearch, kaminari to work with api-pagination?
Should we pass something like size=unlimited to the ES query and have api-pagination take care of the result? Is there a way to pass the same query (page, size) to both ES and pagination, to get only the required data?

@manno manno reopened this Sep 26, 2017
manno added a commit that referenced this issue Sep 26, 2017
Also move kaminari gem in front of elasticsearch, because it's
mentioned in the elasticsearch-model README
@manno manno added the bug label Sep 26, 2017
manno added a commit that referenced this issue Sep 26, 2017
Also move kaminari gem in front of elasticsearch, because it's
mentioned in the elasticsearch-model README
manno added a commit that referenced this issue Sep 26, 2017
* does this work with api pagination?
@manno manno closed this as completed in 42c6ffb Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants