-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Matching data in the middle of the word #23
Comments
They are using server side for suggestions. Default filter on the client side matches anywhere in the string. Now you will need to modify source. I will change it so it is possible to customize function that does the filtering. |
Turns out this won't be an issue for me. I was using a local array for testing purposes but will be eventually populating with JSON data. You can close the issue if you like. Sorry that I didn't clarify with my team ahead of time. |
It's OK, i think it is good feature to have anyway. |
Added option lookupFilter where you can specify custom logic to filter suggestions. See following commit 32857e7 |
I would like to be able to match search terms based on the start of each word in the string, but the search currently picks up matching letters in the middle of words. For instance, when searching a short local array of album names, if I enter 'in', it matches 'incunabula' and 'run into shadows' as it should, but also matches 'fresh fruit for rottINg vegetables'. If I alter line 342, changing value.toLowerCase().indexOf(q) back to ===0 (as referenced in this issue: #1 (reference)), it only matches 'incunabula' but not 'run into shadows'. Is there a value there that will work as intended? I noticed that another site that uses this plugin achieves that effect (bisonoffice.com) but I'm not clear on how. Thanks!
The text was updated successfully, but these errors were encountered: