Azure AI solution, modification errors

Zahraa Daniel Naim 35 Reputation points
2023-12-23T14:15:11.74+00:00

Use the REST API to update the search solution

  1. Right-click the modify-search folder and open an integrated terminal

I reached this instruction and I ran

./modify-search

in the terminal , but i got these errors

-----

Updating the skillset...

Waiting for 0 seconds, press CTRL+C to----- ...

Updating the index...

{"error":{"code":"OperationNotAllowed","message":"Existing field 'language'

cannot be changed.","details":[{"code":"CannotChangeExistingField","message":"Existing field 'language' cannot be

changed."}]}}

Waiting for 2 seconds, press CTRL+C to quit ... 0

-----

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 5 seconds, press CTRL+C to quit ... 0

-----

Rerunning the indexer

this is my indexer file: Screenshot (23)

Screenshot (24)

this is my index file focusing on language and sentiment where they mentioned errors:

Screenshot (30)

Screenshot (31)

and this is the skillset file:

User's image

how can we understand this error and fix it?

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,070 questions
{count} vote

Accepted answer
  1. VarunTha 4,430 Reputation points Microsoft Vendor
    2023-12-24T00:48:46.6366667+00:00

    Hi Zahraa Daniel Naim,

    It appears that the errors you're encountering are associated with modifications to your Azure Cognitive Search solution, particularly in the skillset and indexer configurations. Let's break down the errors and discuss potential solutions:

    1.Existing field 'language' cannot be changed:

    {"error":{"code":"OperationNotAllowed","message":"Existing field 'language' cannot be changed.","details":[{"code":"CannotChangeExistingField","message":"Existing field 'language' cannot be changed."}]}}
    

    This error signals an attempt to alter a field ('language') in the skillset, which Azure Cognitive Search does not permit once fields are defined. To address this, consider creating a new skillset the configuration without modifying existing fields.

     

    2.Output field mapping specifies target field 'sentiment' that doesn't exist in the index:

    {"error":{"code":"","message":"Output field mapping specifies target field 'sentiment' that doesn't exist in the index"}}
    

    This error implies that the target field ('sentiment') specified in the output field mapping of your indexer doesn't exist in the index. Verify that the target field in the output field mapping exactly matches an existing field in your index. If the field doesn't exist, add it to your index schema.

     

    3.Rerunning the indexer:

    Rerunning the indexerResetting the indexerWaiting for 5 seconds, press CTRL+C to quit ... 0-----Rerunning the indexer
    
    

    After fixing the issues mentioned above, you can reset and rerun the indexer. This step ensures the application of changes made to the skillset and index.

     

    Here are the steps you can take to resolve these issues:

    1.Review the skillset configuration and ensure that you are not trying to modify existing fields.

    2.Validate the output field mapping in the indexer, ensuring the target fields exist in the index.
    3.Create a new skillset or modify the existing one without changing existing fields if necessary.
    4.Update the output field mapping to use valid target fields in the index. Refer to the https://learn.microsoft.com/en-us/azure/search/ for the specific API version you are using.
    5.Reset and rerun the indexer after implementing the required changes.

     
    Thoroughly review your Azure Cognitive Search configuration files, ensuring consistency among skillset definitions, index schemas, and indexer configurations.

     

    Referral thread link: Error when trying to run modify-search.cmd · Issue #62 · MicrosoftLearning/AI-102-AIEngineer (github.com)

     

    Additional reading: 

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

    https://learn.microsoft.com/en-us/azure/search/cognitive-search-common-errors-warnings

    If you have found the answer provided to be helpful, please click on the "Accept answer" button so that it is useful for other members in the Microsoft Q&A community.

    If you encounter any future issues, please feel free to contact us, and we will be pleased to assist you further.


1 additional answer

Sort by: Most helpful
  1. Mark Goles 5 Reputation points
    2024-05-14T00:24:36.4866667+00:00

    I am fairly sure this is related to the AI-102 Microsoft Learn course, "Implement Knowledge Mining with Azure AI Search", Lab 1 -- or at least, it is for me. The original poster's information matches mine exactly which makes me think this was also how he or she got there.

    It turns out the "index.json" lab file has two errors for the Language field:

    1. The Searchable field is specified as false. The instructions told us to leave it alone, which resulted in an initial value of true.
    2. The Analyzer field is null, but, again, the lab told us to leave it alone, which resulted in a value of "standard.lucene".

    Fixing these two errors results in a correct, clean run for me.

    1 person found this answer helpful.
    0 comments No comments