Ingredients search -- discussion #46
Replies: 3 comments 2 replies
-
|
I have also read that good autocpmpletion is not easy to implement. Do we want to implement our own data structures and algorithms? Because I thinks we should use only already implemented functions because we have a lot of work with other things in our project and it is not the most important thing. We can think about it if we have time later. I also have an idea to mix searching a substring and levenshtein distance because when a phrase is a substring of name of some ingredient, these two substrings can have big Levenshtein distance but from user point of view it is a good match. What do you think? |
Beta Was this translation helpful? Give feedback.
-
|
Yes, let's implement simplified ingredient search in #33. Then we can extend this feature in #48. As to implementing our own data structures/algorithms -- I agree that we shouldn't do that. This is not the point of this course nor project and we don't have much time. |
Beta Was this translation helpful? Give feedback.
-
|
I have some ideas to implement this:
Can't wait to hear what you think! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I think that first we should implement simple searching by name (just checking if the ingredient name includes a phrase that user typed) and later we could improve it. I did some research about searching in postresql and I have an idea but I don't know if it will be fast enough so I think we should test it and if it's not satisfying for us I will think of something else.
The matching ingredients would be we ordered by Levenshtein distance. Also, in your opinion, what distance threshold should we use? In postgresql we can also specify the cost for insertion/deletion/substitution. I think the default value of 1 is good for our needs or maybe we can reduce the cost of deletions/insertions if we want to search the substrings of our ingredients' names. But I don't know if it would work good so we can also test if it makes any sense in practice.
Link to an article about Levenshtein in postgresql:
https://www.postgresql.org/docs/current/fuzzystrmatch.html
Beta Was this translation helpful? Give feedback.
All reactions