<p dir="auto">Multi-field is great, but searching with multiple analyzers against only one field is simpler/better.<br>
If you have a multi-lingual index, where each document has its source language, you can analyze the text fields using a special analyzer, based on the detected language (maybe even using the <a href="http://www.elasticsearch.org/guide/reference/mapping/analyzer-field.html" rel="nofollow"><code class="notranslate">_analyzer.path</code></a> functionality).<br>
But what happens when you misdetected the language somehow, either at index- or at query-time? Some aggressive stemming can have devastating effects.</p>
<p dir="auto">In such a scenario, having the original words indexed in parallel to the stemmed one would help. Be they in the same field would even letting phrase/slop queries work properly.<br>
The only way to get multiple terms at the same position with ElasticSearch is through the <a href="http://www.elasticsearch.org/guide/reference/index-modules/analysis/synonym-tokenfilter.html" rel="nofollow">synonym token filter</a>, useless for stemming.</p>
<p dir="auto">I've been working on a way to merge the terms that multiple analyzers output.<br>
Say you want both to use a <a href="http://www.elasticsearch.org/guide/reference/index-modules/analysis/simple-analyzer.html" rel="nofollow">simple analyzer</a>, and any of the specialized <a href="http://www.elasticsearch.org/guide/reference/index-modules/analysis/lang-analyzer.html" rel="nofollow">language-specific analyzer</a>, or anything.<br>
My plugin can make it as simple as the following index setting:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="index:
  analysis:
    analyzer:
      # An analyzer using both the &quot;simple&quot; analyzer and the sophisticated &quot;english&quot; analyzer, combining the resulting terms
      combo_en:
        type: combo
        sub_analyzers: [simple, english]"><pre class="notranslate"><code class="notranslate">index:
  analysis:
    analyzer:
      # An analyzer using both the "simple" analyzer and the sophisticated "english" analyzer, combining the resulting terms
      combo_en:
        type: combo
        sub_analyzers: [simple, english]
</code></pre></div>
<p dir="auto">Here is a simple example of what is does:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# What the &quot;simple&quot; analyzer outputs
curl -XGET 'localhost:9200/yakaz/_analyze?pretty=1&amp;analyzer=simple' -d 'An example'
{
  &quot;tokens&quot; : [ {
    &quot;token&quot; : &quot;an&quot;,
    &quot;start_offset&quot; : 0,
    &quot;end_offset&quot; : 2,
    &quot;type&quot; : &quot;word&quot;,
    &quot;position&quot; : 1
  }, {
    &quot;token&quot; : &quot;example&quot;,
    &quot;start_offset&quot; : 3,
    &quot;end_offset&quot; : 10,
    &quot;type&quot; : &quot;word&quot;,
    &quot;position&quot; : 2
  } ]
}
# What the &quot;english&quot; analyzer outputs
curl -XGET 'localhost:9200/yakaz/_analyze?pretty=1&amp;analyzer=english' -d 'An example'
{
  &quot;tokens&quot; : [ {
    &quot;token&quot; : &quot;exampl&quot;,
    &quot;start_offset&quot; : 3,
    &quot;end_offset&quot; : 10,
    &quot;type&quot; : &quot;&lt;ALPHANUM&gt;&quot;,
    &quot;position&quot; : 2
  } ]
}

