-
Notifications
You must be signed in to change notification settings - Fork 49
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
API search for facility and pagination #921
Comments
Hi everyone, Not sure, but I think we need to modify this part: Using the same approach for placename i.e: Let me know if I can do something to help |
hi @dickoa |
Just to be sure that we are saying the same thing, shoudl this be sufficient ? elif search_type == "facility":
facilities = Locality.objects.filter(name__icontains=place_name)
if self.page:
facilities = self.get_query_by_page(facilities, self.page)
else:
facilities = facilities[:100]
facilities = self.query_to_json(facilities, self.format)
return self.api_response(facilities) If yes I can add it ASAP. |
Hi everyone,
Thanks again for the healthsites project, we really love it at HDX.
I was testing the API and how to search for healthsites by name or placename and found something odd.
When you search by placename the page parameter works well and you have 100 healthsites (or less) per page as documented.
However, when you search healthsites by name, it looks like the pagination doesn't work. For example, this query gives all the healthsites with "chu" in their name (689 healthsites as of 25th April 2017)
https://healthsites.io/api/v1/healthsites/search?search_type=facility&name=CHU&format=json&page=1
I also want to add that it would be great if we can have the number of page in the metadata, a kind of summary or a limit parameter to control the number of healthsites we want per page. I think it is quite related to #920
Thanks again and let me know how I can help
Best,
The text was updated successfully, but these errors were encountered: