Indexing File Contents

Solution 1:

You can try recoll, it is available in the repositories, it gives you a lot of control over the folders you want to index and search and where you want to store the index database, you can use multiple databases too, you can use the advanced search to return results from a specific folder.

See some of its features here, You can run it from the command line passing the query and other control terms to it, see the short manual here. Here the full manual.

Solution 2:

You can use ack-grep (a cli tool), it mainly useful for code projects if that's your use case.

Solution 3:

The Silver Searcher

A code searching tool similar to ack, with a focus on speed.

screenshot