<p dir="auto">This was found during training using the core developer training dataset:</p>
<p dir="auto">Getting all the term suggestions for framework</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="GET stack/_suggest
{
  &quot;mysuggest&quot; : {
    &quot;text&quot; : &quot;framework&quot;,
    &quot;term&quot; : {
      &quot;field&quot; : &quot;title&quot;,
      &quot;suggest_mode&quot; : &quot;always&quot;,
      &quot;sort&quot; : &quot;score&quot;,
      &quot;size&quot; : 20
    }
  }
}"><pre class="notranslate"><span class="pl-ii">GET stack/_suggest</span>
{
  <span class="pl-ent">"mysuggest"</span> : {
    <span class="pl-ent">"text"</span> : <span class="pl-s"><span class="pl-pds">"</span>framework<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"term"</span> : {
      <span class="pl-ent">"field"</span> : <span class="pl-s"><span class="pl-pds">"</span>title<span class="pl-pds">"</span></span>,
      <span class="pl-ent">"suggest_mode"</span> : <span class="pl-s"><span class="pl-pds">"</span>always<span class="pl-pds">"</span></span>,
      <span class="pl-ent">"sort"</span> : <span class="pl-s"><span class="pl-pds">"</span>score<span class="pl-pds">"</span></span>,
      <span class="pl-ent">"size"</span> : <span class="pl-c1">20</span>
    }
  }
}</pre></div>
<p dir="auto">yields:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[{
    &quot;text&quot;: &quot;frameworks&quot;,
    &quot;score&quot;: 0.8888889,
    &quot;freq&quot;: 16
}, {
    &quot;text&quot;: &quot;framework2&quot;,
    &quot;score&quot;: 0.8888889,
    &quot;freq&quot;: 1
}, {
    &quot;text&quot;: &quot;framwork&quot;,
    &quot;score&quot;: 0.875,
    &quot;freq&quot;: 5
}, {
    &quot;text&quot;: &quot;framewok&quot;,
    &quot;score&quot;: 0.875,
    &quot;freq&quot;: 2
}, {
    &quot;text&quot;: &quot;famework&quot;,
    &quot;score&quot;: 0.875,
    &quot;freq&quot;: 1
}, {
    &quot;text&quot;: &quot;framework's&quot;,
    &quot;score&quot;: 0.7777778,
    &quot;freq&quot;: 1
}, {
    &quot;text&quot;: &quot;freamwork&quot;,
    &quot;score&quot;: 0.7777778,
    &quot;freq&quot;: 1
}]"><pre class="notranslate">[{
    <span class="pl-ent">"text"</span>: <span class="pl-s"><span class="pl-pds">"</span>frameworks<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"score"</span>: <span class="pl-c1">0.8888889</span>,
    <span class="pl-ent">"freq"</span>: <span class="pl-c1">16</span>
}, {
    <span class="pl-ent">"text"</span>: <span class="pl-s"><span class="pl-pds">"</span>framework2<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"score"</span>: <span class="pl-c1">0.8888889</span>,
    <span class="pl-ent">"freq"</span>: <span class="pl-c1">1</span>
}, {
    <span class="pl-ent">"text"</span>: <span class="pl-s"><span class="pl-pds">"</span>framwork<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"score"</span>: <span class="pl-c1">0.875</span>,
    <span class="pl-ent">"freq"</span>: <span class="pl-c1">5</span>
}, {
    <span class="pl-ent">"text"</span>: <span class="pl-s"><span class="pl-pds">"</span>framewok<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"score"</span>: <span class="pl-c1">0.875</span>,
    <span class="pl-ent">"freq"</span>: <span class="pl-c1">2</span>
}, {
    <span class="pl-ent">"text"</span>: <span class="pl-s"><span class="pl-pds">"</span>famework<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"score"</span>: <span class="pl-c1">0.875</span>,
    <span class="pl-ent">"freq"</span>: <span class="pl-c1">1</span>
}, {
    <span class="pl-ent">"text"</span>: <span class="pl-s"><span class="pl-pds">"</span>framework's<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"score"</span>: <span class="pl-c1">0.7777778</span>,
    <span class="pl-ent">"freq"</span>: <span class="pl-c1">1</span>
}, {
    <span class="pl-ent">"text"</span>: <span class="pl-s"><span class="pl-pds">"</span>freamwork<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"score"</span>: <span class="pl-c1">0.7777778</span>,
    <span class="pl-ent">"freq"</span>: <span class="pl-c1">1</span>
}]</pre></div>
<p dir="auto">if we then pick any of the of these terms, except the most popular <code class="notranslate">frameworks</code> and feed it to the term suggester using the missing option:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="GET stack/_suggest
{
  &quot;mysuggest&quot; : {
    &quot;text&quot; : &quot;framwork&quot;,
    &quot;term&quot; : {
      &quot;field&quot; : &quot;title&quot;,
      &quot;suggest_mode&quot; : &quot;missing&quot;,
      &quot;sort&quot; : &quot;score&quot;,
      &quot;size&quot; : 20
    }
  }
}"><pre class="notranslate"><span class="pl-ii">GET stack/_suggest</span>
{
  <span class="pl-ent">"mysuggest"</span> : {
    <span class="pl-ent">"text"</span> : <span class="pl-s"><span class="pl-pds">"</span>framwork<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"term"</span> : {
      <span class="pl-ent">"field"</span> : <span class="pl-s"><span class="pl-pds">"</span>title<span class="pl-pds">"</span></span>,
      <span class="pl-ent">"suggest_mode"</span> : <span class="pl-s"><span class="pl-pds">"</span>missing<span class="pl-pds">"</span></span>,
      <span class="pl-ent">"sort"</span> : <span class="pl-s"><span class="pl-pds">"</span>score<span class="pl-pds">"</span></span>,
      <span class="pl-ent">"size"</span> : <span class="pl-c1">20</span>
    }
  }
}</pre></div>
<p dir="auto">We still get back suggestions:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[{
    &quot;text&quot;: &quot;framework&quot;,
    &quot;score&quot;: 0.875,
    &quot;freq&quot;: 197
}, {
    &quot;text&quot;: &quot;frameworks&quot;,
    &quot;score&quot;: 0.75,
    &quot;freq&quot;: 9
}, {
    &quot;text&quot;: &quot;framewok&quot;,
    &quot;score&quot;: 0.75,
    &quot;freq&quot;: 1
}, {
    &quot;text&quot;: &quot;framework2&quot;,
    &quot;score&quot;: 0.75,
    &quot;freq&quot;: 1
}]"><pre class="notranslate">[{
    <span class="pl-ent">"text"</span>: <span class="pl-s"><span class="pl-pds">"</span>framework<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"score"</span>: <span class="pl-c1">0.875</span>,
    <span class="pl-ent">"freq"</span>: <span class="pl-c1">197</span>
}, {
    <span class="pl-ent">"text"</span>: <span class="pl-s"><span class="pl-pds">"</span>frameworks<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"score"</span>: <span class="pl-c1">0.75</span>,
    <span class="pl-ent">"freq"</span>: <span class="pl-c1">9</span>
}, {
    <span class="pl-ent">"text"</span>: <span class="pl-s"><span class="pl-pds">"</span>framewok<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"score"</span>: <span class="pl-c1">0.75</span>,
    <span class="pl-ent">"freq"</span>: <span class="pl-c1">1</span>
}, {
    <span class="pl-ent">"text"</span>: <span class="pl-s"><span class="pl-pds">"</span>framework2<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"score"</span>: <span class="pl-c1">0.75</span>,
    <span class="pl-ent">"freq"</span>: <span class="pl-c1">1</span>
}]</pre></div>
<p dir="auto">Only for the most <code class="notranslate">popular</code>  term do we get back no suggestions.</p>
<p dir="auto">For full reference here is how <code class="notranslate">framwork</code> gets analyzed:</p>
<p dir="auto"><code class="notranslate">GET stack/_analyze?field=title&amp;text=framwork</code></p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;tokens&quot;: [
    {
      &quot;token&quot;: &quot;framwork&quot;,
      &quot;start_offset&quot;: 0,
      &quot;end_offset&quot;: 8,
      &quot;type&quot;: &quot;&lt;ALPHANUM&gt;&quot;,
      &quot;position&quot;: 0
    }
  ]
}"><pre class="notranslate">{
  <span class="pl-ent">"tokens"</span>: [
    {
      <span class="pl-ent">"token"</span>: <span class="pl-s"><span class="pl-pds">"</span>framwork<span class="pl-pds">"</span></span>,
      <span class="pl-ent">"start_offset"</span>: <span class="pl-c1">0</span>,
      <span class="pl-ent">"end_offset"</span>: <span class="pl-c1">8</span>,
      <span class="pl-ent">"type"</span>: <span class="pl-s"><span class="pl-pds">"</span>&lt;ALPHANUM&gt;<span class="pl-pds">"</span></span>,
      <span class="pl-ent">"position"</span>: <span class="pl-c1">0</span>
    }
  ]
}</pre></div>
<p dir="auto">I have found a few odd cases where the phrase suggester with suggest_mode: "missing" generates a suggestion even though the query returns results. I am querying across two indexes but the query term only exists in one of the indexes. I get the search results I expect, but I do not expect to get a suggestion.</p>
<p dir="auto">I am trying to come up with a curl recreation but I haven't been able to reproduce it yet in a smaller corpus.</p>
<p dir="auto">I believe what is happening is that the phrase suggestions are getting merged together in the same way the query results are merged together across multiple indexes. If I have query results from test_1 and no results from test_2, then I expect to see results from test_1. But if I have a suggestion from test_1 and no suggestion from test_2 (due to suggest_mode: "missing"), I do not expect to see a suggestion.</p>