-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust module vs method ranking in search results
Prior to this commit, modules would rank above methods in search results. This ensured, for example, that `ActionController::Rendering` would rank above `ActionController::Rendering#render` when searching for "ActionController::Rendering". However, `ActionController::Rendering` would also rank above `ActionController::Rendering#render` when searching for just "render". Though the method _does_ rank first when searching for "#render" or ".render", such queries may not be intuitive. Based on the idea that users will be searching for _either_ a module _or_ a method, this commit removes the higher-ranked module-specific ngrams from method entries in the search index. For example, the method entry for `ActionController::Rendering#render` will no longer include the ":Ac", " Ac", ":Re", and " Re" ngrams (though it will still include the "Act", "Ren", etc ngrams). Furthermore, this commit changes the tie-breaker bonuses to be reduced in proportion to just the method name for methods or the module name for modules, whereas before it was reduced in proportion to the fully qualified name for both methods and modules. The end result is that `ActionController::Rendering` still ranks above `ActionController::Rendering#render` when searching for "ActionController::Rendering", but `ActionController::Rendering#render` now ranks above `ActionController::Rendering` when searching for just "render". Fixes #330.
- Loading branch information
1 parent
de49d9e
commit b482244
Showing
2 changed files
with
57 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters