Skip to content

feat: full-text and faceted search API for samples #21

Description

@brightpixel-dev

Difficulty: Hard · Priority: Critical

Overview

listSamples() only supports exact-match genre/uploader filters and one fixed sort order — no text search, no price/BPM range, no relevance ranking. Add real search to the samples API.

Acceptance Criteria

  • Query param for free-text search across title/genre with relevance ranking
  • BPM range and price range filters, combinable with text search
  • Sort options: relevance, newest, price asc/desc, most sold
  • Stays performant as the table grows (indexed, not a full scan)

Technical Approach

Add a generated tsvector column + GIN index, rank with ts_rank/websearch_to_tsquery, combine with existing/extended range filters in one query. Layer onto the existing list endpoint rather than a new API surface.

Combining relevance ranking with multiple structured filters and pagination in one indexed query (without falling off the GIN index) is the hard part — every write path also has to keep the index in sync.

Activity

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

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions