I think the term you want is "KeyWord In Context" or KWIC for short. There is (used to be) lots of KWIC indexing software. There was even a tool for generating UNIX manpage indices that way.
HTH, --traveler
Update: on UNIX the index is called a "permuted index". It took the old /dev/mind a while to come up with that...