locate (or rather,
updatedb) is somewhat simple: it takes the output of
find for the required paths (usually '/'), sorts it, and then compresses it with a front-compression tool (
frcode), in which the consecutive common prefixes are replaced by number of repeated characters.
So I'm wondering, what's stopping anyone from creating something similar for full text search? Say, how about concatenating every file in the system, sorting every line with the format
line:filename:linenumber, and doing front-compression? I guess you would end up with a faster
grep, with the tradeoff of being outdated until the daily/weekly cron job runs, just like
locategrep would be overkill for the entire system, but I can see it being useful to speed up a large project which won't change much for the rest of the day.
Does something like this exists already or is it trivial to implement with some known tools?
Note: I would rather avoid enterprise-like solutions that include features beyond plain-text searching (but I appreciate regex support).