[英]How to change solr field type after data is already indexed
I had indexed a lot of data to solr
. 我已经收录了大量数据的
solr
。 One field named id is indexed as multivalued
and string
type (id:["123"])
. 一个名为id的字段被索引为
multivalued
和string
类型(id:["123"])
。
Now I want to change the field to int ie (id:123)
. 现在,我想将字段更改为int即
(id:123)
。
Can I change the field type and how to effects the already existing data? 我可以更改字段类型以及如何影响现有数据吗?
Yes, you can change the field type and also the multivalued
as false by modifying the field from the schema.xml
or managed-schema.
是的,您可以通过修改
schema.xml
或managed-schema.
的字段来更改字段类型以及将multivalued
更改为false managed-schema.
Once you modify the field type of field, you need to reindex
the data. 修改字段的字段类型后,需要重新
reindex
数据。
I would suggest to create another collection using modified/different configset
. 我建议使用修改后的/不同的
configset
创建另一个集合。 This modified configset
will have all the required changes to your schema.xml. 修改后的
configset
将对schema.xml进行所有必需的更改。
Once you upload this configSet
, create a new collection and start indexing the data in your new collection. 上传此
configSet
,创建一个新集合并开始为新集合中的数据建立索引。
Once indexing is complete. 一旦索引完成。 You can create an alias to the new collection and provide the alias name same as earlier collection, in order to avoid the downtime.
您可以为新集合创建一个别名,并提供与早期集合相同的别名,以避免停机。
After the alias creation whatever searches will happen will be executed on the new collection. 创建别名后,将对新集合执行任何搜索。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.