Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command-line fulltext indexing?

We have a huge, old, horrible codebase that makes it nearly impossible to find things when you need it. We're working on improving it, sure... but I often find myself doing massive recursive greps to search through the contents of files to find where things are used.

Is there a tool I can use to build a fulltext index of text files in a directory and then query that from the command-line?

Prefer something that can be run in user-space and doesn't need a daemon. We have many users on our dev server, so I want something that I can search through my instance of the codebase.

like image 897
Chris Miller Avatar asked Aug 05 '12 05:08

Chris Miller


1 Answers

I'm a big fan of "gid" (aka "id-utils"):

  • http://www.gnu.org/software/idutils/manual/idutils.html

Usage is simple:

  1. Install id-utils with your favorite package manager (e.g. "sudo apt-get install" or "yum")

  2. "cd" to the root of a source directory and run "mkid"

  3. You can use it from the command line

  4. You can also use it from "vim" or any number of other tools.

like image 187
paulsm4 Avatar answered Sep 22 '22 07:09

paulsm4