更新Solr模式 [英] Updating Solr Schema
问题描述
我是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.
由于摄取到系统中的数据量大,我将无法保留用于生成用于查询的add/doc查询的原始数据,因此当出现以下情况时,我将无法简单地重新索引所有内容发生变化.
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!
推荐答案
您必须重新编制索引.别无选择.索引是与其输入有关的破坏性过程:文本为切片并切丁以使其更快地进行搜索,因此,除非您在遍历文档,然后重新发送,以便重新索引.
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屋!