recipes icon indicating copy to clipboard operation
recipes copied to clipboard

Search function does not search based on recipe title

Open delize opened this issue 1 year ago • 6 comments

Tandoor Version

1.3.3

Setup

Docker / Docker-Compose

Reverse Proxy

SWAG

Other

No response

Bug description

When searching for curry using Tandoor's search function, even though Curry is in the recipe title for various recipes, it results in 0 results.

Screen Shot 2022-09-18 at 19 56 47 Screen Shot 2022-09-18 at 19 56 59

After I add a keyword of curry it returns a result. This should really return results that are also in the title of the recipe.

image
Current Version: [1.3.3](https://github.com/vabene1111/recipes/releases/tag/1.3.3)
Ref: [9ef21241bf93243b2a08b13de86e6b4c4774c594](https://github.com/vabene1111/recipes/commit/9ef21241bf93243b2a08b13de86e6b4c4774c594)

Gunicorn Media: True
Sqlite: False
Debug: False

SERVER_PROTOCOL:HTTP/1.1
REMOTE_ADDR:172.26.0.6
SERVER_PORT:8080

HTTP_REMOTE_USER:firstname
HTTP_REMOTE_GROUPS:admins,dev
HTTP_REMOTE_NAME:firstname lastname
HTTP_REMOTE_EMAIL:[email protected]
HTTP_CONNECTION:close
HTTP_HOST:recipes.domain.org
HTTP_X_FORWARDED_FOR:my.ip.address.here
HTTP_X_FORWARDED_HOST:recipes.domain.org
HTTP_X_FORWARDED_PROTO:https
HTTP_X_FORWARDED_SSL:on
HTTP_X_REAL_IP:my.ip.address.here
HTTP_SEC_CH_UA:"Google Chrome";v="105", "Not)A;Brand";v="8", "Chromium";v="105"
HTTP_ACCEPT:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
HTTP_DNT:1
HTTP_UPGRADE_INSECURE_REQUESTS:1
HTTP_SEC_CH_UA_MOBILE:?0
HTTP_USER_AGENT:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
HTTP_SEC_CH_UA_PLATFORM:"macOS"
HTTP_SEC_FETCH_SITE:same-origin
HTTP_SEC_FETCH_MODE:navigate
HTTP_SEC_FETCH_DEST:empty
HTTP_REFERER:https://recipes.domain.org/view/recipe/42
HTTP_ACCEPT_ENCODING:gzip, deflate, br
HTTP_ACCEPT_LANGUAGE:en-US,en;q=0.9,sv;q=0.8
HTTP_COOKIE:csrftoken=omit; sessionid=sessionid; omit

wsgi.errors:<gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f2d84b4ad40>
wsgi.version:(1, 0)
wsgi.multithread:False
wsgi.multiprocess:False
wsgi.run_once:False
wsgi.file_wrapper:
wsgi.input_terminated:True
wsgi.input:<gunicorn.http.body.Body object at 0x7f2d84b4b9a0>
wsgi.url_scheme:http

Relevant logs

No response

delize avatar Sep 18 '22 18:09 delize

I did see #1990 however, I am not using SQLite based on the troubleshooting output, so filed a different issue. If this is a duplicate of that even when not using SQLite, please close this.

I also noticed that this might affect other things such as the meal planner recipe search as well. Not sure if it all uses the same search logic without digging a bit.

delize avatar Sep 18 '22 18:09 delize

thanks for the report. Your observation is correct, all of these functions use the same search class.

Did you go to the search settings and apply the fuzzy preset? There was a bug thats fixed in 1.3.3, i tought not to many people got corrupted preferences so i did not write a migration but i am slowly thinking that this might not have been the best idea 🙈

EDIT: also thanks for looking at other issues, while this one is similar the other one is a different problem (that i need to fix, thanks for the reminder btw)

vabene1111 avatar Sep 18 '22 19:09 vabene1111

I have not gone into any advanced search settings, I just went through what I would consider is the "standard" of searching, typing something and hitting enter.

It's really strange though - searching some phrases sorta works? image

Garlic is an ingredient and in the steps for the "Instant Pot Butter Chicken" recipe, but searching Chicken does not return that same result. Chicken Thights is an ingredient and Chicken is in the steps.

This is what I have by dropping it down (without modifying anything): image image

delize avatar Sep 18 '22 19:09 delize

Ok, so please try again applying the preset.

The problem was that for some versions the database default for the search settings was wrong. You had one of those versions when you created your user. If you add a new user now or apply the preset for existing ones everything should work again (although I definitely need to work on search again for some other things, the next version for example will increase performance a lot )

vabene1111 avatar Sep 19 '22 04:09 vabene1111

I had the same issue, setting the fuzzy preset fixed it for me. But I had to chose at least one field to make this work. So I chose the title resp. name field.

But shouldn't the name of a recipe be searched out of the box?

thelonelyrider avatar Sep 19 '22 16:09 thelonelyrider

Yes, it should also automatically be set when applying the pre set.

The search setting were implemented in an effort to give the user freedom to choose the search style but I they are confusing and introduced lots of potential for errors, we are working on that, expect to see some major improvements here in the next updates.

vabene1111 avatar Sep 19 '22 19:09 vabene1111