lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <>
Subject [jira] [Updated] (LUCENE-5680) Allow updating multiple DocValues fields atomically
Date Sun, 18 May 2014 11:08:14 GMT


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:
>             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 ( -- 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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message