search tool doesn't do a great job #2016

valtido opened this Issue Oct 18, 2013 · 8 comments


None yet

6 participants

valtido commented Oct 18, 2013

I typed jQuery, I got everything apart from jQuery itself...

I think the search func should be looked a bit more closer.


You're absolutely right. We're looking into that now.

I think a good strategy could be to weight the search results by the number
of github stars on the project.

On Fri, Oct 18, 2013 at 5:15 AM, Valtid Caushi notifications@github.comwrote:

I typed jQuery, I got everything apart from jQuery itself...

I think the search func should be looked a bit more closer.

Reply to this email directly or view it on GitHub

valtido commented Oct 21, 2013

Perhaps, whatever works, but yeah it could get more traction should it find what you are looking for...

I have seen where people split each character and use wild cards so e.g:

Search: user


I would like to see regex added so that I could find jQuery with "^jquery$"


I was able to shoehorn this in by pasting thing into the JS console:

# from
jQuery.expr[':'].regex = function(elem, index, match) {
    var matchParams = match[3].split(','),
        validLabels = /^(data|css):/,
        attr = {
            method: matchParams[0].match(validLabels) ? 
                        matchParams[0].split(':')[0] : 'attr',
            property: matchParams.shift().replace(validLabels,'')
        regexFlags = 'ig',
        regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags);
    return regex.test(jQuery(elem)[attr.method](;

Then I could search for the jQuery <tr> by [regex] name via:


The I could show only the one I wanted via:

jQuery("[data-library-name]").hide(); jQuery(':regex(data-library-name,^jquery$)').show()

Worked like a charm!

I'd like to propose that at a minimum, we change this:

# line#31/partial 
        (e("[data-library-name]").hide(), e('[data-library-name*="' + n + '"]').show(), e('[data-library-keywords*="' + n + '"]').show())


# line#31/partial 
        (e("[data-library-name]").hide(), e(':regex(data-library-name,' + n + ')').show(), e(':regex(data-library-keywords,' + n + ')').show())

Ideally, I'd like to add in the ability to search with "scope prefixes" similar to doing from:richard in Gmail. In this case that would be: name:jquery and keywords:testing and keyword:testing


Collating search-related issues: #1829


It might also be useful to weight on the string length as well. So searching on "jquer", jquery would be weighted higher than jquery-ui, which would be weighted higher than jquery-history.

The rationale is that "jquery" is a more exact match than "jquery-ui". They'd each come up, but the sort order would prefer "jquery".


This is fixed. I implemented search based on Damerau–Levenshtein distance and some other simple heuristics.

@jimothyGator This has the effect of weighting smaller library names higher as the edit distance is smaller between "jquer" and "jquery" than "jquery-validate".

@valtido A search for "jquery" will result in jquery being at the top now :)

@ryankirkman ryankirkman closed this Apr 9, 2014

@ryankirkman - you are THE MAN. I did a search today for jquery and it finally appears at the top! This always bugged me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment