solr配置文件
solr配置文件
@(OTHERS)[solr]
solr的配置文件主要有3份:
solr.xml:描述整個(gè)solr集群的配置,如主機(jī)名、端口號等信息。
solrconfig.xml:描述某個(gè)collection的配置信息,如索引、搜索的配置等。
schema.xml:描述某個(gè)collection的field信息。
其中后面2個(gè)是創(chuàng)建一個(gè)新collection所必備的文件,除此以外,還有一些可選的如stopwords.txt, synonyms.txt,protwords.txt, currency.xml等。
關(guān)于一個(gè)collection最基本的配置可以參考~/solr/server/solr/configsets/basic_configs中的文件,它就包含了上述所列的文件。
(一)solr.xml
(二)solrconfig.xml
(三)schema.xml
1、簡單demo
<?xml version="1.0" encoding="UTF-8" ?><schema name="example" version="1.5"><field name="_version_" type="long" indexed="true" stored="true"/><field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" /><field name="score" type="double" indexed="true" stored="true" required="true" multiValued="false" /><dynamicField name="*_s" type="string" indexed="true" stored="true"/><uniqueKey>id</uniqueKey><fieldType name="string" class="solr.StrField" sortMissingLast="true" /><fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/><fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/></schema>一般必須包括一些field以及這個(gè)field所屬類型的定義。
總結(jié)
- 上一篇: solr添加kerberos认证及授权
- 下一篇: 使用solr构建hbase二级索引