bwoodson
bwoodson

Reputation: 70

Solr REST Delete JSON Logs WARN and Doesn't Delete Document

I am trying to get a simple REST delete by ID using JSON on Solr 4.10.3.

Here is the cURL:

curl http://server:9080/solr/oaConfigTest/update -H 'Content-type:application/json' -d '[{"delete": {"id":"9e58bcd8"}}]'

I get the following response

Status: success
Response:
{
  "responseHeader": {
    "status": 0,
    "QTime": 0
  }
}

However, the document is not deleted (even after a commit) and I get a warning in the log as follows:

12/14/2015, 2:52:55 PM  WARN    DistributedUpdateProcessor  Unknown operation for the an atomic update,​ operation ignored: id

The actual name of the column is uuid, so I also tried the following:

curl http://server:9080/solr/oaConfigTest/update -H 'Content-type:application/json' -d '[{"delete": {"uuid":"9e58bcd8"}}]'

Status: success
Response:
{
  "responseHeader": {
    "status": 0,
    "QTime": 0
  }
}

12/14/2015, 3:21:55 PM  WARN    DistributedUpdateProcessor  Unknown operation for the an atomic update,​ operation ignored: uuid

Can someone help me with the actual JSON payload to delete by ID (field name UUID)?

Upvotes: 1

Views: 2035

Answers (1)

zagyi
zagyi

Reputation: 17518

If your json payload starts with [, Solr will think that you want to send a list of documents to be inserted/updated.

Your delete request should work if you leave out the starting and ending square brackets:

{
  "delete": {
    "id": "9e58bcd8"
  }
}

Upvotes: 1

Related Questions