Closed pawlarius closed 1 year ago
Fuse doesn't actually handle this, as it was designed for searching, and not filtering, though I recognize the allure of the latter use case. For example, should Fuse at some point add filtering for numbers or dates with comparison operators (i.e, less than, greater then)? I don't know about this (yet).
For your case, one crude way would be to format undefined
and null
before they're passed into Fuse, to be "none"
, and you search for that. Admittedly, I don't like this approach, but it works 😅
I'll chime in here and say that I would LOVE the ability to do comparative filtering and I'd be willing to help work on it.
There are two paths for handling this I assume:
BaseMatch
implementationsFor option 2, you could either assume all custom implementations take precedence over the built-in ones, or export the built-in searchers
and only use those provided if any are provided (i.e., require callers to splice the searchers
array into the precedence order they need).
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days
Hi Fuse team and community, first of all thank you for this amazing library! It really help all the heavy weight lifting for searching and matching items.. but I seem to struck into a case that I'm not sure if Fuse will/had already support.
So consider this is my items to be searched from:
And I want to match items that doesn't have price, which in this case is "Berry" and "Cherry". But when I tried to use this query, Fuse will return invalid value.
I tried searching through this repo but all I found is Fuse do support filter zero values from this PR https://github.com/krisk/Fuse/pull/73. Is there any other reason why we don't allow null/undefined value for filtering?