Advanced search and grammar #1293
Replies: 4 comments 7 replies
-
I think variant 1 is pretty reasonable. For variant 2, I wonder if enough users would take advantage of it for it to be worth the development time. I consider myself a pretty technical user, but I don't think I would ever need something so advanced to search my recipes. If someone has a compelling use-case for that, I'd be happy to work on it though. It seems like a fun challenge. |
Beta Was this translation helpful? Give feedback.
-
For further refeence here some cross-posts: |
Beta Was this translation helpful? Give feedback.
-
Searching by ingredient would be really helpful. Is that something I can open a feature request for, or perhaps a dedicated discussion? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hello, @seyfeb, @MarcelRobitaille, and others,
in #1244 we discussed an internal search bar in the cookbook. I had in my mind an advanced search option here to be implemented. I was thinking of creating some grammar that allows searching very specifically for recipes. In this discussion, I would like to ask you for your thoughts on these ideas and eventually have some feedback on the ideas.
Please note that this is mostly not yet implemented and needs more or even much more implementation work before it can be implemented completely. However, it was nice when we have a clear image in mind of what might be the next steps.
I would like to define prefixes that allow searching specific files of the recipes. So, for example
ingr:apple
oringredient:apple
would look for apple in the ingredients. We have to define the possible prefixes that will be available. What I came up so far:title
desc
ingr
/ingredients
inst
/instruction
tool
tag
category
url
downloaded:bool
true
/false
if recipe was importedJust typing a word in the search would search all categories mentioned.
What is missing is the notion if the text should be matched exactly by word or as part of a word (either
apple
would match bothapples
andpineapple
or it would match neither). This needs to be defined as well. I tend to interpret it as parts of words.Also one could define a structure to search for a fixed string like
"scrambled eggs"
. So, these words must be in fixed relation to be found.Variant 1: prefixes for boolean
To realize simple boolean structures, one can use prefixes similar to the GitHub search. So, for example
-tool:oven
would filter out all recipes that need an oven.The exact syntax needs to be defined here as well. The language that can be described by this approach is rather limited, just basic searches. However, this might be a benefit as people tend to be better with simple structures.
Variant 2: English operators
Alternatively, one could make a complete language out of this by defining the operators
NOT
,AND
, andOR
as well as parentheses. So, the term would be likeingr:apple AND NOT (tool:oven OR keyword:spicy)
.Of course, this can be done with other operators like
&&
and||
as well. The point is that it requires a more logical understanding to build such constructs,Variant 3: Combination
It was in general possible to combine things. Either both grammars are to be accepted or the user can configure the level of experience.
Beta Was this translation helpful? Give feedback.
All reactions