Skip to content

Possible dynamic min/max on RangeSlider workaround using facet values? #926

@anthonycook

Description

@anthonycook

Currently it is not possible to dynamically set min/max on the RangeSlider widget, I believe this is due to Meilisearch not yet supporting min/max stats. See discussion

Would it be possible to implement this functionality in instant-meilisearch by using facet keys? For example if I had a price field that I wanted to use the RangeSlider with, could instant-meilisearch make a facet request for price and use the first and last facet key for min-max?

"facetDistribution": {
    "price": {
      "1": 2099,   <<<< Min value 1
      "10": 2063,
      "100": 1995,
      "200": 2099  <<<< Max value is 200
     }
  }

This of course would be a temporary fix until Meilisearch supports min/max/avg ect. The RangeSlider widget would be way more useful with non-static min/max values.

Not sure if this is viable or has any potential issues, would appreciate feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions