: If you cannot do this for whatever reason, I vaguely remember someone
: posting a link to a program they'd put together to do this for a
: docValues field, you'd have to search the archives to find it.
It was Toke - he generated DocValues for an existing index by writing an
IndexReader Filter
My first recommendation, of course, would be to re-index the corpus
with a new field. If possible, frankly, that would probably be less
effort than trying to hack in an ID after the fact as well as not as
error-prone.
If you cannot do this for whatever reason, I vaguely remember someone
posting a