Skip to content

feat(search): allow collaborators to find posts by response text#1527

Open
lol2x wants to merge 3 commits into
getfider:mainfrom
lol2x:feat/search-in-response
Open

feat(search): allow collaborators to find posts by response text#1527
lol2x wants to merge 3 commits into
getfider:mainfrom
lol2x:feat/search-in-response

Conversation

@lol2x
Copy link
Copy Markdown
Contributor

@lol2x lol2x commented May 6, 2026

Summary

Extend the post search so collaborators and administrators can match against
posts.response text (the staff note set when changing a post's status).

This makes it possible to find posts by what was written when closing them —
e.g. retrieving every post marked "Shipped in v2.3.1". For visitors and
anonymous users the SQL and behaviour are unchanged.

How it works

  • New generated tsvector column posts.search_response (response only,
    GIN-indexed). NULL when the post has no response, so the index stays small.
  • searchPosts extends the predicate and ranking with
    q.search_response @@ ... only when user.IsCollaborator() is true.
  • findSimilarPosts is unchanged.

Notes

Response search uses websearch_to_tsquery with the raw query so
version-style tokens like v2.3.1 are preserved as a single token. The
existing title/description path still uses the prefix-matching to_tsquery
flow.

No frontend changes — the search box automatically benefits from the wider
scope when used by a logged-in collaborator/administrator.

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.

1 participant