Thank you all for your input.

{“delete”: "1E089335-892C-41F6-B767-632EB5361775”}

Works for me.


 [cid:37cdc023-08da-4433-b882-8577129d03c6]

Matthew Castrigno

IHT Developer II

St. Luke’s Health System

•  208-859-4276
•  castr...@slhs.org<mailto:xxxxx...@slhs.org>

________________________________
From: Shawn Heisey <elyog...@elyograg.org>
Sent: Tuesday, March 7, 2023 3:36 PM
To: users@solr.apache.org <users@solr.apache.org>
Subject: Re: Delete silently failing.

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
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside the St. Luke's email system.

ZjQcmQRYFpfptBannerEnd

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


----------------------------------------------------------------------
"This message is intended for the use of the person or entity to which it is 
addressed and may contain information that is confidential or privileged, the 
disclosure of which is governed by applicable law. If the reader of this 
message is not the intended recipient, you are hereby notified that any 
dissemination, distribution, or copying of this information is strictly 
prohibited. If you have received this message by error, please notify us 
immediately and destroy the related message."

Reply via email to