You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Claire Burke <oa...@hotmail.com> on 2021/12/16 20:35:27 UTC
Question about unintended deletions of Solr documents
If I enter a query in the q field (which is associated with the Request-Handler (qt) type /select), then I enter a delete query (which is associated with the Request-Handler (qt) type /update), I am finding that I did not just delete what was in the q field, based on the before and after snapshots of total documents and lw_data_source_s.
How can I construct my delete query so that I am only deleting what is in the q field in my /select query?
Re: Question about unintended deletions of Solr documents
Posted by Shawn Heisey <ap...@elyograg.org>.
On 12/16/2021 1:35 PM, Claire Burke wrote:
> How can I construct my delete query so that I am only deleting what is in the q field in my /select query?
You can't. The q parameter is not used by the update handler. The
query used for delete must be in the XML or JSON update request that is
sent to Solr as the body of the request. Here are some examples:
https://solr.apache.org/guide/6_6/uploading-data-with-index-handlers.html#UploadingDatawithIndexHandlers-DeleteOperations
https://solr.apache.org/guide/6_6/uploading-data-with-index-handlers.html#UploadingDatawithIndexHandlers-SendingJSONUpdateCommands
Thanks,
Shawn
Re: Question about unintended deletions of Solr documents
Posted by Andy Lester <an...@petdance.com>.
Can you please post specific queries that you are trying? Cut and pasted, not paraphrases.
> On Dec 18, 2021, at 3:13 PM, Claire Burke <oa...@hotmail.com> wrote:
>
> If I enter a query in the q field (which is associated with the Request-Handler (qt) type /select), then I enter a delete query (which is associated with the Request-Handler (qt) type /update), I am finding that I did not just delete what was in the q field, based on the before and after snapshots of total documents and lw_data_source_s.
>
> How can I construct my delete query so that I am only deleting what is in the q field in my /select query?
>