Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7704

delete by query throws document id missing mandatory uniqueKey field: Id when called by JSON but works fine via XML

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Invalid
    • 5.0
    • None
    • Build
    • None
    • Mac Yosemite, Java 1.8, 15" Macbook Pro(2015 model)

    Description

      Here are the curl commands on my local box.

      curl -v http://localhost:8983/solr/nZ/update -H "Content-Type: application/json" --data-binary '
      [
      {"delete" : { "query":"UserId:5629499534213120 AND SessionId:5066549580791808 AND Kind:event"}}
      ]'

      This outputs:
      {"responseHeader":

      {"status":400,"QTime":2}

      ,"error":{"msg":"Document is missing mandatory uniqueKey field: Id","code":400}}

      Running it via XML works:
      curl -v http://localhost:8983/solr/nZ/update -H "Content-Type: text/xml" --data-binary '
      <delete>
      <query>UserId:5629499534213120 AND SessionId:5066549580791808 AND Kind:event</query>
      </delete>
      '
      This outputs:
      <?xml version="1.0" encoding="UTF-8"?>
      <response>
      <lst name="responseHeader"><int name="status">0</int><int name="QTime">57</int></lst>
      </response>

      I also queried the documents I'm trying to delete. There were only 2 of them and they both had the Id fields. Id is the a string and the unique key. I'm thinking it's a bug since the XML call works unless my JSON format is wrong somehow. Please investigate.

      Thanks,
      Steve Suh

      Attachments

        Activity

          People

            Unassigned Unassigned
            stevesuh Steve Suh
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: