openculinary / backend

The RecipeRadar backend implements data persistence and modeling for the RecipeRadar service
GNU Affero General Public License v3.0
13 stars 0 forks source link

Disambiguate 'red pepper' and 'red pepper flakes' #69

Open jayaddison opened 1 year ago

jayaddison commented 1 year ago

Describe the bug When searching for red pepper as an ingredient, many results that include red pepper flakes are returned, and those results are often irrelevant. It's not possible to filter those irrelevant results out currently, because red pepper flakes is not listed as an ingredient -- so it's not possible to enter it in the "ingredients to exclude" input box.

My understanding is that red pepper flakes are generally made from red chillis, while the term "red pepper" is used to refer to a form of bell pepper.

To Reproduce Steps to reproduce the behavior:

  1. Go to the homepage.
  2. Enter red pepper as an include ingredient.
  3. Observe that red pepper flakes cannot be entered as an exclude ingredient.
  4. Run a search.
  5. Observe that results including red pepper flakes are included in the results.

Expected behavior

Screenshots Here's the current configuration of the red pepper product in the Admin UI:

image

jayaddison commented 1 year ago

Following some recipe recrawling and reindexing to the search engine, the situation is much improved.

The ingredient red pepper flakes has been extracted into a separate ingredient, and is searchable (and excludable) using the ingredient autosuggest input on the homepage.

The reindexing command was:

$ python recipes.py --where 'exists (select * from recipe_ingredients as ri where ri.recipe_id = recipes.id and ri.description ilike "%red pepper flakes%")' --recrawl

A few recipes seem to have failed to recrawl, so I'll keep this issue open until the reason for that is discovered and resolved.