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

Handle HTTP request to searchItems #1

Open
EmadAghaei opened this issue Apr 17, 2019 · 1 comment
Open

Handle HTTP request to searchItems #1

EmadAghaei opened this issue Apr 17, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@EmadAghaei
Copy link
Member

EmadAghaei commented Apr 17, 2019

This HTTP request should handle a logic like a situation we are searching for an item in an online store. The handler searches an item(s) among items in the database. It gets information of a user (userId) and 'criteria' for searching, then the handler returns a list of items that match with the 'criteria'. The criteria can be every string like name, description, or category of the item, so it has to search for all possible values of items. Since the handler wants to return best match results, at the first the handler searches among all names of all items if it could not find a match then go through matching among a description of items, if it could not find a match in description go through search among categories of all items in the store. It is possible that the user wants to only view items and does not login into the online store (in this case 'userId' is empty or null, it does not need to be check for validity), so the handler does not have the information about the user, but when the user logged in the system and tried to search items, the handler should store a log object from the items that the user searched for future recommendations. If any of the input arguments are empty or null, a 400 response should be returned with a description. The handler may make use of a 3rd party persistence library.

Important notes: the endpoint address is "/searchItems". The URL query parameters are: "userId" , "criteria"

@EmadAghaei EmadAghaei added the enhancement New feature or request label Apr 17, 2019
@Microtasking Microtasking changed the title Implement a new HTTP request, searchItems Handle HTTP request to searchItems Sep 17, 2019
@EmadAghaei EmadAghaei reopened this Nov 12, 2019
@EmadAghaei
Copy link
Member Author

I am trying to tackle the issue. When userId is not empty or null, the request asks to store a log object for future recommendation. Currently, there is no such log object defined to serve search criteria, the only log object has field "itemId", so I suppose it is designed for actions toward a single item. My question is shall I add a new log object for this purpose, or shall I reuse the current log object. For now, I will skip this particular requirement, and implement a user unaware version of "searchItems".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant