-
-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinct values for number facets #599
Comments
@allevo can we maybe discuss this and see how to prioritize? Looks like a nice idea to me |
@micheleriva i'd like to contribute if you are willing to accept a PR. |
@mahendraHegde absolutely |
@micheleriva let me know if you have made any decision(or link to any discussion) about the number facet api, i was planing to keep it similar to string,
where
I'm not sure if |
Problem Description
I am building a facet filter UI that gets populated by the
facets
property returned from search results. The current API for dealing withnumber
facets forces you to make assumptions about the data by supplying one or moreranges
:This API assumes that I know what kind of number ranges I'm dealing with ahead of time. In my case, there is a large set of facets with potentially wildly varying ranges. Instead, I'd like to be able to reason about each distinct
number
value without having to supply anyranges
. It'd be preferable if the results looked likeenums
:Proposed Solution
Allow for the same kind of configurations that are valid for
enums
. i.e either an empty object or this:size
number
10
order
string
DESC
ASC
orDESC
.limit
number
100
offset
number
0
Alternatives
I've considered just representing my numbers as
enum
in my schema instead, but this gets very awkward as I'd still like to be able to use number operators when filtering on the facets.Additional Context
No response
The text was updated successfully, but these errors were encountered: