<?xml version="1.0" encoding="UTF-8" ?>
略...
<!--
这是Solr的schema文件,应该命名为schema.xml,并且在solr home的conf目录下
(如,默认在./solr/conf/schema.xml).
有关如何根据需要定制化该文件,请参照:
http://wiki.apache.org/solr/SchemaXml 性能须知: 这里包含了很多实际应用不需要的可选项。 为改善性能,你可以:
- 尽量将所有仅用于搜索,而不用于实际返回的字段设置stored="false";
- 尽量将所有仅用于返回,而不用于搜索的字段设置indexed="false";
- 去掉所有不需要的copyField 语句;
- 为了达到最佳的索引大小和搜索性能,对所有的文本字段设置indexed="false",
使用copyField将他们拷贝到“整合字段”name="text"的字段中,使用整合字段进行搜索;
- 使用server模式来运行JVM,同时将log级别调高, 避免输出所有请求的日志。
-->
<schema name="example" version="1.5">
略...
<fields>
<!-- fields各个属性说明:
name: 必须属性 - 字段名
type: 必须属性 - <types>中定义的字段类型
indexed: 如果字段需要被索引(用于搜索或排序),属性值设置为true
stored: 如果字段内容需要被返回,值设置为true
docValues: 如果这个字段应该有文档值(doc values),设置为true。文档值在门
面搜索,分组,排序和函数查询中会非常有用。虽然不是必须的,而且会导致生成
索引变大变慢,但这样设置会使索引加载更快,更加NRT友好,更高的内存使用效率。
然而也有一些使用限制:目前仅支持StrField, UUIDField和所有 Trie*Fields,
并且依赖字段类型, 可能要求字段为单值(single-valued)的,必须的或者有默认值。
multiValued: 如果这个字段在每个文档中可能包含多个值,设置为true
termVectors: [false] 设置为true后,会保存所给字段的相关向量(vector)
当使用MoreLikeThis时, 用于相似度判断的字段需要设置为stored来达到最佳性能.
termPositions: 保存和向量相关的位置信息,会增加存储开销
termOffsets: 保存 offset 和向量相关的信息,会增加存储开销
required: 字段必须有值,否则会抛异常
default: 在增加文档时,可以根据需要为字段设置一个默认值,防止为空
-->
<!-- 字段名由字母数字下划线组成,且不能以数字开头。两端为下划线的字段为保留字段,
如(_version_)。
-->
<field name="id" type="string" indexed="true" stored="true"
required="true" multiValued="false" />
<field name="title" type="text_general" indexed="true"
stored="true" multiValued="true"/>
<field name="description" type="text_general" indexed="true" stored="true"/>
<field name="author" type="text_general" indexed="true" stored="true"/>
<field name="keywords" type="text_general" indexed="true" stored="true"/>
<field name="category" type="text_general" indexed="true" stored="true"/>
<field name="url" type="text_general" indexed="true" stored="true"/>
<field name="last_modified" type="date" indexed="true" stored="true"/>
<!-- 注意: 为了节省空间,这个字段默认不被索引, 因使用copyField被拷贝到了名为text的字段中
。用于内容返回和高亮。搜索时使用text字段
-->
<field name="content" type="text_general" indexed="false"
stored="true" multiValued="true"/>
<!-- 整合字段(catchall field), 包含其他可搜索的字段 (通过copyField实现) -->
<field name="text" type="text_general" indexed="true"
stored="false" multiValued="true"/>
<!-- 保留字段,不能删除,否则报错 -->
<field name="_version_" type="long" indexed="true" stored="true"/>
</fields>
<!-- 文档的唯一标识,可理解为主键,除非标识为required="false", 否则值不能为空-->
<uniqueKey>id</uniqueKey>
<!-- 拷贝需要索引的字段到整合字段中 -->
<copyField source="title" dest="text"/>
<copyField source="author" dest="text"/>
<copyField source="description" dest="text"/>
<copyField source="keywords" dest="text"/>
<copyField source="content" dest="text"/>
<copyField source="url" dest="text"/>
<types>
<!-- 字段类型定义 -->
<fieldType name="string" class="solr.StrField" sortMissingLast="true" />
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0"
positionIncrementGap="0"/>
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0"
positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0"
positionIncrementGap="0"/>
<fieldType name="double" class="solr.TrieDoubleField" precisionStep="0"
positionIncrementGap="0"/>
<fieldType name="date" class="solr.TrieDateField" precisionStep="0"
positionIncrementGap="0"/>
略...
<!-- Thai,泰语类型字段 -->
<fieldType name="text_th" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ThaiWordFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="lang/stopwords_th.txt" />
</analyzer>
</fieldType>
<!-- Turkish,土耳其语类型字段 -->
<fieldType name="text_tr" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.TurkishLowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="false"
words="lang/stopwords_tr.txt" />
<filter class="solr.SnowballPorterFilterFactory" language="Turkish"/>
</analyzer>
</fieldType>
<!-- Chinese,需要我们自己配置,整合mmseg4j就配置在这里 -->
</types>
<!-- 文档相似度判断依赖于文档相似度得分。 一个自定义的 Similarity 或 SimilarityFactory
可以在这里指定, 但是默认的设置已经适合大多数应用。可以参考:
http://wiki.apache.org/solr/SchemaXml#Similarity
-->
<!--
<similarity class="com.example.solr.CustomSimilarityFactory">
<str name="paramkey">param value</str>
</similarity>
-->
</schema>
分享到:
相关推荐
solr-mongo-importer-1.1.0.jar solr-mongo-importer-1.1.0.jar solr-mongo-importer-1.1.0.jar
solrconfig.xml和schema.
solr.warsolr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包solr.war包...
solr搜索框架的中文分词器文件及配置详解供大家下载,亲测可用....编辑cor下路径的managed-schema文件(solr-8.1.1\server\solr\configsets\_default\conf下拷贝到solr_home的具体CORE名称文件夹下的schema文件)
完全配置好的solr容器,直接修改web.xml设置一下solr core路劲即可
solr(solr-9.0.0-src.tgz)源码
solr分词器配置 IKAnalyzer2012.cfg.xm IKAnalyzer2012.cfg.xm
Apache Solr(solr-8.11.1-src.tgz)Source release
Apache.Solr.3.Enterprise.Search.Server
当前资源为Apache官方提供的说明文档apache-solr-ref-guide-5.3.pdf,方便大家学习使用!此外还整理了一套有关solr-5.3.0的Windows、Linux和src源码包,有需要的可以去下载!因不支持上传pdf,所以存到百度云盘。
资源分类:Python库 所属语言:Python 资源全名:solr-dsl-0.0.3.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
solr schema solrconfig 配置文件解析 solr schema solrconfig 配置文件解析
If you are a developer who wants to learn how to get the most out of Solr in your applications, whether you are new to the field of search or have used Solr but don t know everything or simply want a ...
If you are a developer who wants to learn how to get the most out of Solr in your applications, whether you are new to the field of search or have used Solr but don t know everything or simply want a ...
solr4.8.1最新版2014.6.10part3
solr7版本中的数据导入jar包 低版本的没试过,估计低版本的solr配合之前apache-solr-dataimportscheduler-1.0.jar这些能行,不行就试试我这个。
solr配置中文解析器和将数据导入solr索引库时所需的jar包
中文分词器ik-analyzer-solr5-5.x.jar,已经打包好,直接用就可以 2积分不黑心
资源分类:Python库 所属语言:Python 资源全名:solr2es-0.3.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
此文档为solr4.6帮助文档此文档为solr4.6帮助文档