Inserting/updating data using the Solr HTTP API
Steps for updating a CQL-based core using the Solr HTTP API.
curl http://host:port/solr/keyspace.table/update? replacefields=false -H 'Content-type: application/json' -d 'json string'
To update a CQL-based core, use the following procedure:
Procedure
curl
command:$ curl http://localhost:8983/solr/mykeyspace.mysolr/update -H 'Content-type: application/json' -d '[{"id":"130", "quotes":"Life is a beach.", "name":"unknown", "title":"Life"}]'
The Solr convention is to use curl
for issuing
update
commands instead of using a browser. You do
not have to post a commit
command in the
update
command as you do in Solr, and doing so is
ineffective.
When you use CQL or CLI to update a field, DSE Search implicitly sets replacefields to false and updates individual fields in the Solr document. The re-indexing of data occurs automatically.
WARN [http-8983-2] 2013-03-26 14:33:04,450 CassandraDirectUpdateHandler2.java (line 697)
Calling commit with optimize is not recommended.
The Lucene merge policy is very efficient. Using the optimize command is no longer necessary and using the optimize command in a URL can cause nodes to fail.