You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by David Svånå <da...@gmail.com> on 2017/10/30 11:35:47 UTC
In which order are commitwithin delete/add executed?
Hi,
If I send multiple instructions /update with a bunch of deletes and adds,
all having commitWithin specified, how can I make sure that the
instructions are executed in the same order as I send them in?
For example, if both a delete and an add is sent for the same ID, I want to
be able to control whether the delete happens before or after the add. If
the 'add' is more recent then I want to run the delete first (or only add),
or if the add is older, then I should run the delete.
Re: In which order are commitwithin delete/add executed?
Posted by David Svånå <da...@gmail.com>.
Perfect! Thanks Erick.
On Mon, Oct 30, 2017 at 3:57 PM, Erick Erickson <er...@gmail.com>
wrote:
> Solr executes the deletes and adds in the order they are received.
> Commitwithin isn't relevant to the execution order.
>
> commitWithin just controls when the accumulated changes are flushed to
> a new index segment and is global,
> not per request.
>
> Let's say Solr gets a request with commitWithin. It starts a timer for
> that core. When that timer expires, all
> accumulated updates (adds, deletes, whatever) are written out. For example
>
> T+0 add received with commitWithin set to 5 seconds, add for doc1
> T+1 delete for doc1 with commitWithin set for 5 seconds
> T+5 both the add and delete are written
>
> Best,
> Erick
>
> On Mon, Oct 30, 2017 at 4:35 AM, David Svånå <da...@gmail.com>
> wrote:
> > Hi,
> >
> > If I send multiple instructions /update with a bunch of deletes and adds,
> > all having commitWithin specified, how can I make sure that the
> > instructions are executed in the same order as I send them in?
> >
> > For example, if both a delete and an add is sent for the same ID, I want
> to
> > be able to control whether the delete happens before or after the add. If
> > the 'add' is more recent then I want to run the delete first (or only
> add),
> > or if the add is older, then I should run the delete.
>
Re: In which order are commitwithin delete/add executed?
Posted by Erick Erickson <er...@gmail.com>.
Solr executes the deletes and adds in the order they are received.
Commitwithin isn't relevant to the execution order.
commitWithin just controls when the accumulated changes are flushed to
a new index segment and is global,
not per request.
Let's say Solr gets a request with commitWithin. It starts a timer for
that core. When that timer expires, all
accumulated updates (adds, deletes, whatever) are written out. For example
T+0 add received with commitWithin set to 5 seconds, add for doc1
T+1 delete for doc1 with commitWithin set for 5 seconds
T+5 both the add and delete are written
Best,
Erick
On Mon, Oct 30, 2017 at 4:35 AM, David Svånå <da...@gmail.com> wrote:
> Hi,
>
> If I send multiple instructions /update with a bunch of deletes and adds,
> all having commitWithin specified, how can I make sure that the
> instructions are executed in the same order as I send them in?
>
> For example, if both a delete and an add is sent for the same ID, I want to
> be able to control whether the delete happens before or after the add. If
> the 'add' is more recent then I want to run the delete first (or only add),
> or if the add is older, then I should run the delete.