# Now what our combined analyzer outputs
curl -XGET 'localhost:9200/yakaz/_analyze?pretty=1&amp;analyzer=combo_en' -d 'An example'
{
  &quot;tokens&quot; : [ {
    &quot;token&quot; : &quot;an&quot;,
    &quot;start_offset&quot; : 0,
    &quot;end_offset&quot; : 2,
    &quot;type&quot; : &quot;word&quot;,
    &quot;position&quot; : 1
  }, {
    &quot;token&quot; : &quot;example&quot;,
    &quot;start_offset&quot; : 3,
    &quot;end_offset&quot; : 10,
    &quot;type&quot; : &quot;word&quot;,
    &quot;position&quot; : 2
  }, {
    &quot;token&quot; : &quot;exampl&quot;,
    &quot;start_offset&quot; : 3,
    &quot;end_offset&quot; : 10,
    &quot;type&quot; : &quot;&lt;ALPHANUM&gt;&quot;,
    &quot;position&quot; : 2
  } ]
}"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> What the "simple" analyzer outputs</span>
curl -XGET <span class="pl-s"><span class="pl-pds">'</span>localhost:9200/yakaz/_analyze?pretty=1&amp;analyzer=simple<span class="pl-pds">'</span></span> -d <span class="pl-s"><span class="pl-pds">'</span>An example<span class="pl-pds">'</span></span>
{
  <span class="pl-s"><span class="pl-pds">"</span>tokens<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> [ {
    <span class="pl-s"><span class="pl-pds">"</span>token<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>an<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>start_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 0,
    <span class="pl-s"><span class="pl-pds">"</span>end_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 2,
    <span class="pl-s"><span class="pl-pds">"</span>type<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>word<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>position<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 1
  }, {
    <span class="pl-s"><span class="pl-pds">"</span>token<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>example<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>start_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 3,
    <span class="pl-s"><span class="pl-pds">"</span>end_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 10,
    <span class="pl-s"><span class="pl-pds">"</span>type<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>word<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>position<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 2
  } ]
}
<span class="pl-c"><span class="pl-c">#</span> What the "english" analyzer outputs</span>
curl -XGET <span class="pl-s"><span class="pl-pds">'</span>localhost:9200/yakaz/_analyze?pretty=1&amp;analyzer=english<span class="pl-pds">'</span></span> -d <span class="pl-s"><span class="pl-pds">'</span>An example<span class="pl-pds">'</span></span>
{
  <span class="pl-s"><span class="pl-pds">"</span>tokens<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> [ {
    <span class="pl-s"><span class="pl-pds">"</span>token<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>exampl<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>start_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 3,
    <span class="pl-s"><span class="pl-pds">"</span>end_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 10,
    <span class="pl-s"><span class="pl-pds">"</span>type<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>&lt;ALPHANUM&gt;<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>position<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 2
  } ]
}

<span class="pl-c"><span class="pl-c">#</span> Now what our combined analyzer outputs</span>
curl -XGET <span class="pl-s"><span class="pl-pds">'</span>localhost:9200/yakaz/_analyze?pretty=1&amp;analyzer=combo_en<span class="pl-pds">'</span></span> -d <span class="pl-s"><span class="pl-pds">'</span>An example<span class="pl-pds">'</span></span>
{
  <span class="pl-s"><span class="pl-pds">"</span>tokens<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> [ {
    <span class="pl-s"><span class="pl-pds">"</span>token<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>an<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>start_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 0,
    <span class="pl-s"><span class="pl-pds">"</span>end_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 2,
    <span class="pl-s"><span class="pl-pds">"</span>type<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>word<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>position<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 1
  }, {
    <span class="pl-s"><span class="pl-pds">"</span>token<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>example<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>start_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 3,
    <span class="pl-s"><span class="pl-pds">"</span>end_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 10,
    <span class="pl-s"><span class="pl-pds">"</span>type<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>word<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>position<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 2
  }, {
    <span class="pl-s"><span class="pl-pds">"</span>token<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>exampl<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>start_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 3,
    <span class="pl-s"><span class="pl-pds">"</span>end_offset<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 10,
    <span class="pl-s"><span class="pl-pds">"</span>type<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> <span class="pl-s"><span class="pl-pds">"</span>&lt;ALPHANUM&gt;<span class="pl-pds">"</span></span>,
    <span class="pl-s"><span class="pl-pds">"</span>position<span class="pl-pds">"</span></span> <span class="pl-c1">:</span> 2
  } ]
}</pre></div>
<p dir="auto">Terms are sorted by position, then by start/end offset, so that it's easier to use its output under reasonable assumptions of using a classical analyzer.</p>
<p dir="auto">Here is the good news! You can find my implementation here: <a href="https://github.com/ofavre/elasticsearch/tree/combo-analyzer-v0.16.4">https://github.com/ofavre/elasticsearch/tree/combo-analyzer-v0.16.4</a> (based on released ElasticSearch version 0.16.4).</p>
<p dir="auto"><strong>EDIT:</strong> It is finally available as a plugin, thanks to jprante: <a href="https://github.com/yakaz/elasticsearch-analysis-combo">https://github.com/yakaz/elasticsearch-analysis-combo</a>.</p>
<p dir="auto"><strong>Describe the feature</strong>:<br>
close inactive index(without read or write) for configable time.<br>
when it is visited first time, open it.</p>