0

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.

Champ
  • 690
  • 1
  • 7
  • 13

1 Answers1

1

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).
Eugene Shvets
  • 4,561
  • 13
  • 19
  • Thanks for the quick reply, its working. https://{SearchName}.search.windows.net/indexers/IndexerName/reset?api-version=2016-09-01) with successful 204(No content). But any idea how much time does it takes for document count of 150(Its a view). And best way to achieve the less time while the reseting the indexer. – Champ Nov 20 '17 at 11:07
  • How much time does indexing take? That depends on your indexer schedule - indexing is not real time. However, you can run the indexer on demand after updating the view. See Run Indexer API. – Eugene Shvets Nov 20 '17 at 17:21
  • Surprisingly https://{SearchName}.search.windows.net/indexers/{IndexerName‌}/reset?api-version=2‌​016-09-01) not working all the time. after some changes in the table(those changes will reflects in the target view), When I reset the indexer again the document count is not getting updated. Am I missing something. – Champ Nov 20 '17 at 17:59
  • Reset itself doesn't do the indexing - it just clears the change tracking state so that next time the indexer runs (either on schedule or on demand when you call the Run API), it will reindex from scratch. – Eugene Shvets Nov 20 '17 at 18:05
  • hi Eugene, When we force indexer to run again, it only captures added and modified rows but not deleted rows from the view. My assumption is that when I do force run using rest API, view will re-run again and captures all added, modified and deleted rows. Its really confusing. – Champ Nov 21 '17 at 04:17