Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Store _version as a numeric doc values field #3103
_version is today stored as a payload alongside the postings of the _uid field.
Storing it as a numeric doc values field would help save space, since _uid could be indexed with IndexOptions.DOCS_ONLY and numeric doc values formats can be very compact since they don't need to be byte-aligned. For example, all doc values formats in Lucene but SimpleText store numbers into blocks of packed integers.
referenced this issue
May 28, 2013
Simple. Give me any document that has been updated (version >= 2).
I actually started looking into creating a VersionFieldMapper a couple of weeks ago, but I have not had time to look into it more. This change could potentially simplify things or at least not have to rewrite things twice.
I'm not sure this is a good idea to try to expand the scope of _version. For example, if you delete a document and add again soon after a document with the same _uid, its _version won't be 1 although it is a new document which has never been updated?