API to check availability of documents for search
Currently there is short delay before documents become available for search after they were created or updated.
For better consistency a blocking call that returns after all of the documents updates, creates, etc have been indexed and are ready for search would be great.
Or provide status api for the set of documents updates, creates, etc sent to understand if they have all been indexed and are ready for search
Thank you for your feedback. While it is unlikely we’ll address this suggestion in the near future, we’ll reassess based on the number of votes it receives.
Azure Search Product Team
Joseph Ficara commented
In addition the documentation and status codes returned regarding the existing functionally were not clear as of this writing, 2018-01-31. https://docs.microsoft.com/en-us/rest/api/searchservice/addupdate-or-delete-documents
Status code 200 (OK) is returned for a successful response, meaning that all items have been stored durably and will start to be indexed. Indexing runs in the background and makes new documents available (that is, queryable and searchable) a few seconds after the indexing operation completed. The specific delay depends on the load on the service.
Successful indexing is indicated by the status property being set to true for all items, as well as the statusCode property being set to either 201 (for newly uploaded documents) or 200 (for merged or deleted documents):
Paragraph 1 indicates that a status code of 200 means that the data is durable and indexing will occur a few seconds after. Paragraph 2 seems to indicate a status of true and a status code of 200 Successful indexing has occurred. This is actually not the case, a status of true and 200 still mean the data is only durable, there is no status that indicates indexing was successful.
Ideally it would be helpful to return a status code that indicates only that the data is durable, a 204 could be used in this case, which from the Azure Search documentation means "Success on PUT or POST. Index or documents uploaded successfully.", and a 200 meaning that its durable and indexing has been completed.
Using a status of 200 to indicate its durable but indexing is still needed reduces the clarity of the interface as there is no provision for a status that indicates the data is durable and indexing has completed.