lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Trivial Update of "Per Steffensen/Update semantics" by Per Steffensen
Date Thu, 19 Apr 2012 11:46:49 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "Per Steffensen/Update semantics" page has been changed by Per Steffensen:
http://wiki.apache.org/solr/Per%20Steffensen/Update%20semantics?action=diff&rev1=20&rev2=21

  
  As you know by now, in order to link errors in responses properly with the 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 reference" for a document in a multi-document request,
and the handling of this particular document results in an error, the "part reference" in
the response 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/error-types are
relevant
-  * Error-namespace='''org.apache.solr.common.partialerrors.update''', error-name='''!DocumentDoesNotExist''':
Indicating that the document you tried to consistency-update does not exist (anymore)
+  * Error-code=409, error-namespace='''org.apache.solr.common.partialerrors.update''', error-name='''!DocumentDoesNotExist''':
Indicating that the document you tried to consistency-update does not exist (anymore)
-  * Error-namespace='''org.apache.solr.common.partialerrors.update''', error-name='''!DocumentAlreadyExists''':
Indicating that the document you tried to consistency-create already exists (or at least a
document with the same uniqueKey value)
+  * Error-code=409, error-namespace='''org.apache.solr.common.partialerrors.update''', error-name='''!DocumentAlreadyExists''':
Indicating that the document you tried to consistency-create already exists (or at least a
document with the same uniqueKey value)
-  * Error-namespace='''org.apache.solr.common.partialerrors.update''', error-name='''!VersionConflict''':
Indicating that the document you tried to consistency-update has changed since you fetched
it for update (version number has changed)
+  * Error-code=409, error-namespace='''org.apache.solr.common.partialerrors.update''', error-name='''!VersionConflict''':
Indicating that the document you tried to consistency-update has changed since you fetched
it for update (version number has changed)
-  * Error-namespace='''org.apache.solr.common.partialerrors''', error-name='''!WrongUsage''':
Indicating that you are using the features in a wrong 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
of the document is specified in the request. 
+  * Error-code=422, error-namespace='''org.apache.solr.common.partialerrors''', error-name='''!WrongUsage''':
Indicating that you are using the features in a wrong 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
of the document is specified in the request. 
  
  == Using it ==
  
@@ -162, +162 @@

  If errors occur the HTTP response status line will in general look like this
  
  {{{
- HTTP/1.1 400 <error-message>, error-type=<error-namespace>.<error-name>
+ HTTP/1.1 4XX <error-message>, error-type=<error-namespace>.<error-name>
  }}}
  
  ====== Single document updates ======
@@ -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. Example
  
  {{{
- HTTP/1.1 400 Attempt to update (_version_ > 0 specified explicitly in document) document
failed. Document does not exist, error-type=org.apache.solr.common.partialerrors.update.DocumentDoesNotExist
+ HTTP/1.1 409 Attempt to update (_version_ > 0 specified explicitly in document) document
failed. Document does not exist, error-type=org.apache.solr.common.partialerrors.update.DocumentDoesNotExist
  }}}
  
  ====== Multi document updates ======
@@ -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 corresponding partial error succeeded., error-type=org.apache.solr.common.partialerrors.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 corresponding partial error succeeded., error-type=org.apache.solr.common.partialerrors.PartialErrors
  }}}
  
  ======= Body =======
@@ -193, +193 @@

    ... responseHeader etc. ...
    <arr name="partialerrors">
      <lst>
-       <int name="error-code">400</int>
+       <int name="error-code">409</int>
        <str name="error-type">org.apache.solr.common.partialerrors.update.DocumentAlreadyExists</str>
        <str name="error-msg">Attempt to insert (_version_ &lt;= 0 specified explicitly
in document) document failed. Document already exists</str>
        <str name="partRef">refA</str>
      </lst>
      <lst>
-       <int name="error-code">400</int>
+       <int name="error-code">409</int>
        <str name="error-type">org.apache.solr.common.partialerrors.update.DocumentDoesNotExist</str>
        <str name="error-msg">Attempt to update (_version_ &gt; 0 specified explicitly
in document) document failed. Document does not exist</str>
        <str name="partRef">refN</str>
@@ -214, +214 @@

  {
    ... responseHeader etc. ...,
    "partialerrors":[
-     {"error-code":400,
+     {"error-code":409,
       "error-type":"org.apache.solr.common.partialerrors.update.DocumentAlreadyExists",
       "error-msg":"Attempt to insert (_version_ <= 0 specified explicitly in document)
document failed. Document already exists",
       "partRef":"refA"
      },{
-      "error-code":400,
+      "error-code":409,
       "error-type":"org.apache.solr.common.partialerrors.update.DocumentDoesNotExist",
       "error-msg":"Attempt to update (_version_ > 0 specified explicitly in document)
document failed. Document does not exist",
       "partRef":"refN"

Mime
View raw message