弹性搜索:找到已删除的文档?

编程入门 行业动态 更新时间:2024-10-15 14:12:58
本文介绍了弹性搜索:找到已删除的文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正面临一个问题:我删除后可以找到已删除的文档。

I am facing a problem: I can find the deleted document right after I deleted it.

但是当我等待几秒钟时,删除的文档刚刚走了,我找不到使用相同命令的文档。

But when I wait for seconds, the deleted document is just gone and I cannot find the document by using the same command.

事实上,我知道发布新文档时有类似的东西,你需要等一下才能找到它。我认为这是可以接受的。 但是关于这种情况,任何想法?

In fact, I knew there is something similar when post a new document, you need to wait a while to be able to find it. I think it's acceptable for me. But about this case, any ideas?

这是可重复的要点: gist.github/hxuanji/89813ffe0979f12dba66

在要点中,删除文档后,我尝试XHEAD的文件,我收到404这意味着它被删除。到目前为止这么好。

In the gist, after I deleted the document, I try to XHEAD the document, I received 404 which means it had been deleted. So far so good.

但接下来我尝试查询它,我实际上可以找到已删除的文档。这是问题。然后我睡了2秒,再次查询相同的搜索命令,删除的文件就已经消失了。

But next I try to query it, I actually can find the deleted document. Here is the problem. And then I sleep 2 sec, query the same search command again, the deleted document is just gone.

看起来HEAD和_search之间有一些矛盾。

It seems there are some contradictions between HEAD and _search.

有这种情况的任何建议?这种情况是否正常?

Any suggestions of this situation ? Is this situation normal?

推荐答案

如果重要的是可重现, DELETE 之后的 / guide / en / elasticsearch / reference / current / indices-refresh.htmlrel =nofollow>刷新。这使得一次更改(不需要等待它,所以ES刷新/刷新更改)

It if is important to be reproduceable, refresh after the DELETE. This makes the change at once (no need to wait for it so ES flushes/refreshes the changes)

更多推荐

弹性搜索:找到已删除的文档?

本文发布于:2023-11-10 16:26:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1575887.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:弹性   文档

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!