Updating Solr Schema

不羁岁月 提交于 2019-12-18 09:18:43

问题


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.

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!


回答1:


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.



来源:https://stackoverflow.com/questions/6038920/updating-solr-schema

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!