Repository navigation
feat(search): add tag, author, URL, date window and page filters - #6
Merged
Merged
Conversation
The Algolia API supports all of these, but `hn search` could only reach keywords, a start date and a points floor. Agents had to drop to raw API calls for common questions such as "what did this person say about X" or "has this URL been discussed". The query becomes optional so filters alone can browse. `--min-points N` now includes N, as its name says.
Owner
|
These all map straight onto filters Algolia already supports, so they cost almost nothing to carry. Making the query optional turns One edge worth knowing: |
Owner
|
This shipped in v0.3.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hn searchreached keywords, a start date and a points floor. Everything else meant raw API calls, even though Algolia supports it. This adds:--tag:show_hn,ask_hn,front_page--by USERNAME--before DATE, so a date range works--url, which matches story URLs only.github.com/voskagives 27 hits this way and 57 without it--pageThe query is now optional, so
hn search --tag show_hn --min-points 100 --sort datebrowses with filters alone. That also covers most of #1.--min-points Nnow includes N. It sentpoints>N, which contradicted the flag's name.Result counts without a query are Algolia estimates.
--tag show_hnreported about 2M with relevance sort and 514k with--sort date, but the hits I sampled were all Show HN posts.Checked with
make test,golangci-lint, and live runs of each README example.