Defining ranges for priceRanges widget

How are price ranges defined? Looks like they are computed on the fly, based on results, but the algo is quite obscure.
Is it possible to define a fixed set of ranges once and for all?
I am actually using the range widget to sort out responses by date ranges!

Thanks
Henri

Hi @henri.gouraud, indeed the price range ranges are computed on the fly for now.

Which InstantSearch flavour are you using today? Let me know so I can guide you into how to create a fixed set of prices.

I am using the “latest” off from your web site

link rel=“stylesheet” href=“https://cdn.jsdelivr.net/npm/instantsearch.js@2.4.1/dist/instantsearch.min.css

Henri

Hi @henri.gouraud, here’s a proof of concept of a custom price range widget with fixed ranges: https://codesandbox.io/s/mo0wrpm24x

Let me know how it goes.

Looks fine, but I also see value at defining the ranges on the fly based on hit statistics (I assume).
How about displaying the number of hits per range? That would be very valuable!!

Thanks for your support,
Henri

You’re definitely right this would be a good addition. But today Algolia has no way to do so, as for integers we only provide statistics and not distribution.

Thanks for the feedback, we’ll take it into account when deciding of new features.