If you have run a search that returned no results there are a few things to try. By default searchcode
prioritizes system survival (hey its a free service!), and as such might do some load shedding, which can
mean you don't see results you expect. You can do some things to help with this.
Filtering by language or source will cut down the number of results searchcode needs to look at. If you
know a result for instance a term can be found in python code, specifying python
via the lang:python syntax, or the sidebar filters.
This works in reverse too, if you specify a filter and are not getting what you expect, try removing the filter.
You can also filter by filename
database file:content where the filename must match
at the start what you supply. Add more terms or longer terms
Adding more search terms will now only improve relevance it will reduce the number of results that
searchcode needs to inspect. So rather than searching for
test consider trying unittest
or test random.
Keep in mind searchcode uses AND logic. This means search will look for all of the terms you enter split by whitespace. So a search
*testing.T randomstring will look for documents
which contain both *testing.T and randomstring in any order in a document, with a
preference to displaying snippets where the terms are close together. Literal search
Searchcode will literal search on anything, split by whitespace. This allows you to search for
if you like but it does mean that no advanced search query syntax is supported (for the moment anyway) outside of filters and exact match. Exact match search
You can search for exact matches by enclosing them in quotes
Smallest term size
The smallest term you can search for in searchcode is 3 characters long. This is because it uses
a trigram index to search on. So a search for two characters, such as
i+ will never return a
result. However i++ will. Note that while 2 character terms are not searched for if they
are in a search with other longer terms it may be used for matching and displaying code snippets. Case insensitive
Generally consider searchcode case insensitive. It actually lowercase's everything it indexes, so it won't
work as expected for some unicode points. Note that highlighting is real unicode case insensitive using simple
case fold rules.