更新 Solr 架构 [英] Updating Solr Schema

查看:24
本文介绍了更新 Solr 架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Solr 的新手,我很好奇更改/更新架构的过程是什么?

I am new to Solr and I'm curious what the procedure is for changing/updating the schema?

我注意到我可以轻松添加新字段而不会引起任何问题,但是每当我不得不更新字段时,都会引起问题.

I noticed that I can ADD new fields easily without causing any issues, but any time that I've had to UPDATE a field, it's caused issues.

由于引入系统的数据量很大,我将无法保留用于生成添加/文档查询到 solr 的原始数据,因此我将无法简单地重新索引所有内容发生变化.

Due to the amount of data ingested into the system, I will not be able to retain the original data that was used to generate the add/doc queries to solr, so I'll be unable to simply re-index everything when a change occurs.

例如,我希望将现有字段从字符串"类型更改为文本",并且文本字段类型有许多我想立即在现有数据上使用的标记器、过滤器等.

For instance, I am looking to change an existing field from the type "string" to "text", and the text field type has many tokenizers, filters, etc that I would like to put to use immediately on the existing data.

理想情况下,我正在寻找一种方法来更新架构、重新索引/优化现有数据集,并能够跟踪操作完成所需的时间.

I am ideally looking for a way to update the schema, re-index/optimize the existing data set, and be able to track how long it will take until the operation is complete.

如果有人能帮助我理解这一点,我将不胜感激!

If someone can help me understand this I would much appreciate it!

推荐答案

您必须重新索引.没有其他办法解决它.索引是与其输入相关的破坏性过程:文本是 切片和切块 以加快搜索速度,因此除非您在 存储字段.(stored=true 在 schema.xml 中的 Solr 字段定义中).如果您确实在存储字段中拥有它,那么您所要做的就是一个小过程遍历文档并重新发送它们以便重新索引.

You have to reindex. There is no other way around it. Indexing is a destructive process with relation to its input: text is sliced and diced to make it faster for search, so you can't recover the original text unless you had it in a stored field. (stored=true in your Solr field definition in schema.xml). If you did have it in a stored field, all you have to do is a little process to iterate through the documents and just re-send them so they're reindexed.

这篇关于更新 Solr 架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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