Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
415 views
in Technique[技术] by (71.8m points)

lucene - Updating Solr Schema

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...