-1

Is there a way for patch/partial update in Azure cognitive search? I need to update just one field in the search document.

We have 100 fields (including complex types) in the search document. If I want to just update one single field which is of complex type (list of objects). Is there an option available to update just one property?

Or do we need to always read the complete existing document, update the required field and merge?

  • I am also facing this issue. Have you found a solution to this problem? – peco Oct 07 '22 at 08:31
  • 1
    yes, partial update option is available in Azure search. Please pass only the primary object and the fields which should be updated. – Amarjeet Kumar Oct 08 '22 at 16:43
  • @AmarjeetKumar I have tried it, but it doesn't work. If the index has a string collection for example and you don't provide it in the merge it fails – Massimiliano Peluso May 01 '23 at 10:21

1 Answers1

0

If you are trying to update your index definition, you may have to drop and rebuild unless you are doing any of the following:

  • Add new fields to a fields collection

  • Add newly created fields to a suggested

  • Add or change scoring profiles

  • Add or change encryption keys

  • Add new custom analyzers

  • Change CORS options

  • Change existing fields with any of these three modifications:

  • Change retrievable (values are true or false) Change searchAnalyzer (used at query time) Add or change synonymMaps (used at query time)

  • Change CORS options

  • Change existing fields with any of these three modifications:

    • Change retrievable (values are true or false)
    • Change searchAnalyzer (used at query time)
    • Add or change synonymMaps (used at query time)

See https://learn.microsoft.com/en-us/rest/api/searchservice/update-index for more information.

If you want to update documents, you can use the "mergeOrUpload" search action to update any documents in your index.

See https://learn.microsoft.com/en-us/rest/api/searchservice/addupdate-or-delete-documents for more information.

Farzzy - MSFT
  • 290
  • 1
  • 10