Open lortza opened 1 year ago
Some notes from @mikevallano on full-text search in postgres:
This post explains the need for it: https://www.compose.com/articles/mastering-postgresql-tools-full-text-search-and-phrase-search/
Here's a good post on implementing a solution: https://www.viget.com/articles/implementing-full-text-search-in-rails-with-postgres/
This is the gem: https://github.com/Casecommons/pg_search
Thoughtbot post with good info and tips for performance: https://thoughtbot.com/blog/optimizing-full-text-search-with-postgres-tsvector-columns-and-triggers
Gem for triggers: https://github.com/jenseng/hair_trigger
Here's my tiltid app using it in a model: https://github.com/mikevallano/tiltid/blob/master/app/models/til_log.rb
The Feature
I'd like to be able to search within movies that I've seen, passing it optional arguments and returning a tiled list of movies (like the existing behavior for other searches) or perhaps a table view in chronological order by
date_watched
.The Problem
I want this feature because I'd been wracking my brain to remember a Christmas Hallmark/Lifetime movie that I watched in my hotel room in Columbus, OH, very specifically between 2018-12-05 and 2018-12-15 and I knew it had something to do with Louisiana because it made me feel happy, having moved away from New Orleans only 6 months prior. Four years later, my best guesses + googling efforts to find this movie led us to watching this atrocity
which was terrible and not in the good kind of way like the absurd A Very Nutty Christmas.
After a query in the production database (always the best way to solve your UX problems, no? 😆 ), I got my answer.
I was able to confirm that this is indeed the movie I had been trying to recall:
Huzzah! Joy to the world, I've located a Christmas RomCom that I will probably watch this weekend.
Implementation Ideas
Our existing Advanced Search is designed to find movies based on details about the movie and related actors. The search I am proposing is also interested in details about the current user's screenings.
I am not sure if we want to add complexity to this search page or if we want to make a new page entirely. And honestly, having this table view from the production database was very helpful as I played with the query and narrowed my search:
So I'm not really sure if a tiled view will be as useful if the user really does want to see those details.
I think it will require a little tinkering (technical discovery 😉 ) before we decide which direction to go. But this query handles all of my concerns for this new feature: