The checkin implements filtering based on the value of the attribute data-tags on the <option> element, if one is present.
I tried to preserve the structure of the code as much as possible, the only major change is that the block of code responsible for determining whether an option matches the filter regex in winnow_results() is extracted into the methods option_matches() and option_value_matches() in the class AbstractChosen. Currently, when the match is against the tags, no highlighting of what caused the match is done in the UI.
Support winnowing based on arbitrary undisplayed tags.
During `winnow_results()`, both the HTML and the value of the `data-tags` attribute of an option are matched against the regex. An option is displayed if either of those match.
If an option matches because of its tags, no highlighting takes place.
+1 This is also very useful for different spellings of a word. Maybe have your British English spelling as the hidden element and include the American English as the actual option. Colour results in Color. For countries, you can also include the local spelling of the country. България results in Bulgaria.