在Azure搜索上载文档后,可以将其删除吗? [英] Right after uploading a document on Azure Search, can I delete it?

查看:49
本文介绍了在Azure搜索上载文档后,可以将其删除吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)假设我使用Azure搜索API上传新文档:

1) Suppose I use the Azure Search API to upload a new document:

POST /indexes/[index name]/docs/index?api-version=[api-version]  

2)我收到HTTP代码201的响应(文档已成功创建)

2) I get a response with an HTTP code 201 (document was successfully created)

3)我再次使用API​​删除了新上传的文档

3) I use the API again to DELETE to newly uploaded document

我可以100%确定最终将删除该文档吗?还是如果索引编制过程没有完成,它会失败吗?

Can I be 100% sure that the document will be eventually deleted? Or will it fail if the indexing process has not complete?

推荐答案

我在Azure搜索团队中工作.一旦从索引API获取成功代码(HTTP 201),就意味着文档已成功建立索引.这意味着该文档存在于内部数据结构中,并且可以删除.已索引文档可能可能无法立即用于搜索,因为这需要内部刷新索引.

I work on the Azure Search team. Once you get a success code (HTTP 201) from the indexing API it implies that the document has been indexed successfully. This means that the document exists in the internal data structures and can be deleted. The indexed document might not be available for searching immediately as that requires an internal refresh of the index.

删除是懒惰的,即文档首先被标记为删除,然后最终从索引中删除以提高性能.这意味着在执行删除操作后几秒钟,删除的文档可能仍会显示在搜索结果中.我希望这能回答您的问题.

Deletion is lazy i.e. documents are first marked for delete and eventually removed from the index for performance. This means that the deleted documents might still show up in search results for a few seconds after executing the delete. I hope this answers your question.

这篇关于在Azure搜索上载文档后,可以将其删除吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