title: How to fetch version from search results using spring-data-elasticsearch
body: <p>I am executing <a href="https://docs.spring.io/spring-data/elasticsearch/docs/current/api/org/springframework/data/elasticsearch/core/query/NativeSearchQuery.html" rel="nofollow noreferrer">NativeSearchQuery</a> in Springframework to execute search operation. I am trying to fetch &quot;_version&quot; value from response through Java API. The following is the sample request and response related to this use case</p>
  <pre><code>GET /my-index/_doc/foo-bar
  
  {
    &quot;_index&quot; : &quot;my-index&quot;,
    &quot;_type&quot; : &quot;_doc&quot;,
    &quot;_id&quot; : &quot;foo-bar&quot;,
    &quot;_version&quot; : 88,
    &quot;_seq_no&quot; : 169,
    &quot;_primary_term&quot; : 1,
    &quot;found&quot; : true,
    &quot;_source&quot; : {
      &quot;_class&quot; : &quot;fooBar&quot;,
      &quot;value&quot; : 1250087,
      &quot;creatdDateTime&quot; : &quot;20210203T124928.913Z&quot;,
      &quot;ModifiedDateTime&quot; : &quot;20210203T124928.913Z&quot;
    }
  }
  </code></pre>
  <p>I am trying to fetch _version=88 from above response through JAVA API using NativeSearchQuery. How to get this value</p>