title: Parse ElasticSearch output with Jackson
body: <p>I'd like to parse the <code>_source</code> field of an ElasticSearch output. Here's an example of mine (it only contains one list of values):</p>
  
  <pre><code>"_source":
  {    
     "key1": "value1",    
     "key2": "value2"
  },
  {    
     "key1": "value1",    
     "key2": "value2"
  },
  etc.
  </code></pre>
  
  <p>I know how to get to <code>_source</code> but I don't know how to parse it. It seems to be a single node, isn't it?</p>
  
  <p>EDIT:</p>
  
  <p>I tried to 'reach' the <code>_source</code> field but it doesn't seem to be working:</p>
  
  <pre><code>final ArrayNode _source = (ArrayNode) jsonNode.path(ES_HITS).path(ES_HITS).path(ES_SOURCE);
  for (JsonNode value : _source)
  {
          try 
          {
              lov.add(mapper.treeToValue(value, Lov.class));
          } catch (JsonProcessingException e) {   logger.error("GetLibelles : add : error : JsonProcessingException", e); }
          }
  </code></pre>
  
  <p><strong>Lov class</strong></p>
  
  <pre><code>@JsonIgnoreProperties(ignoreUnknown = true)
  public class Lov extends ParentModel implements Serializable
  {   
      private String key1;
      private String key2;
      private String key3;
      private String key4;
  
      // getters and setters
  }
  </code></pre>
  
  <p>The error I'm getting:</p>
  
  <pre><code>com.fasterxml.jackson.databind.node.MissingNode incompatible with com.fasterxml.jackson.databind.node.ArrayNode
  </code></pre>
  
  <p>The ElasticSearch output:</p>
  
  <pre><code>{
   "took":0,
   "timed_out":false,
   "_shards":
   {
      "total":1,
      "successful":1,
      "failed":0
   },
  "hits":
  { 
     "total":1,
     "max_score":1.0,
     "hits":
      [
         {
            "_index":"bla",
            "_type":"lov",
            "_id":"PWA8bmEBRDuys8JUCwg10w",
            "_score":1.0,
            "_source":
            {    
                "key1": "value1",    
                "key2": "value2"
            },
            {    
                "key1": "value1",    
                "key2": "value2"
            }
         } 
      ]
  }}
  </code></pre>