简体   繁体   English

使用动态字段建立索引后向Solr添加新字段

[英]Adding new fields to solr after indexing with Dynamic fields

I am trying to learn and implement Solr for a customer use case where we faced a question what if we need to add more fields(for storing and indexing) is it possible without re-indexing or reloading the data, and when I searched over the net for it and at most of the places it was given that while adding new field that need not to be indexed is okay and can be achieved but we want to add a new indexed field then we have to reload/reindex the data. 我正在尝试为客户用例学习和实现Solr,在该案例中,我们面临一个问题:如果我们需要添加更多字段(用于存储和建立索引),是否可以在不重新建立索引或重新加载数据的情况下进行搜索?在大多数情况下,它都可以实现网络存储,尽管添加不需要索引的新字段是可以的,并且可以实现,但是我们想要添加新的索引字段,则必须重新加载/重新索引数据。 But then there are dynamic fields in schema.xml which can be used to map to new fields whether they need to be indexed or just stored. 但是,schema.xml中有动态字段,可用于映射到新字段,无论它们是需要索引还是仅需要存储。 My questions is: If that is a possible workaround to add new fields to existing data/index then why is is not suggested? 我的问题是:如果这是将新字段添加到现有数据/索引的可行解决方法,那么为什么不建议这样做? is there any overhead associated with it or it's fine to use dynamic fields? 是否有任何相关的开销,还是可以使用动态字段?

Dynamic fields are there so Solr knows how to map your new content to the types. 动态字段在那里,因此Solr知道如何将新内容映射到类型。 You would still need to reindex the actual documents. 您仍然需要为实际文档重新编制索引。

Solr has API/format to partially update a document, so you only need to provide additional information, but under the covers that's still reindexing and you need to be careful that all fields are stored. Solr的API /格式可以部分更新文档,因此您只需要提供其他信息即可,但是在幕后,它仍在重新编制索引,因此您需要注意所有字段的存储。 If a field is store=false and you try partial reindexing, that value will disappear. 如果字段为store = false,并且您尝试部分重新索引编制,则该值将消失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM