Skip to content

"color" facet on /search returns zero results for known and valid values #6672

Description

@theklared

Please confirm the following.

Describe the bug

The color facet documented at /search does not appear to filter correctly. Querying with a project's own color value (taken directly from that project's /project/{id} response) returns zero hits, even though the project exists and is indexed under other facets (query alone finds it). Testing a numeric range around the known value also returns zero hits, which suggests the field may not be marked as a filterable attribute in the search index, rather than a mismatch.

Steps to reproduce

  1. GET /project/sodium and note the color field (8703084 at time of writing). Also note that the project is indexed and searchable.
  2. GET /search?facets=[["color:8703084"]], returns hits: [], total_hits: 0
  3. GET /search?facets=[["color>=8700000"],["color<=8710000"]], returns hits: [], total_hits: 0

Expected behavior

Searching with the "color" facet set to a project's actual indexed color value should return that project among the hits, consistent with how categories, versions, and other documented facets behave.

Additional context

Tested on multiple project colors to no avail.
Docs: https://docs.modrinth.com/api/operations/searchprojects/

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiRelates to the Modrinth API for developersbackendInvolves work from the backend team

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions