Jacob-Griffin / TelephonePictionary2.0

New version of blowyourfaceoff.com using more modern web technology than php and raw javascript
0 stars 0 forks source link

Search Functionality #3

Closed Jacob-Griffin closed 1 month ago

Jacob-Griffin commented 1 year ago

Search feature

Not critical to the core functionality, but it would be regression from the existing game not to include this.

Jacob-Griffin commented 6 months ago

I had a thought on this: Do we even want to expose searching all games to the public? I was considering that not everyone might want the content of their games shared publicly, and I'm not sure it's worth creating a mark as private ui/check/system. Maybe we can make something internal?

Jacob-Griffin commented 4 months ago

Looked into this even more: Turns out, NoSQL databases are bad at fullText search, and this isn't really feasible with firebase. Firebase documentation even recommends using 3rd party services to index and search for text, so I think it's safe to say that this is a freezer topic. If the need becomes pressing, we can look into this more

Jacob-Griffin commented 3 months ago

Turns out the specific integration of Algolia with Firebase is not expensive and interfaces fairly directly, so searching may be feasible. As of now, I've figured out how to add index updates on game finish. The steps to come: Indexing / Privacy

Search

Jacob-Griffin commented 3 months ago

Implemented a search results page, which has a search bar, a search button, pulls up results with which stack they were from and which words matched the search. Clicking on a result sends you to the review page for that game, and if there was only one stack with the searched text, routes you to that stack specifically.

Doing this though... Coming across the doubts that we really want to allow people to search anybody's stack again. I would like it if we could make it so we can only search games you've been in, but we don't really have a good way of doing that. Maybe we require that the search comes with a username that participated in that game? For our uses, we can just say 'Jacob', since I always use that name?

Jacob-Griffin commented 3 months ago

Actually feeling pretty decent about it now. Implemented that second idea.

'Search As' is a setting in the settings window that determines who "you" are in regards to search. It doesn't have to actually be you, it just has to indicate you know who's games to search for.

On the search tab: If 'Search As' is not set, the search button is disabled, and the user is informed that 'Search As' must be set in the settings window to enable search, due to privacy reasons.

In the case of 'Search As' already being set (and it should carry over across sessions as a set-it-and-forget it), there will be no further prompting. The search page is very lean: Search bar, search button, "Searching as [name]", then the section for the results.

Jacob-Griffin commented 1 month ago

The requirement to use a username from the game seemed a bit disappointing, but considered reasonable. I think as a feature this is done, but I'll open a new issue to handle some other search keying strategies, since I do care about not just digging around the games of people you haven't met

Jacob-Griffin commented 1 month ago

With #41 open, closing this