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
"Fuzzy" word search #858
Comments
+1, it's a matter of elementary logic. "Uni Sta" should find "United States". |
+1 Absolutly, this need to be merged ind |
Added this as a proper pull request: #867 |
+1 |
This plugin desperately needs fuzzy search. |
+1 |
+1 This would be extremely helpful, what's the status on merging the pull request #867 |
I forked the repo to do just this, figured I would search for an issue first - +1 this needs to be merged!! |
+1 thx for the quick patch YANOUSHek |
+1 |
I've ported the jQuery code proposed to the current CoffeScript code and made some changes to make the highlighting to work: https://github.com/eliasdorneles/chosen Please give a try and let me know if you have any suggestions! :) |
I fixed the highlight issues I was having, it looks alright now, please check it out at: https://github.com/eliasdorneles/chosen |
@eliasdorneles yes please. It makes the review far easier |
@stof ok, done! |
+1 Using the patch to good effect. |
+1 a must have! |
How does it works? I'm unable to make it work. I type "ted" from United and no results on the demo. What I'm doing wrong? Thanks |
@saulob Try the chosen version in my repository that I've ported from this and added other fixes -- several people are using it without problems: https://github.com/eliasdorneles/chosen |
@eliasdorneles , thank you very much. your version worked :) |
i was looking for that, it's a must for the original. thx @eliasdorneles seems it works great |
+1 a must! |
+1 |
+1 saves tons of time |
+1 I had the same need and I ended up reducing the scope of my solution to avoid maintaining a complex patch:
This just tokenizes the search by spaces, so it doesn't allow to change the order. It would be awesome to have behavior / solution proposed by @YANOUSHek integrated in chosen core! |
👍 |
Hi,
I'm a fellow developer who recently found chosen and I'm amazed by you solution. I did run into a couple problems with the filtering text which I managed to work out and change a couple lines in your code. I don't know if this is something that might interest you and you'd like to have it merged with your code. Let me describe the problem and show you a diff of my changes.
The problem I had was searching for more than word. For example, if you go to your demo site, insert the text "bosnia herz" into the country select and you'll see that nothing matches because you're searching for the exact string I've typed. Also you can't type words in wrong order or just parts of the words ("uni sta").
I'd really like the option to have such a "fuzzy" filter and I've managed to change the jquery version of chosen to just do that. The diff:
This was just me hacking at the jQuery version to have it running on my site. I've lost the option to highlight the text that matched the filter but I didn't really care about that.
If this is something that might interest you I'll make a fork and submit a pull request. I'll even bring back the
<em>
highlights.The text was updated successfully, but these errors were encountered: