Text search tool for large source code set with up to date pre-indexing?

2.1k Views Asked by At

I'm doing maintenance of a few branches of middle-size C++ project (~15k files for each branch). Very often I have to search all project files for given string or regex. Currently I'm using Total Commander which has all features I want (case-sensitive, regexes, filename masks) but this tool scans all files every time, so it takes a bit too much time.

Do you know any text search tool, which could pre-index whole source tree and allow quick pattern finding? Returning all matching files is a must, preview of found pattern surroundings would be nice. Of course indexes must be updated instantly when something changes.

Visual Studio search is not enough, it only scans source files (not metadata nor custom resources).

Does such tool exists? I'm using Windows XP.

EDIT: I've found very usable tool, see my own answer

8

There are 8 best solutions below

0
On BEST ANSWER

I found very usable tool here: http://code.google.com/p/ndexer/

I recommend it to everyone!

2
On

Please see http://aaron.oirt.rutgers.edu/myapp/docs/W1300.testAndDemo and follow the "search demo" link to the code tree search demo.
This will do exactly what you are asking for and it is a standard demo component of WHIFF. You will have to add Pygments plug ins to pull out strings of interest from your binary files (or just read the whole file as 'text') -- out-of-the-box the indexer will ignore files Pygments doesn't recognize. There is an easy hack to make it "eat everything" -- let me know if you want more info.

The installation and command line interfaces for searching are described at http://aaron.oirt.rutgers.edu/myapp/docs/W1300_1000.search.

1
On

You could try Google desktop search, or how about Lucene or clucene (lucene ported to c++) as a general-purpose indexing tool.

2
On

One straightforward way to sidestep the problem is to put all the source code on a RAM disk. By speeding up the file IO in this way, you'll see a big jump in performance without otherwise changing your tool chain.

1
On

cscope is able to index c files and to some extent c++ as well. I personally use the KDE front-end KScope which is user-friendlier than cscope's ui.

apart from that you might want to have a look at OpenGrok

0
On

I know you don't want a webapp necessarily, but try Open Grok.

0
On

Windows Indexing Service appears to match all your criteria.

0
On

I don't know for sure (I have no experience), but I would give Eclipse CDT a try. It indexes all your sources for fast lookup of symbols, similar to Eclipse JDT (Java tools).