Tracy
Tracy

Reputation: 670

Azure Search Service REST API Delete Error: "Document key cannot be missing or empty."

I am seeing some intermittent and odd behavior when trying to use the Azure Search Service REST API to delete a blob storage blob/document. It works, sometimes, and then other times I get this:

The request is invalid. Details: actions : 0: Document key cannot be missing or empty.

enter image description here

Once I start getting this error, it's the same results when I try to delete any of the document/blobs stored in that index. I do have 'metadata_storage_path' listed as my index key (see below).
I have not been able to get the query to succeed again, or I would examine the differences in Fiddler.

enter image description here

I have also tried the following with no luck:

  1. Resetting and re-running the associated search indexer.
  2. Creating a new indexer & index against the same container and deleting from that.
  3. Creating a new container, indexer, & index and deleting from that.

Any additional suggestions or thoughts?

Upvotes: 0

Views: 798

Answers (2)

Chandan Y S
Chandan Y S

Reputation: 1078

For those who are still searching for the solution...

Instead of id,

{  
  "value": [  
    {  
      "@search.action": "delete",
      "id":"TDVRT0FPQXcxZGtTQUFBQUFBQUFBQT090fdf"
    } 
  ]  
} 

Use rid of your document to delete.

{  
  "value": [  
    {  
      "@search.action": "delete",
      "rid":"TDVRT0FPQXcxZGtTQUFBQUFBQUFBQT090fdf"
    } 
  ]  
} 

Because while creating Search Index, you might have selected rid as your unique id column.

Note: We can delete a document only with Unique Id Columns.

Upvotes: 0

Tracy
Tracy

Reputation: 670

Copy/paste error: "metadata_storage_name" should be "metadata_storage_path".

[Insert head-banging-on-wall emoji here.]

Upvotes: 0

Related Questions