githubEdit

Import csv, xml data & Delete data

Today we are going to post data with different file

Import data

For json:

sudo nano main.json
{
  "id": "02",
  "first_name": ["Abishek"],
  "last_name": ["Kafle"],
  "title": ["DevOps and Security"],
  "cybername": ["anoint"]
}

Now post this main.json file using curl:

curl -X POST \
  -H 'Content-Type: application/json' \
  'http://127.0.0.1:8983/solr/coder/update/json/docs' \
  --data @main.json
  • You can also update json file as per your requirements.

  • After POST the json also restart the solr too:

For xml:

Post XML Data to Solr using curl:

Restart Solr:

Delete Data

For json:

1) Delete the specific data from json:

2) Delete all data from json:

For xml:

1) Delete the specific data from xml:

2) Delete all the data from xml:

  • After deleting documents, you should commit the changes to make them visible in Solr:

  • You can also use UI too but cli is preferred:

File Upload

You can also upload your file:

Last updated