You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"
The text was updated successfully, but these errors were encountered:
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".
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"
The text was updated successfully, but these errors were encountered: