如何将新字段添加到solr模式 [英] how to add new Fields into solr schema
问题描述
我正在从Mongo到Solr导入数据.为此,我需要向Solr模式中添加新字段.我正在使用solr服务器5.1.0.
I am doing data import from Mongo to Solr. For this I need to add new fields into the Solr schema. I am using solr server 5.1.0.
- Schema.xml在solrhome/server/solr/core/config目录中不可用,因此我将其中一个从solr-5.1.0 \ server \ solr \ configsets \ basic_configs \ conf复制到core \ config并在其中添加字段.
- 现在,当我们启动Solr服务器时,我收到警告消息,我应该删除schema.xml文件,因为它现在是托管模式.这些字段应移至托管模式文件,但这没有发生.
- Solr如何将数据库表移至索引.是否将每一行都转换成文档?还是我必须在某处指定文档结构?
- 如何重新索引先前导入的数据?
推荐答案
我找到了一种将字段添加到架构中的方法.如果有其他适当的方法,请提供您的输入.
1.将schema.xml文件添加到您的solr/core1/conf目录中.
2.将托管模式的所有内容复制到schema.xml
3.将新字段添加到schema.xml.
4.删除managed-schema.xml
5.重新启动solr,它将创建一个managed-schema.xml,并将schema.xml移至scheam.bkp
I have find a way to add the fields into schema. Please provide your input if there is any other proper way of doing it.
1. add schema.xml file into your solr/core1/conf directory.
2. copy all content of managed-schema into schema.xml
3. add the new fields into schema.xml.
4. delete the managed-schema.xml
5. restart the solr it will create a managed-schema.xml and will move schema.xml to scheam.bkp
参考资料-
- solrconfig.xml-读取schemaFactory标记的文档.
这篇关于如何将新字段添加到solr模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!