how to add new Fields into solr schema

孤街浪徒 提交于 2019-12-25 06:23:08

问题


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.

  1. Schema.xml is not available in solrhome/server/solr/core/config directory so I copied one from solr-5.1.0\server\solr\configsets\basic_configs\conf to core\config and added fields into this.
  2. Now when we start Solr server I get WARN message that I should remove the schema.xml file as this is now managed-schema. These fields should be moved to managed-schema file, but this didn't happen.
  3. How Solr will move the database table to indexing. Does it convert each row into a document? Or I have to specify document structure somewhere?
  4. How I can re index the data previously imported?

回答1:


For Data import you need db-data-config.xml file where you will put your sql queries and configure it with SOLR For information about how to achieve the configuration go to this link




回答2:


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

References-

  1. solrconfig.xml - Read the doc for schemaFactory tag.


来源:https://stackoverflow.com/questions/30775018/how-to-add-new-fields-into-solr-schema

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