boyter / searchcode-server

The offical home of searchcode-server where you can run searchcode locally. Note that master is generally unstable in the sense that it is not a release. Check releases for release versions https://github.com/boyter/searchcode-server/releases
https://searchcodeserver.com/
Other
367 stars 94 forks source link

search against file name #72

Closed quasarea closed 7 years ago

quasarea commented 7 years ago

Hi, noticed that if searching for a filename it is not prioritizing such results, maybe it would be worth of scoring matches in filenames/paths higher, so we get class file first and all the references to it below?

It is slightly better when used filename with extension, but then you are not getting references, especially with languages like c, where you have separated header and implementation.

boyter commented 7 years ago

So it actually does match on the filename for all results, however as you say its not a high priority.

It is something that should be fixed though. Will ensure it gets into the next release.

boyter commented 7 years ago

This is now sitting in master. Rather than adjust the weights the same process that applies to the content is applied to the filename. This not only boots the filename matches but it the same partial matching will work on filenames as well.

My random testing of a few repositories showed this to be working as expected.

boyter commented 7 years ago

NB you will need to reindex for this to work. This is a recommended thing to do with any upgrade though.