-
Notifications
You must be signed in to change notification settings - Fork 6
Use autoComplete.js library, simplify search #81
Conversation
I forgot about the search button, what does it do currently? |
The search bar didn't seem to do anything more useful previously, either. it can close the search bar but it cannot even open it and it doesn't search whatsoever. For the change - in my opinion: Pros:
Con:
Overall, I think that search code was so messy and unreliable that this work cannot be neglected - neither practically, nor "pedagogically" or how to put it, I mean it's respectable that someone went ahead and made this necessary change. However, I would like to see how this could work with categories, because I think it would be good to preserve that as well, and that was definitely a significant part of the complexity in the old code. |
The categories are still there, but shown on the right hand side, does the previous design do something special with categories? Or maybe you mean the categorization? If yes, it should still be possible, but the reason I like this approach better is that the relevant results get to the top without categories or the order of categories getting in the way(which is more intuitive to me). The categorization may bring less relevant results into user's attention, and if the order of the categories are kept, it'd look confusing to me. |
Yes, I meant that we are jumping around between categories... especially when one wants to look up some special character - a parameter type, a sigil, an operator, a regex symbol - or something that happens to match e.g. certain exception names, I think it's a reasonable assumption that you can make a choice between the categories, and the otherwise accurate matches could be ignored, simply because they aren't the category you care about. I'm not sure how much the left side bar (which is also a kind of search from what I know) can assist this. Maybe it's just one needs to get used to a different workflow for browsing the site from what I've been using. |
One other thing that can be done is the narrowing we do with some symbols, for example if the search starts with And then there is the extended search which allows searching based on categories, maybe if someone is looking for something specific, should use that instead? |
The old code does that, is it preserved in the PR? Sorry, burning out on $dayjob to look into it for real now. :/ |
Yes. |
I looked at how it works, I like it very much! Feels like it started to work faster too. The only problem is that it doesn't really support Levenshtein distance matches? In the old implementation I could write But otherwise - awesome! |
That is because of the search mode, it fits my brain and some of the tools I use, by default it does exact match and if the query contains an space it does loose/fuzzy match, so for example if you write
If that is not desired, I can change it to make the loose search, the default and do exact search maybe by a prefix command. Or just use loose match and not do exact match. |
Aha, I see. Let's do it fuzzy by default (it still prefers explicit matches as I understand it), and can be merged and shipped. Awesome work! |
I don't know if people want this, but I've been spending some time on the docs search to use vanilla JS library and code and to simplify both the search and its JS code.
Library used: autoComplete.js
Probably fixes #79 as well