# \_version linked to document's field

**URL:** <https://discuss.elastic.co/t/-version-linked-to-documents-field/12012>\
**Category:** Elasticsearch\
**Created:** [May 17, 2013, 1:30pm UTC](https://discuss.elastic.co/t/-version-linked-to-documents-field/12012 "2013-05-17T13:30:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgaertig](https://avatars.discourse-cdn.com/v4/letter/p/6a8cbe/32.png) [@pgaertig](https://discuss.elastic.co/u/pgaertig)\
**Post date:** [May 17, 2013, 1:30pm UTC](https://discuss.elastic.co/t/-version-linked-to-documents-field/12012/1 "2013-05-17T13:30:30Z")

</div>

Hi,

Is it to possible to link "\_version" special property to document's field  
the same way as "\_id" or "\_timestamp" properties?  
I tried to declare mapping this way:

"\_id": {  
"path": "product\_id",  
},  
\_version: {

- "path": "lock\_version",\*  
"version\_type": "external"  
},

However "\_version" is not updated to "lock\_version" value when document is  
added or updated.  
Documents which are submitted to ES in my system already contain  
"lock\_version" field. That is primarily  
used for optimistic locking in external database system, however ES could  
use it as well.

Thanks,  
Piotr

--  
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:** ![Chris\_Berry\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_berry_2/32/1366_2.png) [@Chris\_Berry\_2](https://discuss.elastic.co/u/Chris_Berry_2)\
**Post date:** [May 29, 2014, 2:10am UTC](https://discuss.elastic.co/t/-version-linked-to-documents-field/12012/2 "2014-05-29T02:10:32Z")

</div>

Hi,  
I am curious about the same thing. Is this possible?  
I am on ES 1.0.2, and my experiments show; No.  
Seem's like it should be doable though?  
Thanks,  
-- Chris

On Friday, May 17, 2013 8:30:30 AM UTC-5, pgaertig wrote:

> Hi,
> 
> Is it to possible to link "\_version" special property to document's field  
> the same way as "\_id" or "\_timestamp" properties?  
> I tried to declare mapping this way:
> 
> "\_id": {  
> "path": "product\_id",  
> },  
> \_version: {
> 
> - "path": "lock\_version",\*  
> "version\_type": "external"  
> },
> 
> However "\_version" is not updated to "lock\_version" value when document is  
> added or updated.  
> Documents which are submitted to ES in my system already contain  
> "lock\_version" field. That is primarily  
> used for optimistic locking in external database system, however ES could  
> use it as well.
> 
> Thanks,  
> Piotr

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a9c675f7-66ae-4aac-8eca-9a9fa41b7db8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a9c675f7-66ae-4aac-8eca-9a9fa41b7db8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:26am UTC](https://discuss.elastic.co/t/-version-linked-to-documents-field/12012/3 "2017-07-06T01:26:14Z")

</div>


