-
Notifications
You must be signed in to change notification settings - Fork 10
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
Image search by keywords [4 days] #2
Comments
Implementation planning for backend
est 4.hrs |
👍 |
Paginated API:RequestExample:
Response{
data: [{ id: 1, ... }, { id: 2, ... }],
page_info: {
has_next_page: true,
has_prev_page: true,
start_cursor: '{base64 encoded string}',
end_cursor: '{base64 encoded string}',
}
} Cursor:For search result cursor should contain result index for SQL |
The above paginate API is inspired by https://facebook.github.io/relay/graphql/connections.htm#sec-undefined.PageInfo Main objective to adopt cursor base API is to avoid back-end sorting knowledge leaked to front-end. Example usage
i.e. the cursor is just a string for front-end. It should contain all information that backend required to query next page. An initial list of info contains in the payload
later may can have more condition, like exlcuding, like count limit, etc. But still the front-end scrolling don't need the knowledge what is inside the cursor. |
Or could use this format https://developers.facebook.com/docs/graph-api/using-graph-api/#cursors {
"data": [],
"paging": {
"cursors": {
"after": "MTAxNTExOTQ1MjAwNzI5NDE=",
"before": "NDMyNzQyODI3OTQw"
},
"previous": "https://graph.facebook.com/me/albums?limit=25&before=NDMyNzQyODI3OTQw",
"next": "https://graph.facebook.com/me/albums?limit=25&after=MTAxNTExOTQ1MjAwNzI5NDE="
}
} |
Need #1
Needed by #7
Support search by keywords / partial keywords (case insensitive)
Support search by partial uploader name, case insensitive
Paginated API that returns 15 images at a time
API Status code / property that tells the client application it's the end page
property that tells the client application how many results were returned by the query
return basic metadata for each images (profile image link, uploader username, like count)
keywords must be 2 - 64 characters, support unicode characters
Error message:
The keyword you entered is too long. Please try again with a keyword that's less than 64 characters long
Shows loading indicator
Shows end page indicator when no more results are returned
Do not allow user to search with empty query
order image by like count and upload time - if 2 images have the same like count, the one uploaded last will be shown first
Created from Aha! https://oursky.aha.io/features/PUT-3
The text was updated successfully, but these errors were encountered: