-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Search Not working on white spaces #2838
Comments
I'm having the same issue. It only seems to happen when the search terms are in the middle of the string. For instance, if you search for "black" or "American black" it will return results, but "black bear" returns null. |
If one of my search items is "Austin Northwest" and another is "THW Waco". If I type "THW" I would expect both items to show up. If I type "THW " (with a space) I would expect to see just "THW Waco"; however, in v1.7.0 (latest on 2017-08-02) I see both items. This is probably a quick fix in a reg ex somewhere. Would you accept an Amazon gift card of $50 to do a quick fix? Thx for creating Chosen; it is the only way to do drop downs. mduffy215@gmail.com |
I'm having a similar problem. Some of the items in the list have a '<' sign (like <20M or <12Y). When I type < in the search box, all I see is the M or Y for each entry that contains a < (there are actually two spaces before each <, but if I type ' ' (space) no filtering takes place, which is fine in this case). |
This should be fixed by #1483, which is merged to master but not yet in a released version. The next release will include it. If you'd like to build Chosen yourself from source in the meantime, you can follow these instructions. |
Thanks for your quick response. I did get the latest from master, but I still have a problem. I'm happy to open another thread if you prefer, but here is the issue:
I have a list that has a number of ages specified as ' <01M' (and variations) and the search still doesn't find them. I traced the issue to the initial \b in the regex, because (I think) the '<' is escaped as HTML and represented as <, but the & is regarded as punctuation and not a word boundary. So when I type '<' in the search box, the regex is /\b<\w*\b/I and the first search_text is " <01M" and they don't match. If I remove the \b or replace it with \s*, they do.
Not sure what the best answer is but maybe the ideal would be an option to insert your own pattern matcher or regex builder when the default one doesn't work...
I love chosen-js, by the way. It looks great and has worked well for us in almost every case.
Thanks
Scott
…----
Scott Gilkeson, Contractor, Dissemination and Internet Services Branch, Demographic Surveys Division, U.S. Census Bureau
Office 301.763.8703 scott.gilkeson@census.gov
census.gov<http://www.census.gov/> Connect with us on Social Media<http://www.census.gov/about/contact-us/social_media.html>
________________________________
From: T.J. Schuck <notifications@github.com>
Sent: Thursday, August 3, 2017 11:33:26 AM
To: harvesthq/chosen
Cc: Scott Gilkeson (CENSUS/DSD CTR); Comment
Subject: Re: [harvesthq/chosen] Search Not working on white spaces (#2838)
This should be fixed by #1483<#1483>, which is merged to master but not yet in a released version. The next release will include it.
If you'd like to build Chosen yourself from source in the meantime, you can follow these instructions<https://github.com/harvesthq/chosen/blob/master/contributing.md#grunt-tasks-running-tests-and-building-chosen>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#2838 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ASZJ5JXxyeohkKUdVVLB5vKoeBCRz3n7ks5sUehGgaJpZM4N_jkY>.
|
@scott-census Aha, yes, that's both a different issue from this one (which is about whitespace/word boundaries) and something covered by a number of other issues. See #2548 and #2844 and a bunch of other issues about similar stuff. Feel free to add any feedback you have to those. According to #2548, you might be able to solve your problem by setting |
excellent, thanks. Setting enable_split_word_search = false and search_contains = true did the trick, even using 1.7.0
…----
Scott Gilkeson, Contractor, Dissemination and Internet Services Branch, Demographic Surveys Division, U.S. Census Bureau
Office 301.763.8703 scott.gilkeson@census.gov
census.gov<http://www.census.gov/> Connect with us on Social Media<http://www.census.gov/about/contact-us/social_media.html>
________________________________
From: T.J. Schuck <notifications@github.com>
Sent: Thursday, August 3, 2017 3:28:42 PM
To: harvesthq/chosen
Cc: Scott Gilkeson (CENSUS/DSD CTR); Mention
Subject: Re: [harvesthq/chosen] Search Not working on white spaces (#2838)
@scott-census<https://github.com/scott-census> Aha, yes, that's both a different issue from this one (which is about whitespace/word boundaries) and something covered by a number of other issues. See #2548<#2548> and #2844<#2844> and a bunch of other issues about similar stuff. Feel free to add any feedback you have to those. According to #2548<#2548>, you might be able to solve your problem by setting search_contains to false, but that might not be a tenable workaround for your specific case.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2838 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ASZJ5DhpF_UGSDDfa9X0-K_sia2jiy6uks5sUh9qgaJpZM4N_jkY>.
|
Great news! When is the next release? Is it possible to get on an email list for release notifications? |
@mduffy215 New releases are posted to the releases page. You can't directly subscribe to get email notifications from that page, but it does have an RSS feed at |
https://harvesthq.github.io/chosen/
above is the reference link how search works in chosen js.
If we start search from any position which has white space after some position, the search returns null.
Plz give me some solution
The text was updated successfully, but these errors were encountered: