Azure SQL DB与Azure搜索的自动索引/同步如何工作? [英] How does Auto-indexing/sync of Azure SQL DB with Azure Search Works?

查看:49
本文介绍了Azure SQL DB与Azure搜索的自动索引/同步如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据以下文章,

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

Azure搜索将自动同步/更新SQL表中的已修改行,并在Azure搜索索引中对其进行更新.但是,当我更新源表时,它似乎丝毫不影响我的Azure搜索索引.

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.

任何人都可以澄清Azure SQL DB与Azure搜索的自动索引/同步的真正含义是什么吗?

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.

数据源

POST https://servicename.search.windows.net/datasources?api-version = 2015-02-28 api键:<>内容类型:application/json

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

{"name":"myazuresqldatasource","type":"azuresql",凭证":{"connectionString":服务器= tcp:xxxxyyyy.database.windows.net.database.windows.net,1433;数据库= dvdlist;用户ID = aaaabbbb;密码= aaaaabbbbb; Trusted_Connection = True; Encrypt = False;连接超时= 30;},"container":{"name":"dvdlist"},"dataChangeDetectionPolicy":{"@ odata.type":#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy","highWaterMarkColumnName":"id"},"dataDeletionDetectionPolicy":{"@ odata.type":#Microsoft.Azure.Search.SoftDeleteColumnDeletionDetectionPolicy","softDeleteColumnName":"IsDeleted","softDeleteMarkerValue":"true"}}

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

索引器

POST https://servicename.search.windows.net/indexers?api-version = 2015-02-28 api键:<>内容类型:application/json

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

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

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

推荐答案

即使采用了更改跟踪策略,索引上的数据也要等到索引器运行后才会更新.您可以将索引器设置为按计划自动运行(上一次我检查过,最常执行的操作是每5分钟一次),也可以使用api显式运行索引器.尽管如果需要经常更新,则可能应该考虑使用api发布文档,而不要依赖索引器.

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.

这篇关于Azure SQL DB与Azure搜索的自动索引/同步如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