Search code examples
azureazure-cognitive-search

Azure Search: Index Document count does not correspond to Indexer document count


My web app relies on the Index "crconnector" on Azure Search. The index crconnector shows me a document count of 22 (see below).

My Indexes

However, the respective Indexer "crindexer" contains only 16 documents (see below).

My Indexers

Why does the Document count of the Index (22) not match the Doc Succeeded Count of it's respective Indexer (16/16)? I already tried resetting + rerunning the indexer, which showed no effect.


Solution

  • The index can have documents in it for a number of reasons. Another indexer could have inserted documents, or the add, update, or delete documents api could have been used to insert documents.

    Resetting the indexer does not delete documents. If you have a data change detection policy configured on your data source, resetting only removes the high water mark on the indexer so it re-indexes your entire data source.

    In order to delete documents, you can add a soft delete policy to your data source. Note that you can't delete documents from your data source until your indexer has run again and picked up the deletes.