Blogs

Deleting documents in SOLR

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)

More Blog Entries

ZYLK Industry Advanced Analytics se suma al foro de aplicaciones digitales para la Industria BeDIGITAL

Zylk Industry Advanced Analytics será una de las empresas que participen en el foro de...

Jornada sobre el sector energético-eléctrico y las tecnologías Open Source

El próximo  17 de mayo  se presentará en el Centro de Conocimiento Bake Eder de...

0 Comments