Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Search API not returning exact matches for some queries #972
I see this bug on production, however, when I pulled down the repo and tried to recreate, I was unable to.
To try to recreate I just added the ib gem to the Gemfile on the repo and ran the gemcutter task to load gems into the dev db and then plugged in your url.
Results are in the screenshot below. I'm not sure this is an issue moving forward?
It's possible that the production db is doing something, but the query isn't necessarily all that glamorous or complicated so I doubt that a prod db setting is the case here. After reviewing the logic around it, the only explanation I could have is this (assuming the exact same logic is implemented in prod).
The query logic has a base clause that returns 'ib' in this case, however, there is another stipulation. The version of that record HAS to be indexed. If for whatever reason when the gem was created in the prod environment is not indexed, it will not return. I'm not 100% on the logic surrounding gem creation yet though.
This does not seem to be an issue due to character length, as the following single-character-named gems all return an exact match when searched against a fresh checkout and fresh db dump (as of today):
There may be more, but perhaps these examples will help uncover why exact matches are not being returned by /search. I checked this set against production, and none of these produce an exact match in prod.
I tested a few other two-char searches that I know exist in prod, and they produced the expected exact matches.
Following what @ETetzlaff found, it appears that these Rubygem instances' versions associations all have:
I wonder if the owner of gem
Currently I am trying to figure out how to create a user and simulate pushing and re-versioning gems in my local environment. If anyone would like to pair up and assist, I would love a learning experience.
It is possible that the list I produced above is valid for
interesting, that the webui returns the right results: https://rubygems.org/search?utf8=%E2%9C%93&query=ib