Digital Experience & Hybrid Data AI

Deleting documents in SOLR

Imagen de Cesar Capillas
Cesar Capillas
Solr banner

Simple commands for deleting indexed documents in SOLR

Just a simple tip today for deleting documents in SOLR via REST API and post command. Consider that you have a collection called gettingstarted and some document with id 44C:

Via post command:

$ post -c gettingstarted -d '<delete><id>44C</id></delete>'

Via REST API:

$ curl -X POST "http://localhost:8983/solr/gettingstarted/update?commit=true" -H "Content-Type: text/xml" --data-binary "<delete><id>44C</id></delete>"
$ curl -X POST "http://localhost:8983/solr/gettingstarted/update?commit=true" -H "Content-Type: application/json" --data-binary '{"delete": {"id":"44C"}}'

You may find more scripts in my gist (delete-by-id.sh, delete-by-id2.sh & delete-by-id3.sh)

Note: Tested in SOLR 6.6 (Cloud)

Si te ha parecido interesante comparte este post en RRSS

Facebook
LinkedIn
Telegram
Email

Leer más sobre temas relacionados

innovación / i+d
Iñigo Angulo

Raise Suite

Desde hace unos meses ZYLK participa en el proyecto Raise Suite, iniciativa liderada por Aristotle University of Thessaloniki (AUTH), compuesta por 25 socios y respaldada

Leer más »

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Solr banner