Skip to content

Conversation

@newperson1746
Copy link

Summary
Fix the bug in the recipe search functionality where the <= "lte" rating filter was incorrectly applying >= "gte".

Detailed description
As seen in #4280, searching for recipes with a rating of 3 stars or less would return results for those of 3 stars or more instead. This is incorrect.

The rating filter is defined in cookbook/helper/recipe_search.py and the query being run for the "lte" filter was actually the same as the "gte" filter. This fixes the issue. Also re-enable a commented test case that was failing but now passes with this fix, expanding the comment explaining how the test works. This test covers all of the rating filters.

File changes:
cookbook/helper/recipe_search.py

  • rating_filter method: correct self._rating_lte case

cookbook/tests/other/test_recipe_full_text_search.py

  • test_search_count: uncomment the test case for the "lte=3" filter and explain why it works

Fixes #4280

The rating filter for lte (<=) was incorrectly using gte instead.
This should fix TandoorRecipes#4280
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Search by Rating (<=) results incorrect

1 participant