Comments (3)
@kentcdodds: Sure, why not. You have after all taken the time to create the library!
An example is here
https://codesandbox.io/s/match-sorter-example-forked-1ko35
"Share a link in the docs" - does that mean create a PR? (never mind, figured it out. Github is helpful these days 😄 )
from match-sorter.
As a comment for the above approach, what I am missing is the ability to prioritize columns. Say you have name
and tags
in a data row object. If all else fails a "contains" match in tags
is better than returning nothing, but "contains" in name
would be a much better match.
Would it be possible to adjust the rank per key? So key = 'name', rank= +5, key='tags, rank = -10
for example? Not sure if values make sense, but basically to offset the ranking to say that "EQUAL match for tags
should give the same rank as CONTAINS match for name
" for example.
Either way, great lib!
/Victor
from match-sorter.
Awesome! Thank you for taking the time to share Victor! Want to make an example in codesandbox and share a link in the docs?
from match-sorter.
Related Issues (20)
- Base sort should still be applied if the search string is empty HOT 3
- How to ignore caseRank while sorting? HOT 11
- Match sorter
- Issue with types for nested keys HOT 2
- Unable to import match sorter from versions 5.0.0+ HOT 1
- match fails under certain conditions when keys use different thresholds
- No matches when apostrophe mismatch HOT 1
- `matchSorter` does not accept readonly arrays. HOT 3
- What is the maximum array count for this sorter to perform well? HOT 3
- Return NO_MATCH Items in Alphabetical Order based on Keys HOT 1
- Can't figure out how to generate keys for use with recursive data HOT 3
- Question: Multiple search terms and OR results
- error TS7016: Could not find a declaration file for module 'match-sorter'. '...../node_modules/match-sorter/dist/match-sorter.cjs.js' HOT 4
- Question: ENDS WITH Do you have a match? HOT 1
- Sort array of objects by array of indexes? HOT 1
- Feature request: export `match` and `sort` functions
- feat: return matched pos HOT 2
- Defer the assignment of `matchSorter.rankings` HOT 2
- number and range filter ???
- Consider the usage of `hasOwn` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from match-sorter.