Please suggest a more informative title to this question.
I want to match a recipe based on a provided array of ingredients. If i provide the array ['tomato', celery]
, I want to match all recipes which has an ingredient whose name contains 'tomato' AND has an ingredient whose name contains 'celery'.
Today I use the following query:
MATCH (recipe:Recipe)
WHERE ALL(
ingredient IN ['tomato', 'celery']
WHERE (recipe)-[:CONTAINS_INGREDIENT]->(:Ingredient {name: ingredient})
)
RETURN recipe
This works, provided that the ingredients name is an exact match, but I would like it to match as long as the ingredient name CONTAINS the passed term (i.e. 'Yellow Tomatoes' would match 'tomato'), but I don't see any way to incorporate the CONTAIN
keyword into this query.
Is what I'm trying to do possible?