Search Examples IconSearch Examples

The examples below exercise searches against the Koders.com web site of open source code.  Your Code Sight searches against your local index will operate the same way.

The Code Sight search engine is optimized for code and is unlike a typical Internet search engine. First and foremost, only code files are indexed so developers don't waste time wading through non-code documents and information.

Second, we use proprietary user heuristics to allow more popular code files to work their way to the top. Essentially, the more reuse a code file receives, the more likely it will appear higher in your search results.

With that in mind, Code Sight provides various ways to restrict or expand search results by using special operators on your search terms. The following summarizes various ways to modify your search queries to increase your probability of relevancy.

Search Syntax

Note: With the exception of CamelCase, searches are case-insensitive. Searching for 'Xml' is the same as searching for 'XML' is the same as search for 'xML' etc.

Search for phrases

You can search for phrases such as "public event" by enclosing the search term in double quotes.

CamelCase

When using CamelCase, the terms are queried as separate terms. foreachtfffag would return search results as if you entered "for each tag". To search as a single term, keep everything lowercase -- foreachtag.

Stemming: the * operator

Terms can be stemmed with the * operator. The results will include all terms that start with the terms specified.

For example, searching for 'xmlre*' will find files containing all words starting with 'xmlre' such as xmlreader, etc.

Excluding terms: the - operator

The results will include all files containing terms you specify and not the terms you have excluded.

For example, searching 'xmlre* -xmlreader' will return files containing any term starting with xmlre, excluding files that contain xmlreader.

Multiple terms are ANDed together

The results will include all files containing all the terms you specify in the search box. This is known as a logical AND.

For example, searching for 'smtp server' will find all files containing 'smtp' AND 'server'.

Class Definitions

Search for classes whose name contains <search term>

For example, searching for 'cdef:parser' will return files with class names containing 'parser'.

Method Definitions

Search for methods whose name contains <search term>

For example, searching for 'mdef:insert' will return files with method names containing 'insert'

Interface Definitions

Search for interfaces whose name contains <search term>

For example, searching for 'idef:configuration' will return files with interface names containing 'configuration'.

Compound Definitions

Search for classes named 'tree' with a method named 'insert'

For example, searching for 'cdef:tree mdef:insert' will return files with classes named 'tree' with a method named 'insert'




Free Download

Black Duck
Code Sight

Free Edition

Black Duck Software
8 New England Executive Park, Burlington, MA 01803 • 781.891.5100
Ohloh | Koders | Olliance Group
Open Source Resource Center | Open Source Delivers