弹性搜索:找到已删除的文档? [英] Elasticsearch: Found the deleted document?

查看:86
本文介绍了弹性搜索:找到已删除的文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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?

这是可重复的要点: https://gist.github.com/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 之后的.org / 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)

这篇关于弹性搜索:找到已删除的文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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