• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • Python
  • Ubuntu
  • Maven
  • Archived
  • About
Apache Solr | XML Messages: Add documents
  1. Notes
  2. Example of an XML message for adding new documents
  3. Add new documents using the update request handler
  4. Add new documents using the update request handler (stream.body)

  1. Notes
    Please visit this Solr wiki page for more information: https://cwiki.apache.org/confluence/display/solr/UpdateXmlMessages

    Here's the structure of the add operation:

    Optional attributes for the "add" element:
    • overwrite: (default: true) — if true, the new version of the document will replace the existing one.

    • commitWithin: (milliseconds) time for the document to be committed.

    Optional attributes for the "doc" element:
    • boost: (default: 1.0) a float number for the document boost value.

    Optional attributes for the "field" element:
    • boost: (default: 1.0) a float number for the field boost value.
  2. Example of an XML message for adding new documents
    Example: (Make sure that the fields "id", "field1", and "field2" are defined in your SchemaXml).
  3. Add new documents using the update request handler
    Here's an example of an http request:
  4. Add new documents using the update request handler (stream.body)
    Here's an example of an http request that uses the parameter stream.body:

    In order for this request to work, you need to enable Streaming in "solrconfig.xml":

    If you want to update the "solrconfig.xml" file directly in the Configset, make sure to reload all collections that use the updated Configset.
    Please visit this page for more details: http://lucene.apache.org/solr/guide/8_5/requestdispatcher-in-solrconfig.html
© 2025  mtitek