Does schema change require reindex of all Solr documents or just documents containing the changed schema fields?

泪湿孤枕 提交于 2019-12-05 16:51:30
  • If you index documents with the same id (unique key defined in your schema.xml), then you don't have to delete them before indexing. Indexing a document with the same Id will overwrite existing documents.

Just keep in mind that when you index a document with the same Id, the old document is automatically marked as 'deleted' but not physically deleted from the index. And Term Vector Analysis is applied to all documents (including deleted documents)

If you need to physically clean up deleted documents, you need to perform index 'Optimize', you can do this from solr admin interface.

  • if you make a change to the schema, you don't have to index everything. Re-indexing only affected documents is sufficient.

So If I were in your place, I would not even delete anything. I would just re-index only the few thousands affected documents. Then do optimize later to clean up the index.

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