On 3/7/23 12:58, Matthew Castrigno wrote:
I am having trouble deleting a document by id.
curl --location --request POST 'xxxxx:8983/solr/talix/update?commit=true' \
--header 'Content-Type: application/json' \
--data-raw '{'\''delete'\'': ["1E089335-892C-41F6-B767-632EB5361775"]}'
When I send a command like that to Solr 9.2.0-SNAPSHOT it complains,
with error message:
Cannot parse provided JSON: JSON Parse Error: char=\\,position=1
AFTER='{\\' BEFORE='\"delete\\\": [\"REDACTED'
If I remove the backslashes before the quotes on delete, then it returns
a response status 0 and the deleted document is gone.
So you should try removing the backslashes before the double quotes.
They are not needed because you surrounded the whole string with single
quotes, which means the shell will not parse them.
The request at the end of your message to delete by query has single
quotes in the json, and I believe the json standard requires double
quotes. And also, it would require backslashes for the quotes around
the query string, because those quotes need to be sent to Solr as-is.
json should not parse them.
Thanks,
Shawn