gthole / drink-stash

A simple web app for saving and searching cocktail recipes.
MIT License
10 stars 1 forks source link

Drinks Recommendation Engine #6

Open gthole opened 5 years ago

gthole commented 5 years ago
gthole commented 5 years ago

@jelloeggy I added a new operator to the search syntax as a first step on this: LIKE list = favorites, which will find all the recipes that are similar to the ones in a given list (ie have the same or interchangeable ingredients, but possibly different bitters and things) and excludes the recipes that are actually in the list.

On the home page, I changed the "Discover" button to do that search on the user's favorites list instead of the "liquor cabinet" functionality that it had been. So it gets more interesting as you add recipes to your favorites.

You can also use the search syntax to query for other things "LIKE craigie on main" or "LIKE tiki", which will find all the drinks that are similar to those searches but don't exactly match the search. (It does slightly strange things when you do "LIKE ", because you're simultaneously filtering and excluding that ingredient.)

Thoughts?

jelloeggy commented 5 years ago

Ooo excited to try this! I assume Like works with any list but discover just uses your Favorites?

On Sat, Apr 6, 2019, 11:08 Greg Thole notifications@github.com wrote:

@jelloeggy https://github.com/jelloeggy I added a new operator to the search syntax as a first step on this: LIKE list = favorites, which will find all the recipes that are similar to the ones in a given list (ie have the same or interchangeable ingredients, but possibly different bitters and things) and excludes the recipes that are actually in the list.

On the home page, I changed the "Discover" button to do that search on the user's favorites list instead of the "liquor cabinet" functionality that it had been. So it gets more interesting as you add recipes to your favorites.

You can also use the search syntax to query for other things "LIKE craigie on main" or "LIKE tiki", which will find all the drinks that are similar to those searches but don't exactly match the search. (It does slightly strange things when you do "LIKE ", because you're simultaneously filtering and excluding that ingredient.)

Thoughts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gthole/drink-stash/issues/6#issuecomment-480511449, or mute the thread https://github.com/notifications/unsubscribe-auth/Aq7rTd6deoxzfrZGdt459ldJqDNagoo6ks5veLhbgaJpZM4XavWE .

gthole commented 5 years ago

I've been really enjoying it!

Discover just uses favorites for now. It's editable in the url, but I plan to add a select box or something to make it easier. That view really's just a glorified "I'm Feeling Lucky" button. I think the LIKE operator is a lot more useful in the recipes list, and figuring out the search/filter interface to make it more accessible there is something that needs a lot of thought.

jelloeggy commented 5 years ago

I am very excited to use the Discover feature. My first foray into it (well, just hitting the button, not trying the drink) has been very exciting. But I'm not sure I understand the LIKE operator. Does it only work with lists? I tried "LIKE prosecco" or "LIKE sparkling" and didn't find anything.

gthole commented 5 years ago

Yep it's weird. LIKE <ingredient> doesn't make much sense as a search because you're saying "give me all the things that have this ingredient, but then exclude all the things that have that ingredient." Since LIKE excludes everything that was in the original search.

It's primarily meant to work with lists, but can also work with description terms. I originally thought I'd make it only work for lists, but I got a little carried away with building the search syntax grammar to support combiners and nested queries and stuff. (Still need to teach it parenthetical precedence, though. :grawesome:)

jelloeggy commented 5 years ago

Hmm maybe I need a little cheatsheet on the correct syntax to try out. I just tried LIKE list="Fancy as F*ck" but that didn't work. Ah, without the quotes it worked. LIKE list = Porch Time didn't return anything though.

I'll keep playing. I love the idea of it.