Search code examples
azureazure-cognitive-searchazure-search-.net-sdk

How to automatically update data source and index for a view in Azure Search


How can I update the exiting data source which is create from azure SQL view. What are steps I need to follow once when dealing with azure search for Database view.

My Data source& index should be updated once my view gets updates.


Solution

  • Assuming that by "updating the view" you mean adding more columns to the SELECT clause:

    • You don't need to update the datasource as long as you didn't change the name of the view or the credentials.
    • You will need to add newly added fields to your index definition. This doesn't happen automatically. Once you add new fields to your index schema, indexer will start populating those fields for newly indexed rows. To populate documents that have already been indexed, reset the indexer (in the portal or using the Reset Indexer API).