solr cloud - deleting and adding the same doc

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

solr cloud - deleting and adding the same doc

adfel70
Hi
in SolrCloud, if I send 2 different requests to solr - one with delete action of doc with id X and another with add action of doc with the same id - is it guaranteed that the delete action will occur before the add action?

Is it guaranteed that after all actions are done, the index will have doc X with its most updated state?

thanks.
Reply | Threaded
Open this post in threaded view
|

Re: solr cloud - deleting and adding the same doc

Joel Bernstein
This link has a good description of Solr's optimistic locking feature:
http://yonik.com/solr/optimistic-concurrency/

This is designed for READ-MODIFY-WRITE operations.  This will guarantee
that you are updating the same version of the document that you read. The
full delete of the document though would seem to defeat this as there would
be no versioned document to read from. You may have to model your deletes
as updates to a delete field to take advantage of this feature.


On Tue, Dec 17, 2013 at 9:54 AM, adfel70 <[hidden email]> wrote:

> Hi
> in SolrCloud, if I send 2 different requests to solr - one with delete
> action of doc with id X and another with add action of doc with the same id
> - is it guaranteed that the delete action will occur before the add action?
>
> Is it guaranteed that after all actions are done, the index will have doc X
> with its most updated state?
>
> thanks.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/solr-cloud-deleting-and-adding-the-same-doc-tp4107111.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



--
Joel Bernstein
Search Engineer at Heliosearch
Reply | Threaded
Open this post in threaded view
|

RE: solr cloud - deleting and adding the same doc

Tim Potter
In reply to this post by adfel70
Yes, SolrCloud uses a transaction log to keep track of ordered updates to a document. The latest update will be immediately visible from the real-time get handler /get?id=X even without a commit.

Cheers,
Timothy Potter
Sr. Software Engineer, LucidWorks
www.lucidworks.com

________________________________________
From: adfel70 <[hidden email]>
Sent: Tuesday, December 17, 2013 7:54 AM
To: [hidden email]
Subject: solr cloud - deleting and adding the same doc

Hi
in SolrCloud, if I send 2 different requests to solr - one with delete
action of doc with id X and another with add action of doc with the same id
- is it guaranteed that the delete action will occur before the add action?

Is it guaranteed that after all actions are done, the index will have doc X
with its most updated state?

thanks.



--
View this message in context: http://lucene.472066.n3.nabble.com/solr-cloud-deleting-and-adding-the-same-doc-tp4107111.html
Sent from the Solr - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: solr cloud - deleting and adding the same doc

Mark Miller-3
In reply to this post by adfel70
As long as you are not using the bulk or streaming API’s. Solrj does not currently respect delete/add ordering in those cases, though each of the two types are ordered. For the standard update per request, as long as it’s the same client, this is a guarantee.

- Mark

On Dec 17, 2013, at 9:54 AM, adfel70 <[hidden email]> wrote:

> Hi
> in SolrCloud, if I send 2 different requests to solr - one with delete
> action of doc with id X and another with add action of doc with the same id
> - is it guaranteed that the delete action will occur before the add action?
>
> Is it guaranteed that after all actions are done, the index will have doc X
> with its most updated state?
>
> thanks.
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/solr-cloud-deleting-and-adding-the-same-doc-tp4107111.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: solr cloud - deleting and adding the same doc

adfel70
Can you elaborate on bulk or streaming API’s?


Mark Miller-3 wrote
As long as you are not using the bulk or streaming API’s. Solrj does not currently respect delete/add ordering in those cases, though each of the two types are ordered. For the standard update per request, as long as it’s the same client, this is a guarantee.

- Mark

On Dec 17, 2013, at 9:54 AM, adfel70 <[hidden email]> wrote:

> Hi
> in SolrCloud, if I send 2 different requests to solr - one with delete
> action of doc with id X and another with add action of doc with the same id
> - is it guaranteed that the delete action will occur before the add action?
>
> Is it guaranteed that after all actions are done, the index will have doc X
> with its most updated state?
>
> thanks.
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/solr-cloud-deleting-and-adding-the-same-doc-tp4107111.html
> Sent from the Solr - User mailing list archive at Nabble.com.