You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2010/12/09 17:14:54 UTC

[Solr Wiki] Update of "UpdateXmlMessages" by MarkusJelsma

Dear Wiki user,

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

The "UpdateXmlMessages" page has been changed by MarkusJelsma.
The comment on this change is: info on update with add and delete.
http://wiki.apache.org/solr/UpdateXmlMessages?action=diff&rev1=27&rev2=28

--------------------------------------------------

  http://localhost:8983/solr/update?stream.body=%3Ccommit/%3E
  }}}
  
+ === Add and delete in a single batch ===
+ Mixing add and delete elements in a single batch will throw an ''Illegal to have multiple roots (start tag in epilog?)'' exception ([[https://issues.apache.org/jira/browse/SOLR-2277|SOLR-2277]]):
+ {{{
+ curl http://127.0.0.1:8983/solr/update/?commit=true -H "Content-Type: text/xml" --data-binary '<add><doc><field name="id">17</field></doc></add><delete><id>1234</id></delete>'; 
+ }}}
+ 
+ Instead, the add and delete elements must be enclosed in within an update element:
+ 
+ {{{
+ curl http://127.0.0.1:8983/solr/update/?commit=true -H "Content-Type: text/xml" --data-binary '<update><add><doc><field name="id">17</field></doc></add><delete><id>1234</id></delete></update>';
+ }}}
+