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 Wed, 18 Apr 2012 22:02:28 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=16&rev2=17

  ]
  }}}
  
- Note that is hard to see the difference between the "part reference" and a field called
"partref". If the first "field" in the document has the name "partref" it is not considered
as a field but as the "part reference". This means that if you have a real field called "partref"
you cannot send it as the first field inside a document.
+ Note that it is hard to see the difference between the "part reference" and a field called
"partref". If the first "field" in the document has the name "partref" it is not considered
as a field but as the "part reference". This means that if you have a real field called "partref"
you cannot send it as the first field inside a document.
  
  ===== CSV =====
  
@@ -172, +172 @@

  
  ====== Multi document updates ======
  
- If you sent multiple documents for update and the handling of some (might be all) of them
occured in errors the HTTP response status line will look like this
+ 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
@@ -180, +180 @@

  
  ======= Body =======
  
- In this subsection lets pretend we sent a multi-document request like the one shown (in
different formats) above, and that all documents succeeded except the two with "part reference"
refA and refN
+ In this subsection lets pretend we sent a multi-document request like the one shown (in
different formats) above, and that all documents succeeded except the two with "part reference"
refA and refN. The body of the HTTP response will look like show in the following subsections
  
  ======== XML ========
  
@@ -227, +227 @@

  
  ======== Other types ========
  
- By now you should have gotten the picture and be able to figure our how partial-errors will
be encoded in the response body if you requested response as Ruby or PHP or Python or ...
+ By now you should have gotten the picture and be able to figure our how partial-errors will
be encoded in the HTTP response body if you requested response as Ruby or PHP or Python or
...
  
  === SolrJ requests and responses ===
  
@@ -248, +248 @@

  docs.add(docN);
  }}}
  
+ No need to deal explicitly with "part references" - SolrInputDocument will handle it automatically
for you.
+ 
  ==== Sending requests ====
  
  {{{#!java
- SolrServer server = ... somehow you have a server ...
+ SolrServer server = ... somehow you have a SolrJ client (instance of SolrServer) ...
  
  UpdateResponse response = server.add(docs, ... your SolrParams ...).get();
  }}}
  
  ==== Checking responses for partial errors ====
  
- If you send many documents in you request it is possible that the insert/update-operation
will fail for some documents (due to "unique key constraints", "version checking" etc) while
it will not for other documents. Therefore you need to deal with partial errors
+ If you send multiple documents in your request it is possible that the insert/update-operation
will fail for some documents (due to "unique key constraints", "version checking" etc) while
it will not for other documents. Therefore you need to deal with partial errors
  
  {{{#!java
  UpdateResponse response;
@@ -275, +277 @@

  }
  }}}
  
- The possible exception types (subclasses of DocumentUpdatePartialError) of '''err''' are
java-Exception classes correspondig to the error-types mentioned above, where the package
of the classes correspond to the error-type-namespace and where the name of the classes correspond
to the error-type-name.
+ The possible classes (subclasses of DocumentUpdatePartialError) of '''err''' are java-Exception
classes correspondig to the error-types mentioned above, where the package of the class corresponds
to the error-type-namespace and where the name of the class correspond to the error-type-name.
  
  If you only send one document in your request you can catch the java-Exception corresponding
to the error-type directly
  

Mime
View raw message