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

Limit result #17

Open
bleekk opened this issue Feb 18, 2022 · 1 comment
Open

Limit result #17

bleekk opened this issue Feb 18, 2022 · 1 comment

Comments

@bleekk
Copy link

bleekk commented Feb 18, 2022

Hi all,
How can I limit the count of result items when I run the search on a array with over 10.000 items?
Thans

@fwextensions
Copy link
Owner

Is the issue searching speed or just having too many results?

By default, items with 0-scores are not included in the results list, so non-matches shouldn't be returned. If you pass in a minimumScore value in the options parameter to the constructor, then you can require closer matches for items to be returned. The results are sorted by each item's score, so you could also just call, say, .slice(0, 50) on the array to get the 50 highest-scoring results.

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

No branches or pull requests

2 participants