harvesthq / chosen

Deprecated - Chosen is a library for making long, unwieldy select boxes more friendly.
http://harvesthq.github.io/chosen/
Other
21.85k stars 4.1k forks source link

Sponsor looking for a JS developer / Multi-keyword search #3145

Closed dsuch closed 11 months ago

dsuch commented 11 months ago

Hello,

I am technical founder of Zato Source and I would like to sponsor the development of a certain feature in chosen, to be used in our open-source product, and I am looking for a JavaScript developer who can do it.

The feature is multi-keyword search.

Let's say I have these options:

<option value="...">abc.123.456<option>
<option value="...">abc.123.789<option>
<option value="...">abc.qqq.789<option>

What I would like to see is the ability to type "abc 789" - which means using space-separated keywords - and this would match the latter two options because both of them have "abc" and "789" in their text. That is, the keywords should be and-joined.

Looking at function AbstractChosen.prototype.winnow_results, in chosen 1.8.7, I can see that it builds a regex object that is used for text matching so, tentatively, it seems like there is a need to turn the list of keywords such as "abc 789" into a series of regex objects, and matching each of them, instead of treating input as a single regex pattern.

Note that this is meant to be a mere extension to chosen rather than a replacement of its search capabilities, e.g. it should be still possible to search inside values - this part stays and so do all the other parts of the library.

Feel free to contact me directly if you are interested in this work. My email is dsuch@zato.io.

Regards.