Ilyas F
Ilyas F

Reputation: 543

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" }

Upvotes: 5

Views: 1396

Answers (2)

ashja99
ashja99

Reputation: 388

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.

Upvotes: 1

subhash singh
subhash singh

Reputation: 257

Basically on Azure Search we have to create index with specific columns and we need to push data in defined index format on Azure Search index using scheduler time to time.

Auto-indexing/sync of Azure SQL DB with Azure Search is a technique to make this process easy and manageable, where Azure sql is managing the sync process.

Upvotes: -1

Related Questions