schema.xml详解:
参考:http://iamyida.iteye.com/blog/2213354
如果我们想把自定义子节点的xml文档post到Solr,需要修改schema.xml
(1)如下xml文档,准备post到Solr,我定义了三个子节点"zhuyu" "weiyu" "binyu",
<?xml version="1.0" encoding="UTF-8"?> <add> <doc> <field name="id">ttl1</field> <field name="zhuyu">http://rdf.ebi.ac.uk/terms/chembl#NonMolecular</field> <field name="weiyu">http://www.w3.org/2004/02/skos/core#prefLabel</field> <field name="binyu">"ChEMBL NonMolecular Class^^http://www.w3.org/2001/XMLSchema#string" .</field> </doc> <doc> <field name="id">ttl2</field> <field name="zhuyu">http://rdf.ebi.ac.uk/terms/chembl#NonMolecular</field> <field name="weiyu">http://www.w3.org/2000/01/rdf-schema#subClassOf</field> <field name="binyu">http://rdf.ebi.ac.uk/terms/chembl#Target .</field> </doc> </add>
(2)查看schema.xml (具体说明看上面参考的链接)
这里添加了三个子节点"zhuyu" "weiyu" "binyu"
<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" /> <field name="sku" type="text_en_splitting_tight" indexed="true" stored="true" omitNorms="true"/> <field name="name" type="text_general" indexed="true" stored="true"/> <field name="zhuyu" type="string" indexed="true" stored="true"/> <field name="weiyu" type="string" indexed="true" stored="true"/> <field name="binyu" type="string" indexed="true" stored="true"/> <field name="manu" type="text_general" indexed="true" stored="true" omitNorms="true"/> <field name="cat" type="string" indexed="true" stored="true" multiValued="true"/> <field name="features" type="text_general" indexed="true" stored="true" multiValued="true"/>
然后就可以提交到Solr上了