Unable to successfuly modify the search

Arthur Zaslawski 15 Reputation points
2024-02-17T20:54:33.5533333+00:00

I'm on 01-azure-search exercise, specifically "Use the REST API to update the search solution" step located at this url:
https://microsoftlearning.github.io/mslearn-knowledge-mining/Instructions/Exercises/01-azure-search.html

I'm getting below output specifically "OperationNotAllowed"

"PS E:\Projects\mslearn-knowledge-mining\Labfiles\01-azure-search\modify-search> .\modify-search.cmd

Updating the skillset... Waiting for 0 seconds, press CTRL+C to quit ...

Updating the index... {"error":{"code":"OperationNotAllowed","message":"Existing field 'metadata_storage_name' cannot be changed.","details":[{"code":"CannotChangeExistingField","message":"Existing field 'metadata_storage_name' cannot be changed."}]}} Waiting for 0 seconds, press CTRL+C to quit ...

Updating the indexer... {"error":{"code":"","message":"Output field mapping specifies target field 'sentiment' that doesn't exist in the index"}}----- Resetting the indexer Waiting for 0 seconds, press CTRL+C to quit ...

Rerunning the indexer"

Azure | Azure Training
{count} votes

2 answers

Sort by: Most helpful
  1. SiddeshTN 5,345 Reputation points Microsoft External Staff
    2024-02-18T12:08:09.5066667+00:00

    Hi Arthur Zaslawski,

    Thank you for reaching out to Microsoft Q&A forum.

    The "OperationNotAllowed" error message signals an attempt to alter a field that's immutable. Specifically, the error points out an effort to modify the existing field named metadata_storage_name, which is not allowed.

    Within Azure Cognitive Search, some fields are designated as system-managed and are handled exclusively by the system. metadata_storage_name falls into this category, and ordinarily, it's advised not to endeavor to change it.

    To address this problem:

    1.Check your modification script file to ensure that you're not trying to alter the metadata_storage_name, field.

    2.If adjustments to other fields are necessary, ensure they comply with the guidelines outlined by Azure Cognitive Search.

    After rectifying the script, attempt the modification again to update your Azure AI Search solution.

    Please review the provided document for guidance before creating an Azure AI Search service: https://learn.microsoft.com/en-us/azure/search/search-create-service-portal

    Please check this issue as another customer has encountered the same problem, but it has been resolved: https://github.com/MicrosoftLearning/AI-102-AIEngineer/issues/62

    If the issue continues, please let us know, and we'll gladly provide additional assistance.

    If the solution provided has helped resolve the problem, please consider giving it a "thumbs up".

    Thank you.

    1 person found this answer helpful.

  2. Alex Pavlunenko 5 Reputation points
    2025-01-31T22:17:19.5566667+00:00

    Update index.json and change that section as follows:

    {

    "name": "metadata_storage_name",

    "type": "Edm.String",

    "facetable": false,

    "filterable": true,

    "key": false,

    "retrievable": true,

    "searchable": false,

    "sortable": true,

    "indexAnalyzer": null,

    "searchAnalyzer": null,

    "synonymMaps": [],

    "fields": []

    },

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.