DocumentDB and Azure Search: Document removed from documentDB isn't updated in Azure Search index -
when remove document documentdb wont removed azure search index. index update if change in document. i'm not quite sure how should use "softdeletecolumndeletiondetectionpolicy" in datasource.
my datasource follows:
{ "name": "mydocdbdatasource", "type": "documentdb", "credentials": { "connectionstring": "accountendpoint=https://mydocdbendpoint.documents.azure.com;accountkey=mydocdbauthkey;database=mydocdbdatabaseid" }, "container": { "name": "mydocdbcollectionid", "query": "select s.id, s.title, s.abstract, s._ts sessions s s._ts > @highwatermark" }, "datachangedetectionpolicy": { "@odata.type": "#microsoft.azure.search.highwatermarkchangedetectionpolicy", "highwatermarkcolumnname": "_ts" }, "datadeletiondetectionpolicy": { "@odata.type": "#microsoft.azure.search.softdeletecolumndeletiondetectionpolicy", "softdeletecolumnname": "isdeleted", "softdeletemarkervalue": "true" } }
and have followed guide: https://azure.microsoft.com/en-us/documentation/articles/documentdb-search-indexer/
what doing wrong? missing something?
i describe understand softdeletecolumndeletiondetectionpolicy
in data source. name suggests, soft delete
policy , not hard delete
policy. or in other words, data still there in data source somehow marked deleted.
essentially way works periodically search service
query data source , checks entries deleted checking value of attribute defined in softdeletecolumndeletiondetectionpolicy
. in case, query documentdb collection , find out documents isdeleted
attribute's value true
. removes matching documents index.
the reason not working because deleting records instead of changing value of isdeleted
false
true
. never finds matching values , no changes done index.
one thing possibly instead of doing hard delete
, soft delete
in documentdb collection begin with. when search service re-indexes data, because document soft deleted source removed index. save storage costs @ documentdb level, delete these documents through background process time later.
Comments
Post a Comment