gpt4 book ai didi

elasticsearch - 在 Elasticsearch 中添加没有现有父文档的子文档

转载 作者:行者123 更新时间:2023-12-02 22:25:33 25 4
gpt4 key购买 nike

当我在没有现有父文档的情况下为子文档建立索引时(我要传递随机的父ID),它可以正常工作并为子文档建立索引。我希望它会产生错误,因此我可以检查父文档是否存在。如何防止在没有正确的父文档的情况下对其进行索引?

最佳答案

这是ElasticSearch实际工作的方式(据我所知)。它没有引用内容。 ElasticSearch并不是注重引用完整性的RDBMS。 ES着重于性能,可用性等,这是您必须在某种程度上牺牲集成性的事情,因为在大多数情况下确保集成是一件昂贵的事情。 ES通常被视为(有时实际被用作)面向对象的NoSQL数据源。对于NoSQL数据库,缺少参照完整性是很常见的。

您可以在此处阅读有关此内容的更多信息-https://www.found.no/foundation/elasticsearch-as-nosql/

Most relational databases also let you specify constraints to define what is and isn’t consistent. For example, referential integrity and uniqueness can be enforced. You can require that the sum of account movements must be positive and so on. Document oriented databases tend not to do this, and Elasticsearch is no different.

关于elasticsearch - 在 Elasticsearch 中添加没有现有父文档的子文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24013053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com