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

Search seems broken? #2645

Open
develroo opened this issue Jan 28, 2025 · 6 comments
Open

Search seems broken? #2645

develroo opened this issue Jan 28, 2025 · 6 comments
Labels
bug Something isn't working investigation-required The Issue or PR needs more in-depth analysis stalebot-enabled The PR/issue is marked to go stale over time

Comments

@develroo
Copy link

Description

When searching via the search options, the results are rather erratic. Recipes appear which have nothing to do with the search term.

Reproduction

I have nearly 400 recipes added now, and the problem seems to get progressively worse.

Expected behavior

Search terms should be more accurate and not add spurious recipes.

Screenshots

Here are some examples.

Image

Image

Image

Browser
Firefox 134.02

Versions
Nextcloud server version: Hub 9 (30.0.5)
Cookbook version: 0.11.2
Database system: PostgreSQL

@develroo develroo added the bug Something isn't working label Jan 28, 2025
@christianlupus
Copy link
Collaborator

From looking at your screenshots, I guess 1/2 to 3/4 of the results are explainable (e.g. most pizza results have the word pizza in the title). Others I find suspicious but I cannot tell exactly. The search will look at various fields of the recipe and not all are directly visible in the overview.

Could you please take one recipe that you think is not matching to a search term and open it. Then check if you find the search term anywhere on the screen (you might be able to use browser search but not sure about this). If you cannot find it, you might go to the recipe's folder in the files app. There is a JSON file. Could you share that with me *rename it to .txt for Github to accept it)?

Chris

@christianlupus christianlupus added stalebot-enabled The PR/issue is marked to go stale over time investigation-required The Issue or PR needs more in-depth analysis labels Jan 29, 2025
@develroo
Copy link
Author

Well, the most obvious one seems to be the Elizabeth Sponge cake one when search for pizza.

Here is the json for it.

cat recipe.json 
{
    "@context": "http://schema.org",
    "@type": "Recipe",
    "name": "Elizabeth sponge cake",
    "author": {
        "@type": "Person",
        "name": "Unknown Author"
    },
    "description": "",
    "datePublished": "2024-11-26T14:28:33.551166+00:00",
    "image": "recipes/elizabeth_sponge_cake/full.jpg",
    "video": {
        "name": "Elizabeth sponge cake",
        "description": "",
        "uploadDate": "2024-11-26T14:28:33.551180+00:00",
        "thumbnailUrl": "https://img.youtube.com/vi/LIHJ8TBoTps/hqdefault.jpg",
        "embedUrl": "",
        "contentUrl": ""
    },
    "recipeYield": "Unknown",
    "prepTime": "PT0H0M0S",
    "cookTime": "PT0H0M0S",
    "totalTime": "PT30M",
    "recipeIngredient": [
        "The Sponge:",
        "200g / 7oz softened Butter (room temperature)",
        "200g / 7oz Caster Sugar",
        "250g / 9oz Self Raising Flour / if you use All Purpose or Plain flour add an extra 8g / 2tsps of baking powder to the recipe.",
        "5 Medium or 4 Large Eggs (room temperature)",
        "8g / 2tsps Baking Powder",
        "6mls / 1tsp Vanilla Extract",
        "The Filling:",
        "200mls of Double or heavy whipping Cream",
        "6g /1\u00bdtsp Icing or Powdered Sugar",
        "6mls / 1tsp Vanilla Extract",
        "Mixed Fresh fruit, such as Strawberries, blueberries, raspberries, even sliced peaches",
        "Powdered / Icing Sugar for dusting",
        "20g Sugar / 20mls hot water: for glazing"
    ],
    "recipeInstructions": [
        "Begin the recipe by preheating your oven to 180\u00b0C / 355\u00b0F Gas mark 4.",
        "Grease two 20cm / 8\u201d sandwich cake tins, and line the bottoms with greaseproof/parchment paper.",
        "Add the butter and caster sugar to a bowl, and cream together using a spatula to a smooth light in colour paste.",
        "Whisk in the eggs 1 at a time (make sure your eggs are at room temperature).",
        "Add the vanilla extract and mix in.",
        "Sift in the flour and baking powder and gently fold it into batter using a spatula.",
        "Divide the batter equally into the 2 cake tins and get them into the preheated oven and set your timer for 25 minutes.",
        "While the sponge is baking, start the Chantilly cream, by adding the double or heavy whipping cream, vanilla extract and icing sugar to a bowl, and whisk until thick, refrigerate until needed.",
        "Cut your fruit into a suitable size for the filling, see video for example.",
        "Check the cakes after the timer goes off (do not open the oven door before) use a cocktail stick to test in the cake is done, if it comes out clean, the cake is done, if not give it a couple of more minutes.",
        "Place the tins on a wire rack for 5 minutes before removing them from the tins, after the 5 minutes remove from the tins and gently peel off the paper and allow to properly cool for a further 15 minutes.",
        "Place one of the sponges on a serving plate topside down.",
        "Spread half of the whipped cream over the surface of the sponge, staying shy of the edges, cover the cream with the cut fruit, then spread the rest of the cream over the fruit.",
        "Place the top sponge on the cream layer, top side up this time, and line it up with bottom one, gently press it down.",
        "Dust the top of the cake with icing or powdered sugar, then decorate the centre with more fruit in the.",
        "Brush the fruit with the glazing liquid (see filling ingredient list above)",
        "Your Queen Elizabeth jubilee sponge cake is now ready to slice and serve.",
        "Enjoy."
    ],
    "recipeCategory": "Unknown",
    "recipeCuisine": [
        "Unknown"
    ],
    "keywords": "",
    "id": "",
    "dateCreated": "2024-11-26T14:28:33.551185+00:00",
    "dateModified": "2024-11-26T14:28:33.551187+00:00",
    "tool": [],
    "url": "https://profoodhomemade.com/elizabeth-sponge-cake/",
    "nutrition": []
}

