title: What's a good alternative for the output field in Elasticsearch 5.1 Completion Suggestions?
body: <p>The first error I encountered when indexing my data in ES 5.1 was my Completion Suggestion mapping which contained an output field.</p>
  
  <p><code>message [MapperParsingException[failed to parse]; nested: IllegalArgumentException[unknown field name [output], must be one of [input, weight, contexts]];]</code></p>
  
  <p>So I removed it but now a lot of my Auto completions are incorrect because it returns the input it matched instead of the single output String. </p>
  
  <p>After some googling I found <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_50_suggester.html" rel="noreferrer">this</a> article from ES which mentioned the following:</p>
  
  <blockquote>
    <p>As suggestions are document-oriented, suggestion metadata (e.g. output) should now be specified as a field in the document. The support for specifying output when indexing suggestion entries has been removed. Now suggestion result entry’s text is always the un-analyzed value of the suggestion’s input (same as not specifying output while indexing suggestions in pre-5.0 indices).</p>
  </blockquote>
  
  <p>I've found that the original value is withing the _source field that is returned with the suggestion, but it's not really a solution for me because the key and structure changes based on the original object it comes from. </p>
  
  <p>I can add an extra 'output' field on the original object to but this isn't a solution for me either because in some cases I have a structure like this:</p>
  
  <pre><code>{
      "id": "c2358e0c-7399-4665-ac2c-0bdd44597ac0",
      "synonyms": ["All available colours", "Colors"],
      "autoComplete": [{
          "input": ["colours available all", "available colours all", "available all colours", "colours all available", "all available colours", "all colours available"]
      }, {
          "input": ["colors"]
      }]
  }
  </code></pre>
  
  <p>in ES 2.4 the structure was like this:</p>
  
  <pre><code>{
      "id": "c2358e0c-7399-4665-ac2c-0bdd44597ac0",
      "synonyms": ["All available colours", "Colors"],
      "SmartSynonym": [{
          "input": ["colours available all", "available colours all", "available all colours", "colours all available", "all available colours", "all colours available"],
          "output": ["All available colours"]
      }, {
          "input": ["colors"],
          "output": ["Colors"]
      }]
      }
  </code></pre>
  
  <p>This wasn't any problem when the 'output' field was present in every Autocomplete object.</p>
  
  <p>How can I return the original value in ES 5.1 (ex. All available colours) when asking "colours available all" in an easy way without doing to much manual lookups.</p>
  
  <p>Related Question from other user: <a href="https://stackoverflow.com/questions/41334232/output-field-in-autocomplete-suggestion/41423217#41423217">Output field in autocomplete suggestion</a></p>