4
votes

So I am moving from a Lucene based engine over to Azure Search....

All is going well except for when my Indexer runs, it removes all the documents from the Index and doesnt repopulate it with anything.

If i delete and recreate the Index it shows again but when the Indexer runs on the Hour (got it runnning hourly) it deletes all 4k + documents that were in there.

Is this a option I am missing when I create the Indexer

Steps that i use to create index

  1. Add new Datasource => Sql Server
  2. Creat Index (removing where necessary fields not to be indexed)
  3. Add Indexer

Initial run is all good, then when the indexer runs on the hour it clears the Document list

So the image below shows after the second index is run (on the hour)

Update : What I have noticed is I have run a query and it returns what is expected. result wise but the indexer still shows no documents enter image description here

enter image description here

1
Hi Martyn, indexer never deletes documents unless you use soft-delete option for your datasource. Can you show what your datasource JSON looks like?Eugene Shvets
Hey Eugene, I created it via the portal, I have update my original post with the steps I took regards MartynInept Adept

1 Answers

4
votes

Based on the screenshot, it looks like the indexer is configured with a change detection policy (Integrated change tracking or high water mark), so the second indexer run simply finds no new documents to index. Therefore, you see "0/0 documents succeeded" in the portal. To emphasize, indexer never deletes documents unless specifically requested with a soft-delete policy.