Solr原子更新-使用已索引但未存储的字段更新文档 [英] Solr Atomic Update - update documents with fields that are indexed but not stored

查看:77
本文介绍了Solr原子更新-使用已索引但未存储的字段更新文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个核心,其中的文档带有一些已编入索引但未存储的字段(我们称其为A组字段).当我更新其他字段(建立索引并存储,让我们将其称为组B"字段)时,组A"字段的内容丢失了.

I have a core that have documents with some of fields indexed but not stored (let's call them Group A fields). When I update other fields (indexed and stored, let's call them Group B fields), contents of the Group A fields are lost.

在此Solr文档中,更新文档的一部分,原子更新文档的核心功能要求必须将架构中的所有字段都配置为已存储(stored ="true")或docValues(docValues ="true"),但作为目标的字段必须为配置为stored ="false".

In this Solr documentation, Updating Parts of Documents, "The core functionality of atomically updating a document requires that all fields in your schema must be configured as stored (stored="true") or docValues(docValues="true") except for fields which are destinations, which must be configured as stored="false".

因此,每次更新B组字段时都必须重新索引整个核心吗?有什么解决方法吗?

So, I must reindex the whole core every time when I update the Group B fields? Any work around?

推荐答案

是的,如果您不想存储字段,则必须为它们重新编制索引.

Yes, if you don't want to store the fields, you'll have to reindex them.

Solr中的原子更新被实现为获取文档,更改已更改字段的值,然后在内部重新提交文档.如果未存储这些值,则重新提交将丢失这些值.

An atomic update in Solr is implemented as fetch document, change values for those fields that has changed, and resubmit the document internally. If the values aren't stored, the resubmit will be missing those values.

您不必为整个核心重新编制索引,只需为已更改的文档重新编制索引.但是是的,如果您仅对某些字段使用原子更新,则必须将这些字段设置为存储或将docvalue设置为true.

You don't have to reindex the whole core, just the documents that have changed. But yes, those fields will have to be set as stored or with docvalues as true if you're going to use atomic updates for just certain fields.

这篇关于Solr原子更新-使用已索引但未存储的字段更新文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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