Index creation does not work properly

Hello there,

I had a collection of about 1000-2000 documents.
I deleted all the documents in this collection and wanted to create a new index.

Although it has been a long time, the index has not been created and it still seems to be working.

I guess the index creation system should not be like this.
Is there anything that can be done about this?

Completed recently.
If it took that long for an empty collection, I worry how long it would take in cases where there are thousands of documents.

Hi, @hasimyerlikaya since you deleted the documents you would have a delete event for each one of them and the Index creation would be handled by a background task. To make things faster, you should delete the collection and then create an Index .

Here is a little Note from the documentation.

For collections with more than 128 events (which include document creation, updates, and deletions), or those that use a wildcard in their source definition, indexing is handled by a background task, and you may have to wait a short period before the index returns values. Until the indexing task is complete, the index is an “inactive” index.

Thank you.

If I do this, are the indexes and security settings that I created earlier and linked to this collection affected?

I didn’t do it because I was worried about this.

1 Like

You are right. I should have warned you about it. Deleting a collection would delete everything related to that Collection. So, maybe you are better off waiting for a bit for the index to be active. Do you know how long you had to wait for the index to be active?

Index creation completed after 2 hours.
I do not think that I will ever delete all the documents and create an index again.
But if it happens, I wait is not a problem.

Because there are many indexes and settings.
Better to wait than to rearrange them.

Thanks for your help.