title: line breaks or punctuation marks as position gaps in elasticsearch
body: <p>In elasticsearch, is there a way to set up an analyzer that would produce position gaps between tokens when line breaks or punctuation marks are encountered?</p>
  
  <p>Let's say I index an object with the following nonsensical string (with line break) as one of its fields:</p>
  
  <pre><code>The quick brown fox runs after the rabbit.
  Then comes the jumpy frog.
  </code></pre>
  
  <p>The standard analyzer will yield the following tokens with respective positions:</p>
  
  <pre><code>0 the
  1 quick
  2 brown
  3 fox
  4 runs
  5 after
  6 the
  7 rabbit
  8 then
  9 comes
  10 the
  11 jumpy
  12 frog
  </code></pre>
  
  <p>This means that a <code>match_phrase</code> query of <code>the rabbit then comes</code> will match this document as a hit.
  Is there a way to introduce a position gap between <code>rabbit</code> and <code>then</code> so that it doesn't match unless a <code>slop</code> is introduced?</p>
  
  <p>Of course, a workaround could be to transform the single string into an array (one line per entry) and use <code>position_offset_gap</code> in field mapping, but I would really rather keep a single string with newlines (and an ultimate solution would involve larger position gaps for newlines than, say, for punctuation marks).</p>