Skip to content

Search filters: date range, relevance order and match count #85

Closed

Description

@neoromantic

tg messages search returns the newest matches first. There is no way to limit them by date or rank them by relevance, and total in the output is the size of the page, not the number of matches.

Proposed:

  • --since and --until: a date, a date and time, or a duration back from now (7d, 24h).
  • --sort date|relevance: date (default) as today; relevance orders by FTS5 bm25, which works on the contentless index (checked on SQLite 3.54.0).
  • --count: also return how many messages match with the same filters. It is a second query, so it is opt-in.

Done when e2e tests on made-up data cover each flag and docs/search.md and docs/cli-commands.md describe them. Related: #80.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions