title: Is there a standard approach for searching a document for words in a list?
body: <p>I'm working on an application that needs to search documents for all occurrences of words or phrases from a provided list. This is fairly easy to do by just walking a pointer through the document but this method does not scale.  As the document or dictionary get larger the search time increases proportionally eventually becoming unacceptable.   We have experimented with various approaches to reduce the scaling penalty.  On such approach is building an  index layer for the dictionary.  This is our current best strategy but I'm wondering if there is something better and/or easier.</p>
  
  <p>I'm sure this problem has been solved innumerable times.  Is there an approach that has been shown to be optimal or at least close to optimal?</p>