# How can I see the version number of an indexed document when searching?

**URL:** https://discuss.elastic.co/t/how-can-i-see-the-version-number-of-an-indexed-document-when-searching/12011
**Category:** Elasticsearch
**Created:** [May 17, 2013, 12:26pm UTC](https://discuss.elastic.co/t/how-can-i-see-the-version-number-of-an-indexed-document-when-searching/12011 "2013-05-17T12:26:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![svandenborne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/svandenborne/32/2217_2.png) [@svandenborne](https://discuss.elastic.co/u/svandenborne)
#### Post date: [May 17, 2013, 12:26pm UTC](https://discuss.elastic.co/t/how-can-i-see-the-version-number-of-an-indexed-document-when-searching/12011/1 "2013-05-17T12:26:42Z")

</div>

Hi,

How can I see the version number of an indexed document when searching?

e.g. the result in

curl -XGET '[http://localhost:9200/twitter/tweet/\_search](http://localhost:9200/twitter/tweet/_search)' -d '{  
"query" :{"match\_all": {} } }'

does not contain the version number?

I'm using elasticsearch version 0.20.4

Thanks!

Sandy

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)
#### Post date: [May 17, 2013, 12:31pm UTC](https://discuss.elastic.co/t/how-can-i-see-the-version-number-of-an-indexed-document-when-searching/12011/2 "2013-05-17T12:31:31Z")

</div>

Ask it to return the version. For example:

{  
"from" : 0,  
"size" : 20,  
"query" : {  
"match" : {  
"words" : {  
"query" : "doctor",  
"type" : "boolean"  
}  
}  
},  
_"version" : true_,  
"explain" : false,  
"fields" : ["\_ttl", "\_source"]  
}

Hope this helps!

(Note: I also as it to return the \_ttl and \_source fields. ES normally  
returns the \_source, but if you explicitly ask it for another field then  
you also need to explicitly ask it for \_source too.)

Regards,  
Brian

On Friday, May 17, 2013 8:26:42 AM UTC-4, Sandy Van den Borne wrote:

> Hi,
> 
> How can I see the version number of an indexed document when searching?
> 
> e.g. the result in
> 
> curl -XGET '[http://localhost:9200/twitter/tweet/\_search](http://localhost:9200/twitter/tweet/_search)' -d '{  
> "query" :{"match\_all": {} } }'
> 
> does not contain the version number?
> 
> I'm using elasticsearch version 0.20.4
> 
> Thanks!
> 
> Sandy

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 2:36am UTC](https://discuss.elastic.co/t/how-can-i-see-the-version-number-of-an-indexed-document-when-searching/12011/3 "2017-07-06T02:36:03Z")

</div>


