-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
d03e570
to
884b35a
Compare
Possible improvements (optional):
p.s. I know this is quite a lot of stuff to add/change + the branch already looks fairly complex and most of it's existing stuff that needed fixing. |
To briefly explain how this searching works. When a new recipe is made a cloud function is run which updates the Algolia database with the new recipe details. Then when searching for a query the string (together with any filters) is passed directly to Algolia which returns a JSON file with the results. This file is then traversed to find the UUID of the recipes which is then passed into a method that gets the recipe document which intern is past to the original display mechanism which Louis wrote when first writing the search. Using Algolia instead of queries with firebase allows us so much more customisation with our results and ranking methods, instead of 30 lines of code its 1. We can also limit on Algolia the number of results it returns without even going into the code for the app. Algolia has 3 (or so) indexes for recipes each for the custom rankings together with a google style ranking system that we don’t use. Stuff like author searching is out of the remit of this original user story which was to fix the two issues for searching. If other stuff thats not related to those stories needs doing then they should end up on a new branch so this doesn’t become stale. This branch is only 24 hours old and was one commit off the master making it easy to merge. As soon as we add extra stuff we should be branching because its a different feature. Bugs 🐛
|
Here is full documentation on it: https://www.algolia.com/doc/api-client/getting-started/what-is-the-api-client/android/ |
HomeTest.java is the espresso test originally written for this search |
app/src/main/java/com/group4sweng/scranplan/SearchFunctions/SearchListFragment.java
Show resolved
Hide resolved
Thanks for the clarity about how the whole system works. That’s really handy to help understand what we can and can’t do with Algolia. If we can’t implement input checks in Algolia (we probably can) the kitchen sink way would be to check if any character of number exists in the input and the input is greater than a certain string length. (2 in this case) Literally just compare to a list of all available characters and numbers in English. That would fix 3 issues immediately. This method would be useful to add as a test as I think a lot of what we get marked on is good tests for this module. So the no more results found removal is so that if recipes are retrieved successfully we don’t need to display it. Only when no recipe is found at all. Not sure if you skipped the main bug but you need to add a check at what I think was the ‘Index scoreIndex’ for a null object reference that returns from the search safely or fix the error altogether otherwise occasionally the search query will crash the app. Assuming this is already being worked on and tested. |
Done |
Search is fully functional with Algolia