Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Auto-indexing/sync of Azure SQL DB with Azure Search Works?

As per the below articles,

http://feedback.azure.com/forums/263029-azure-search/suggestions/6540846-auto-indexing-of-azure-sql-db

and

https://azure.microsoft.com/en-us/documentation/articles/search-howto-connecting-azure-sql-database-to-azure-search-using-indexers-2015-02-28/

Azure search will automatically sync/update the modified rows from the SQL table and update the same in the Azure Search index. But when i update the source table, it doesn't seem to affect my Azure Search index at all.

Can anyone clarify what does Auto-indexing/sync of Azure SQL DB with Azure Search really means?

Note: Strictly followed the instructions given in the article.

Datasource

POST https://servicename.search.windows.net/datasources?api-version=2015-02-28 api-key: <> Content-Type: application/json

{ "name" : "myazuresqldatasource", "type" : "azuresql", "credentials" : { "connectionString" : "Server=tcp:xxxxyyyy.database.windows.net.database.windows.net,1433;Database=dvdlist;User ID=aaaabbbb;Password=aaaaabbbbb;Trusted_Connection=True;Encrypt=False;Connection Timeout=30;"}, "container" : { "name" : "dvdlist" }, "dataChangeDetectionPolicy" : { "@odata.type" : "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy", "highWaterMarkColumnName" : "id" }, "dataDeletionDetectionPolicy" : { "@odata.type" : "#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy", "softDeleteColumnName" : "IsDeleted", "softDeleteMarkerValue" : "true" } }

Indexer

POST https://servicename.search.windows.net/indexers?api-version=2015-02-28 api-key: <> Content-Type: application/json

{ "name" : "myazuresqlindexer", "dataSourceName" : "myazuresqldatasource", "targetIndexName" : "sqlazureindex" }

like image 971
Ilyas F Avatar asked Nov 26 '22 05:11

Ilyas F


1 Answers

Even with a change tracking policy, the data on the index will not update until the indexer runs. You can either set the indexer to automatically run on a schedule (last I checked, the most often you can do is once every 5 minutes) or explicitly run the indexer using the api. Although if you need to update that often, you should probably be looking into using the api to post the documents rather than relying on the indexer.

like image 90
ashja99 Avatar answered Dec 06 '22 12:12

ashja99