views:

622

answers:

3

I like to run search engine on code, and if you aren't I recommend it (especially if you code in a team and you don't have all the lines of code in your head). When I vaguely remember some variable name or class name, but I can't remember where I saw it, I just run the search. Pre-indexed full-text search system is way faster than greping your entire codebase.

Which full-text search system do you recommend to index source code?

  • Easy setup is a plus
  • Good literal handling (e.g. "UPPER_CASE" symbols {}#$) is a plus
  • Good search options (e.g. AND, OR, -foo, site:thisproject) are plus
  • Code formatting is a plus
  • Non-ascii encoding handling is a plus
  • In-house web-access is required

I use Hyper Estraier, but Namazu is also well-known.

A: 

I hope I got the question right...

If you don't insist on freeware solution perhaps you can try Atlassian products. We are using them in daily work and I must admit that I haven't seen better. Try specifically FishEye (it has pretty good search in the SCM and web interface is superb).

Petr Macek
+2  A: 

I recommend OpenGrok. There are some other engines, here's a quick review of them.

Mauricio Scheffer
A: 

See http://www.semanticdesigns.com/Products/SearchEngine/index.html for a search engine handles many languages (C, C++, C#, Java, PHP, Ada, Fortran, COBOL, ...). Provides hit-window with single-click to see source containing click; can launch your editor on a found file.

Language-aware scanner pick out identifiers, keywords, operator,string, numbers and comments in each language, and lets you search by such categories; this avoids finding some identifer substring in comment or literals. Handles many character encodings: ASCII, ISO-8859-1, UTF-8, UTF-16, EBCDIC, ....

Ira Baxter