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

possibility to match only items, that **starts with** #15

Open
hidegh opened this issue Dec 5, 2014 · 5 comments
Open

possibility to match only items, that **starts with** #15

hidegh opened this issue Dec 5, 2014 · 5 comments

Comments

@hidegh
Copy link

hidegh commented Dec 5, 2014

this function is especially important if searching only by a single column.
creating own score function is not a good solution, thus it has to handle separately diacritics.
need this function to have inside selectize.js

@hidegh hidegh changed the title possibility to match onli items, that starts with possibility to match only items, that **starts with** Dec 5, 2014
@hidegh
Copy link
Author

hidegh commented Dec 5, 2014

since similar functionality can be achieved inside the scoring function, the only real job is to create a public function which changes the special diacritics char so invariant search would be possible

@brianreavis
Copy link
Owner

@hidegh Or: just adjust tokenize to not split on spaces and add a ^ to the beginning of the regexp that it produces.

@hidegh
Copy link
Author

hidegh commented Dec 7, 2014

@brianreavis Actually I don't understand Sifter in details and would like to avoid any change inside a code that is maintained by other developers (by you) - since any change and component update then would need to be 'updated' locally, just to support my 'special' search - so that is not an option.

To overload just that function is a bit better solution, but again, until I dont know how exactly it works, i'd like to avoid.

Today maybe i'm the only one who asks for such an options for selectize.js (to support starts with or to support any reges), but i'm sure I won't be the last 😄 But even better is the possibility to pass a regex (which can be constructed from the search term) that has to be matched - which would then be automatically passed form selectize to sifter.. Please consider implementing this. Thanx.

Other remarks: As I've seen lot of people do not read documentation (like the one who complained about not every data being loaded - he had more than 1000) - and sometimes even documentation is missing some details: like option group id with value of 0/false is not rendered as option group 😄

Still I prefer your code over selec2.js - it's nicer, cleaner (at least for me).

@jods4
Copy link

jods4 commented Oct 31, 2015

Indeed searching at word boundaries (\b) or at beginning of string (^) is a much needed addition.

Sifter is used internally by Selectize and when you type a in a drop down and pretty much all results show up it's just weird. You would expect to only see items that starts with a.

@RudeySH
Copy link

RudeySH commented May 22, 2020

Did #51 resolve this?

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

4 participants