• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • Maven
  • About
Apache Solr | XML Messages: Commit changes
  1. Notes
  2. Example of an XML message to commit changes
  3. Example of commit operation using the update request handler
  4. Example of commit operation using the update request handler (without the XML message)

  1. Notes
    Visit the Solr wiki page for more information: https://cwiki.apache.org/confluence/display/solr/UpdateXmlMessages

    Here's the structure of the commit operation:
    <commit waitSearcher="" softCommit="" expungeDeletes="" />

    Optional attributes for the "commit" element:
    • waitSearcher: (default: true) — if true, wait until a new searcher is opened and registered as the main query searcher, making the changes visible.

    • softCommit: (default: false) — if true, perform a soft commit.

    • expungeDeletes: (default: false) — if true, expunge deletes in the segments that the commit merged.
  2. Example of an XML message to commit changes
    Example:
    <commit waitSearcher="false" softCommit="true" expungeDeletes="true" />

  3. Example of commit operation using the update request handler
    Here's an example of an http request:
    $ curl http://localhost:8983/solr/COLLECTION-NAME/update \
    -H "Content-Type: text/xml" \
    --data-binary '<commit waitSearcher="false" softCommit="true" expungeDeletes="true" />'
  4. Example of commit operation using the update request handler (without the XML message)
    Here are examples of http requests (without the XML message):
    http://localhost:8983/solr/COLLECTION-NAME/update?commit=true

    http://localhost:8983/solr/COLLECTION-NAME/update?commit=true&waitSearcher=false&softCommit=true&expungeDeletes=true

    http://localhost:8983/solr/COLLECTION-NAME/update?stream.body=<commit/>
© 2025  mtitek