Return-Path: X-Original-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 53883CC07 for ; Thu, 19 Apr 2012 11:47:14 +0000 (UTC) Received: (qmail 28194 invoked by uid 500); 19 Apr 2012 11:47:14 -0000 Delivered-To: apmail-lucene-solr-commits-archive@lucene.apache.org Received: (qmail 28153 invoked by uid 500); 19 Apr 2012 11:47:14 -0000 Mailing-List: contact solr-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-commits@lucene.apache.org Received: (qmail 28145 invoked by uid 99); 19 Apr 2012 11:47:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2012 11:47:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2012 11:47:10 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 0B2AA746; Thu, 19 Apr 2012 11:46:49 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Thu, 19 Apr 2012 11:46:49 -0000 Message-ID: <20120419114649.22891.86306@eos.apache.org> Subject: =?utf-8?q?=5BSolr_Wiki=5D_Trivial_Update_of_=22Per_Steffensen/Update_sema?= =?utf-8?q?ntics=22_by_Per_Steffensen?= Auto-Submitted: auto-generated Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for chan= ge notification. The "Per Steffensen/Update semantics" page has been changed by Per Steffens= en: http://wiki.apache.org/solr/Per%20Steffensen/Update%20semantics?action=3Ddi= ff&rev1=3D20&rev2=3D21 = As you know by now, in order to link errors in responses properly with th= e documents in the request, you need to also add a "part reference" to all = of you documents in the request. If you dont explicitly provide a "part ref= erence" for a document in a multi-document request, and the handling of thi= s particular document results in an error, the "part reference" in the resp= onse will just be a random UUID and you will not be able to match errors in= the response with documents in the request. = - In the context of "update-add-docs" requests, 400 is always used as error= -code. The following error-types are relevant + In the context of "update-add-docs" requests, the following error-codes/e= rror-types are relevant - * Error-namespace=3D'''org.apache.solr.common.partialerrors.update''', e= rror-name=3D'''!DocumentDoesNotExist''': Indicating that the document you t= ried to consistency-update does not exist (anymore) + * Error-code=3D409, error-namespace=3D'''org.apache.solr.common.partiale= rrors.update''', error-name=3D'''!DocumentDoesNotExist''': Indicating that = the document you tried to consistency-update does not exist (anymore) - * Error-namespace=3D'''org.apache.solr.common.partialerrors.update''', e= rror-name=3D'''!DocumentAlreadyExists''': Indicating that the document you = tried to consistency-create already exists (or at least a document with the= same uniqueKey value) + * Error-code=3D409, error-namespace=3D'''org.apache.solr.common.partiale= rrors.update''', error-name=3D'''!DocumentAlreadyExists''': Indicating that= the document you tried to consistency-create already exists (or at least a= document with the same uniqueKey value) - * Error-namespace=3D'''org.apache.solr.common.partialerrors.update''', e= rror-name=3D'''!VersionConflict''': Indicating that the document you tried = to consistency-update has changed since you fetched it for update (version = number has changed) + * Error-code=3D409, error-namespace=3D'''org.apache.solr.common.partiale= rrors.update''', error-name=3D'''!VersionConflict''': Indicating that the d= ocument you tried to consistency-update has changed since you fetched it fo= r update (version number has changed) - * Error-namespace=3D'''org.apache.solr.common.partialerrors''', error-na= me=3D'''!WrongUsage''': Indicating that you are using the features in a wro= ng way - e.g. if you try to do a consistency-insert/update but there is no = uniqueKey defined in your Solr schema or no value for the uniqueKey-field o= f the document is specified in the request. = + * Error-code=3D422, error-namespace=3D'''org.apache.solr.common.partiale= rrors''', error-name=3D'''!WrongUsage''': Indicating that you are using the= features in a wrong way - e.g. if you try to do a consistency-insert/updat= e but there is no uniqueKey defined in your Solr schema or no value for the= uniqueKey-field of the document is specified in the request. = = =3D=3D Using it =3D=3D = @@ -162, +162 @@ If errors occur the HTTP response status line will in general look like t= his = {{{ - HTTP/1.1 400 , error-type=3D. + HTTP/1.1 4XX , error-type=3D. }}} = =3D=3D=3D=3D=3D=3D Single document updates =3D=3D=3D=3D=3D=3D @@ -170, +170 @@ If you only sent one document for update the error which occured handling= that single document will be encoded in the HTTP response status line. Exa= mple = {{{ - HTTP/1.1 400 Attempt to update (_version_ > 0 specified explicitly in doc= ument) document failed. Document does not exist, error-type=3Dorg.apache.so= lr.common.partialerrors.update.DocumentDoesNotExist + HTTP/1.1 409 Attempt to update (_version_ > 0 specified explicitly in doc= ument) document failed. Document does not exist, error-type=3Dorg.apache.so= lr.common.partialerrors.update.DocumentDoesNotExist }}} = =3D=3D=3D=3D=3D=3D Multi document updates =3D=3D=3D=3D=3D=3D @@ -178, +178 @@ If you sent multiple documents for update and the handling of some (might= be all) of them resulted in errors the HTTP response status line will look= like this = {{{ - HTTP/1.1 400 Some parts of the request resulted in errors. Need to check = response for partial errors. Documents sent for update with no correspondin= g partial error succeeded., error-type=3Dorg.apache.solr.common.partialerro= rs.PartialErrors + HTTP/1.1 412 Some parts of the request resulted in errors. Need to check = response for partial errors. Documents sent for update with no correspondin= g partial error succeeded., error-type=3Dorg.apache.solr.common.partialerro= rs.PartialErrors }}} = =3D=3D=3D=3D=3D=3D=3D Body =3D=3D=3D=3D=3D=3D=3D @@ -193, +193 @@ ... responseHeader etc. ... - 400 + 409 org.apache.solr.common.partialerrors.updat= e.DocumentAlreadyExists Attempt to insert (_version_ <=3D 0 spec= ified explicitly in document) document failed. Document already exists refA - 400 + 409 org.apache.solr.common.partialerrors.updat= e.DocumentDoesNotExist Attempt to update (_version_ > 0 specifi= ed explicitly in document) document failed. Document does not exist refN @@ -214, +214 @@ { ... responseHeader etc. ..., "partialerrors":[ - {"error-code":400, + {"error-code":409, "error-type":"org.apache.solr.common.partialerrors.update.DocumentAl= readyExists", "error-msg":"Attempt to insert (_version_ <=3D 0 specified explicitl= y in document) document failed. Document already exists", "partRef":"refA" },{ - "error-code":400, + "error-code":409, "error-type":"org.apache.solr.common.partialerrors.update.DocumentDo= esNotExist", "error-msg":"Attempt to update (_version_ > 0 specified explicitly i= n document) document failed. Document does not exist", "partRef":"refN"