Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a tokenizing filter #117

Merged
merged 2 commits into from
Sep 14, 2020
Merged

Conversation

multimeric
Copy link
Contributor

Instead of the current (confusing) filter behaviour, we instead:

  • Lower case the search string
  • Split it into tokens

Then, each token must be present within the (lowercase) author name, or puzzle title or it is filtered out.

This is a draft PR until I can actually test it (see #116)

Closes #92.

@vercel
Copy link

vercel bot commented Sep 14, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/downforacross/downforacrosscom/795gaqo9x
✅ Preview: https://downforacrosscom-git-fork-tmiguelt-token-search.downforacross1.vercel.app

@stevenhao
Copy link
Member

stevenhao commented Sep 14, 2020

Love this, fully support the idea! You should be able to test this without running a local backend, since filtering is done client-side.

You can also test on the autodeploy links posted by vercel: https://downforacrosscom-git-fork-tmiguelt-token-search.downforacross1.vercel.app.

@multimeric
Copy link
Contributor Author

multimeric commented Sep 14, 2020

You can also test on the autodeploy links posted by vercel: https://downforacrosscom-git-fork-tmiguelt-token-search.downforacross1.vercel.app.

I tried that, but as in the other issue, I'm not able to actually upload puzzles to the site. And the puzzle list is empty, so I can't really test out this behaviour.

@multimeric
Copy link
Contributor Author

And... now they're all visible. I have no idea what was going on there.

@multimeric multimeric marked this pull request as ready for review September 14, 2020 16:38
Copy link
Member

@stevenhao stevenhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@stevenhao
Copy link
Member

image
sweet, going to merge this. maybe a follow-up can be highlighting the parts of the puzzle that matches the search term.

@stevenhao stevenhao merged commit abf58cf into downforacross:master Sep 14, 2020
@multimeric
Copy link
Contributor Author

I suppose there's some argument for supporting search quotes, such that "LA Times" will only return that substring, and not "la" somewhere in the text and "times" somewhere in the text. But it depends on how you want the search to work: as a Google-esque plaintext search that implements features via search syntax, or as a kind of form with lots of fields that you can tweak.

This question also matters for the other thing search is missing: searching by date. Under the plaintext system you might type date:2020-07-22, whereas a form-based search might have a calendar popup for this purpose.

@stevenhao
Copy link
Member

stevenhao commented Sep 14, 2020

Yeah, I like the idea of coming up with a more powerful syntax -- something like gmail's operators.

Another extension would be to hold the filter state (the Size / Status checkboxes) in the search bar itself, so checking & unchecking would just insert/delete search terms.

Another extension would be to persist search state in the url bar, so you can bookmark URLS like "Unsolved Monday Puzzles".

@multimeric
Copy link
Contributor Author

That all seems quite doable. I wonder if there's a React or vanilla JS library that provides a framework for implementing an operator search like this. I can't find one, but admittedly it wouldn't be so hard to do manually.

@multimeric multimeric mentioned this pull request Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow searching by disjoint substrings
2 participants