Skip to content

hey search: sort by latest activity and a --limit flag #491

Description

@heredia21

Context

We use hey search --in imbox --date last_7_days --json from a scheduled job to find new replies to outbound mail, then read each thread.

No account-specific details below.

What happens

  • Each results page holds a fixed number of threads, and the order is not documented. It does not follow latest activity.
  • After a batch of outbound messages, those threads filled the first page. A reply that arrived minutes later, on an older thread, was not on it, so the job never read it.
  • hey box imbox --limit N --json does return postings ordered by latest activity, with the latest author. We switched to that, but search is the only listing with --from, --date, and --in filters.

Ask

  • hey search --sort latest (and maybe --sort relevance, the current default) so results come back by latest activity.
  • --limit on hey search, matching hey box, instead of fixed-size pages.
  • Document the default order in --help, and include the sort key (for example active_at) in each JSON result.

Why it matters

"What changed since the last run" is the most common automation query. Without a stable sort, a job has to page through everything with --all or risk missing the newest reply.

Related: #446 (sweep filters), #478 (exact match on search).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions