title: How to add suggestion inside term query in DSL
body: <p>My DOc is below</p>
  <pre class="lang-json prettyprint-override"><code>[
  {'id':1, 'name': 'sachin messi', 'description': 'football@football.com', 'type': 'football', 'var':'sports'},
  {'id':2, 'name': 'lionel messi', 'description': 'messi@fifa.com','type': 'soccer','var':'sports'},
  {'id':3, 'name': 'sachin', 'description': 'was', 'type': 'cricket', 'var':'sports'}
  ]
  </code></pre>
  <ul>
  <li>I need to suggest a string which after the <code>term</code></li>
  </ul>
  <p>My DSL query is below</p>
  <pre class="lang-json prettyprint-override"><code>quer = {
    &quot;query&quot;: {
      &quot;bool&quot;: {
        &quot;must&quot;: [
          {
            &quot;terms&quot;: {
              &quot;var.keyword&quot;: [
                &quot;notsports&quot;
              ]
            }
          },
          {
            &quot;query_string&quot;: {
              &quot;query&quot;: &quot;schin&quot;,
              &quot;fields&quot;: [
                &quot;name^128&quot;,
                &quot;description^64&quot;,
              ]
            }
          }
        ]
      }
    },
    &quot;suggest&quot;: {
      &quot;my-suggestion&quot;: {
        &quot;text&quot;: &quot;schin&quot;,
        &quot;term&quot;: {
          &quot;field&quot;: &quot;name&quot;,
          &quot;prefix_length&quot;: 0,
          &quot;min_word_length&quot;: 3,
          &quot;string_distance&quot;: &quot;ngram&quot;
        }
      }
    }
  }
  </code></pre>
  <ul>
  <li><p>My var.keyword is <code>notsports</code></p>
  </li>
  <li><p>still i am getting suggestion <code> 'suggest': {'my-suggestion': [{'text':'schin','offset':0,'length':5,'options': [{'text':'sachin', 'score': 0.75, 'freq': 1}]}</code></p>
  </li>
  <li><p>When i tried to put <code>suggest</code> inside terms list then i am getting <code>RequestError: RequestError(400, 'x_content_parse_exception', 'unknown query [suggest]')</code></p>
  </li>
  <li><p>I need to get the suggestion only if <code>var.keyword</code> matches <code>sports</code></p>
  </li>
  </ul>
  <p>I have asked question in elasticsearch also <a href="https://discuss.elastic.co/t/how-to-add-suggestion-inside-term-query-in-dsl/309893" rel="nofollow noreferrer">https://discuss.elastic.co/t/how-to-add-suggestion-inside-term-query-in-dsl/309893</a></p>