title: Query text for two expressions within distance of n words
body: <p>I'm looking for a way to query a column in a MySQL-database containing text for cases where two expressions occures within a distance of <em>n</em> words or characters. For example: "sed" within 3 words of "eirmod" in the following sentences.</p>
  
  <blockquote>
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, <strong>sed</strong> diam
    nonumy <strong>eirmod</strong> tempor invidunt ut labore et dolore magna aliquyam
    erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
    et ea rebum.</p>
  </blockquote>
  
  <p>I couldn't find a way to include it as a condition in the <code>select</code> and <code>like</code> command. </p>
  
  <pre><code>SELECT * FROM database as db
  WHERE db.text like '%sed%' AND db.text like '%eirmod%'
  </code></pre>
  
  <p>Is there a way to do it? Or is a complete different approach necessary? Thank you in advance.</p>