Skip to content
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

Add 'ranking' reducer based on depth and count of matches #7

Open
joshjung opened this issue May 10, 2018 · 0 comments
Open

Add 'ranking' reducer based on depth and count of matches #7

joshjung opened this issue May 10, 2018 · 0 comments

Comments

@joshjung
Copy link
Owner

joshjung commented May 10, 2018

If typing in spot rock, the TrieSearch.RANK_REDUCER will sort the results like:

0: 'spot rock'                // exact word match, correct order
1: 'spotify rocks'         // incomplete word match, correct order
2: 'rock spot'               // exact match, incorrect order, no word gap
3: 'spot the rocks'     // exact word match, correct order, with gap word(s)                        
4: 'rock the spot'       // exact word matches, incorrect order, with gap word(s)

Need to give this more thought, but this would definitely be a nice ranking style feature for reducing the found results. Downside is sorting, but if this can done inline with the array concatenations this might actually mean that it just dictates the order in which the arrays are concatenated when done which is a much faster operation than sorting all the items at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant