简体   繁体   English

数据已建立索引后如何更改Solr字段类型

[英]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的字段被索引为multivaluedstring类型(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.xmlmanaged-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.

相关问题 向已经建立索引的数据Solr添加一个额外的字段 - Adding an extra field to already indexed data Solr 设置要索引的Solr字段 - Set a Solr field to be indexed 应该如何在Solr中索引xlsx格式的数据? - How should data in xlsx format be indexed in Solr? 如果它是主键并且被索引,如何更改列的数据类型? - How to change the data type of a column if it is the primary key and is indexed? @EmbeddedId 字段是否已经索引了 Spring-data-jpa 实体? - Is a Spring-data-jpa entity already indexed by the @EmbeddedId field? Solr使用索引字段进行半径的空间搜索? - Solr spatial search using an indexed field for radius? 修改现有的Solr 7.6.0 / Lucene索引(将另一个字段“ URL”添加到已建立索引的文件(.pdf,.docx等)) - Modify existing Solr 7.6.0 / Lucene index (add another field 'URL' to an already indexed file (.pdf, .docx etc.)) 长期未使用spring-data-neo4j索引的类型的字段 - Field of type long not being indexed with spring-data-neo4j 通过URL进行索引时,如何删除SOLR索引[内容字段]内容中的脚本和样式? - How to remove Scripts and Styles in content of SOLR Indexes[content field], while indexed through URL? 从Solr索引中删除索引数据 - Remove indexed data from solr index
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM