nmsu-cs / project-penguin-byte-java-squad

project-penguin-byte-java-squad created by GitHub Classroom
0 stars 0 forks source link

Incorrect allergen filtering. #23

Closed DouglasJack closed 5 months ago

DouglasJack commented 5 months ago

Andrew's current implementation of filtering out allergens works, however it prunes results after the query responds. Meaning the results are limited in results. This means the only way to get 10 results per page is to run the query, filter results, then count the number of results and if its less than 10 results, then run another query recursively. Severely impacting SQL performance with a potential for ∞ attempts to the SQL DB.

The way to fix this is simply append a NOT LIKE "%ex%" to the end of every where clause in the search query.

fosesqno commented 5 months ago

Filtering now filters in the query itself, so we are pulling the normal number of recipes rather than only displaying few.