You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Ryan McKinley <ry...@gmail.com> on 2007/02/02 01:47:46 UTC

addConditionally / allowDups / overwriteBoth

I'm having a bit of trouble deciphering the use case for these three
'add' options.  here is my best guss, can you correct me if i'm wrong

* addConditionally()
Only add the document if we have not already tried to add it and have
not committed yet

* allowDups()
add the document regardless of what you have done since last commit.

* overwriteBoth()
add the document.

What are these options trying to solve?  Is this the SQL equivalent of
 INSERT  (it has to be a new ID)
 UPDATE (the old id has to be there)
 REPLACE (insert or update - i don't care)

ryan

Re: addConditionally / allowDups / overwriteBoth

Posted by Bill Au <bi...@gmail.com>.
They are needed to support the optional attributes of the <add> in the
update XML message:

http://wiki.apache.org/solr/UpdateXmlMessages

allowDups() does not check for uniqueness of the key field.

overwriteBoth() overwrite both pending and committed

I think addConditionally() only adds the document if it is not already
pending (ie it will move overwrite it if it is already pending.  I am not
100% on this.  So some one please correct me if I am wrong here.

Bill

On 2/1/07, Ryan McKinley <ry...@gmail.com> wrote:
>
> I'm having a bit of trouble deciphering the use case for these three
> 'add' options.  here is my best guss, can you correct me if i'm wrong
>
> * addConditionally()
> Only add the document if we have not already tried to add it and have
> not committed yet
>
> * allowDups()
> add the document regardless of what you have done since last commit.
>
> * overwriteBoth()
> add the document.
>
> What are these options trying to solve?  Is this the SQL equivalent of
> INSERT  (it has to be a new ID)
> UPDATE (the old id has to be there)
> REPLACE (insert or update - i don't care)
>
> ryan
>