DeleteByQuery works through an XML call but not JSON to request multiple conditions

Is Solr removing query syntax when passing JSON data and XML data? Solr the docs pretty vague. I am using Solr 5.0.0 for Mac OSX on Java 1.8.

Here are the curl commands in my local field.

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"
    }
}
]

It is output:

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

Running through 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 removes documents and exits:

<?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 requested documents that I am trying to delete. There were only 2 of them, and both of them had ID fields. Id is a string and a unique key for the circuit. Is the query syntax for multiple conditions different to JSON than XML?

+4
source share
1 answer

JSON Solr . , , . external [] - .

{} - .

. , . , Solr / , . .

0

All Articles