@seyfeb
Copy link
Collaborator

seyfeb commented Jan 30, 2025

I find none of the results suspicious when looking only at the recipe names (iirc, the filtering only matches the name atm.).

It's performing a fuzzy search and although "Elizabeth sponge cake" might be the farthest away on the first glance (depending on your measure of distance) there is iza in the name, which is pretty close to pizza. What might be debatable is, if they are ordered correctly.

I'm not saying it's perfect and the fuzzy search can be tuned but I found that it's not that easy to find a perfect balance between accepting typos when searching and showing too many unintended results. And there are certainly different opinions on what is "perfect" anyway ;)

@develroo
Copy link
Author

Hmmm seems a stretch. but ok.

What about 'corner' and Rustic Country Loaf?

This is its json.

{
    "@context": "http://schema.org",
    "@type": "Recipe",
    "name": "Rustic country loaf",
    "author": {
        "@type": "Person",
        "name": "Unknown Author"
    },
    "description": "",
    "datePublished": "2024-11-26T14:27:32.880666+00:00",
    "image": "recipes/rustic_country_loaf/full.jpg",
    "video": {
        "name": "Rustic country loaf",
        "description": "",
        "uploadDate": "2024-11-26T14:27:32.880681+00:00",
        "thumbnailUrl": "https://img.youtube.com/vi/2OqooYnE3kE/hqdefault.jpg",
        "embedUrl": "",
        "contentUrl": ""
    },
    "recipeYield": "Unknown",
    "prepTime": "PT0H0M0S",
    "cookTime": "PT0H0M0S",
    "totalTime": "PT3H40M",
    "recipeIngredient": [
        "550g / 19\u00bdoz Strong white bread flour",
        "330g / 330mls Lukewarm water / 40\u00b0C / 104\u00b0F",
        "6g / 1tsp Sugar",
        "7g / 2tsp Instant or active dried yeast",
        "8g / 1tsp Salt"
    ],
    "recipeInstructions": [
        "Add the sugar and yeast to the warm water, mix well and allow the yeast to activate for 10 minutes.",
        "Once active, add your yeast mixture to a large bowl.",
        "Add the flour and the salt to the liquid, and thoroughly mix together, until there are no dry pockets of flour left in the dough.",
        "Lift the dough out of the bowl, and grease the bowl with a little cooking oil, place the dough back in the bowl, and coat it with the oil, cover the bowl, and allow it to proof for 1 hour in a warm draft-free spot.",
        "After the 1stproof, turn out the dough onto a flour free surface, knock it back, form it into a ball, get it back in the bowl, and proof for a 2ndtime, for 40 minutes.",
        "Grease a large baking tray.",
        "After the 40 minutes, turn out the dough, and knock it back once more, form it into a ball, place the doughball in the centre of the baking tray, lightly flour the dough, cover it with a lightweight dry cloth, and allow it to rise in a warm spot for 45 minutes.",
        "See the video for the proofing basket method.",
        "When there is only about 10 minutes left on the final proof, preheat your oven to 190\u00b0C / 375\u00b0F / Gas mark 5, also place a pan of hot water on the bottom shelf of the oven, the steam produced, will make the bread crispy.",
        "Once the dough has fully risen, give it a couple slashes with a very sharp bakers lame, place it in the preheated oven, and set your timer for 25 to 40 minutes, depending on how light or dark you prefer your crust.",
        "After the time is up, remove it from the oven and onto a wire rack for at least 20 minutes to cool.",
        "Slice and serve while still warm, with lots of butter.",
        "Enjoy."
    ],
    "recipeCategory": "Unknown",
    "recipeCuisine": [
        "Unknown"
    ],
    "keywords": "",
    "id": "",
    "dateCreated": "2024-11-26T14:27:32.880685+00:00",
    "dateModified": "2024-11-26T14:27:32.880688+00:00",
    "tool": [],
    "url": "https://profoodhomemade.com/rustic-country-loaf/",
    "nutrition": []
}

@seyfeb
Copy link
Collaborator

seyfeb commented Feb 1, 2025

I'm not saying it's perfect, but it's hard to get right. The loaf recipe is indeed quite far away from "corner".
We are using a third-party implementation for this. I'd be happy if you gave it a shot and are able to improve the search 🚀

@kitchen666
Copy link

Posting to second this. Search regularly returns items that have nothing obvious to do with the recipe's name, description, ingredients, or steps. The UI uses the term "filter" for the name search and I feel most people expect that to mean we are looking at the recipe's name as the field for our filter. There's no indication in the UI that this is a "fuzzy" search of some kind that might look at other parts of the recipe or try to make assumptions about what we are looking for, and I've been struggling wondering if something was broken in my install. In a large recipe collection this often make the search results useless with just screen-fulls of results that aren't relevant to my term.

OTOH Nextcloud's unified search seems to do an OK job with recipe name searches, albeit a bit slow and without the neat filtering that Recipes has (Which I do like a lot).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigation-required The Issue or PR needs more in-depth analysis stalebot-enabled The PR/issue is marked to go stale over time
Projects
None yet
Development

No branches or pull requests

4 participants