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

Home Page:https://searchcodeserver.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query on filter only (without searchphrase)

quasarea opened this issue · comments

It could be good to be able for query on filter only, like:
http://localhost:8080/?lan=C%2B%2B&repo=Test

So it would end up listing all the files of specified language in repo,

Could do some overview of unknowns, and also be used in overviews to link % of languages to actual results for the repo.

Certainly something to consider adding. I can see this being useful in some instances.

Might be worth doing this though a literal search option, which passes back the query as a lucene query and runs that. Would mean having to know the lucene syntax however.

@quasarea Ok this is now sitting in master.

If you take the latest copy and build you should be able to achieve this. Note it will require a rebuild of the index though.

This will only currently work on the Ajax interface (non HTML only one). On the bottom right in filter options there will be a new checkbox "Literal Search" click it an your searches will run as literal searches against the index.

So for example a search for the following with literal search enabled,

fn:data* AND rn:sear* AND ln:jav*

will search for filenames starting with data and with the repositoryname starting with sear and for the language starting with jav

I still need to add documentation for this and run it through some testing but if you could provide feedback that would be helpful.

Oh to search for things with spaces in the name the space are replaced with _ so to search for language Bourne Again Shell you would search for

ln:bourne_again_shell

@quasarea Sitting in master if you want to give it a go.

works lovely, thanks 👍