[
https://issues.apache.org/jira/browse/LUCENE-5680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Shai Erera updated LUCENE-5680:
-------------------------------
Attachment: LUCENE-5680.patch
Patch add {{IndexWriter.updateDocValues(DocValuesUpdate...)}} API which acts
basically like {{delDocs(Term...)}} or {{delDocs(Query...)}} under the hood. I
kept the sugar updateNumeric/Binary for convenience.
What this allows you to do is e.g. update atomically a set of numeric and
binary fields. Also, I started by adding {{update(Term,Map<String,Long>)}} but
chose this method since it allows both mixing numeric/binary as well as is
easier to code (e.g. look at tests and how it's easier than creating a map). As
a side-effect, this allows you to atomically update fields of different sets of
documents, since each DocValuesUpdate has its own Term. I think that could be
nice, but I don't mind for now to make sure the Term of all updates is the same
(though, I don't see a reason to prevent it..).
I started to migrate tests to the new API (those that rely on a field and
control-field to assert a value), but haven't finished - I want to get some
feedback on the API first. Also, I want to add tests that update numeric/binary
DVs atomically (to exercise this capability). And I want to add tests that
update different sets of docs atomically (i.e. different Term in each update).
I'd appreciate some comments before I move on w/ the tests.
> Allow updating multiple DocValues fields atomically
> ---------------------------------------------------
>
> Key: LUCENE-5680
> URL: https://issues.apache.org/jira/browse/LUCENE-5680
> Project: Lucene - Core
> Issue Type: New Feature
> Components: core/index
> Reporter: Shai Erera
> Assignee: Shai Erera
> Attachments: LUCENE-5680.patch
>
>
> This has come up on the list (http://markmail.org/message/2wmpvksuwc5t57pg)
> -- it would be good if we can allow updating several doc-values fields,
> atomically. It will also improve/simplify our tests, where today we index two
> fields, e.g. the field itself and a control field. In some multi-threaded
> tests, since we cannot be sure which updates came through first, we limit the
> test such that each thread updates a different set of fields, otherwise they
> will collide and it will be hard to verify the index in the end.
> I was working on a patch and it looks pretty simple to do, will post a patch
> shortly.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]