Search code examples
azuresearchazure-cognitive-search

How to reindex after adding a new field


I added a new field. This field is present in pretty much all the data rows that Azure search will be returned and needs to be indexed.

  1. Changed the VIEW that returns rows to AzureSearch to return a new row ("name")
  2. Added a new field to the Index ("name")
  3. Verified via Search Explorer that "name" field is returned in results for that index. It is currently always null (as expected) in the results.

Now how do I trigger a full reindex so the "name" field will contain values for ALL the rows, and not just for the NEW rows going forward.

(of course, I could delete the index and recreate a new one and repoint my code to the new index, but it seems needlessly brute force!)


Solution

  • Right, reset the indexer's change tracking state using Reset Indexer API. You can also reset the indexer in Azure Portal or using .NET client SDK.