Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include recipes of sub-keywords in search #1022

Closed
jpbaril opened this issue Nov 5, 2021 · 8 comments
Closed

Include recipes of sub-keywords in search #1022

jpbaril opened this issue Nov 5, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@jpbaril
Copy link

jpbaril commented Nov 5, 2021

Is your feature request related to a problem? Please describe.
Keywords can be moved under other keywords to create a hierarchy of keywords/categories.
Yet when searching for recipes if I select a top level keyword then the search does not show the recipes that have been categorized with a sub-level keyword of that top level.

Describe the solution you'd like
Selecting a top level keyword should show recipes tagged with that keyword but also with those under it.
Eg. I created that hierarchy:

  • Meat
    -- Beef
    -- Pork
    -- Poultry
    --- Chicken
    --- Duck

Selecting keyword 'Meat' in search should show me all recipes tagged with either: Beef, Pork, Poultry, Chicken, Duck.

@jpbaril jpbaril added the enhancement New feature or request label Nov 5, 2021
@smilerz
Copy link
Collaborator

smilerz commented Nov 5, 2021

@jpbaril if you change the and/or selector to “and” you should get the behavior you expect.

@jpbaril
Copy link
Author

jpbaril commented Nov 5, 2021

@jpbaril if you change the and/or selector to “and” you should get the behavior you expect.

Not really.
I did a test. I checked 'Pork' and 'Poultry'.
The result was that it either only shown my recipes of 'Pork' or shown nothing. Never my Chicken repices were included in the results.

@smilerz
Copy link
Collaborator

smilerz commented Nov 5, 2021

This works for me -
image
image

Can you please confirm that the Chicken keyword (case sensitive) is applied to a recipe and that there are no duplicate keywords.
If that is still true can you enable debug mode and provide the URL of the search (will be in the format of /recipes/api/recipe/?query=&......)

@jpbaril
Copy link
Author

jpbaril commented Nov 7, 2021

Here are the answers in screenshots.
P.S. Boeuf=Beef, Porc=Pork, Volaille=Poultry,Poulet=Chicken,Canard=Duck
Trying to filter Pork and Poultry
All the recipes

@smilerz
Copy link
Collaborator

smilerz commented Nov 7, 2021

Right now having the toggle on "OR" only does search on the selected keyword or food - ignoring children.
When it is toggled to "AND" mode it will search for the keyword and all of its children. This is the intended behavior.

image

In a future release this behavior may become configurable.

@jpbaril
Copy link
Author

jpbaril commented Nov 7, 2021

Oups, I had forgetten to include one screenshot to give you the full range of results.
As previously said, if I instead select "OU" (OR) then nothing show up.
Capture d’écran de 2021-11-07 13-45-04

@smilerz
Copy link
Collaborator

smilerz commented Nov 7, 2021

That’s because you don’t have any recipes that have pork and poultry.

@jpbaril
Copy link
Author

jpbaril commented Nov 7, 2021

I know, I just wanted to include the full picture.
As you said, "Right now having the toggle on "OR" only does search on the selected keyword or food - ignoring children."
I maybe did not explain well in the ticket description, but that's what I would like that the search does: include children keywords.

@smilerz smilerz self-assigned this Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants