solr schema.xml配置
solr使用_version_来做文档的版本控制和修改时加锁(乐观锁)
<field name="_version_" type="long" indexed="true" stored="true"/>
indexed是否索引 只能在索引的列上进行查询
stored是否存储 只能返回存储的列
required 是否必须
multiValued 是否多值
<field name="id" type="string" indexed="true" stored="true" required="true"
multiValued="false" />
dynamicField 动态字段
<dynamicField name="*_i" type="int" indexed="true" stored="true"/>
uniqueKey主键列
<uniqueKey>id</uniqueKey>
copyField
<field name="text" type="text_general" indexed="true" stored="false" multiValued="true"/>
<copyField source="cat" dest="text"/>
各种fieldtype :
sortMissingLast:排序的时候 空值排在后面
<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"/>
<!--
precisionStep是数字才有的,是solr针对数字索引的一个优化字段。
较小的precisionStep值(以位指定)将导致每值更多的索引索引,更大的索引大小和更快的范围查询。
也就是说,空间和时间的平衡。
positionIncrementGap:
positionIncrementGap将此类型的多个字段(multiValued="true")的字段的多个值之间放置配置数量的空格,目的是防止字段间的错配短语匹配。
-->
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer
type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
注意:
stopwords.txt的格式是,每行一个停用词。
synonyms.txt的格式是,在同一行输入多个同义词,逗号分隔。
tokenizer用来分词,filter(可选)可以后续处理分词的结果。
filter的作用:
- 词元转换:如LowerCaseFilterFactory大小写转换。
- 次元注入:如SynonymFilterFactory加入同义词。
- 词元移除:如停用词过滤器StopFilterFactory。删除不必要的次元,如个,在等。
solr schema.xml配置的更多相关文章
- Solr Schema.xml和solrconfig.xml分析(转)
Solr Schema.xml和solrconfig.xml分析 (http://yinwufeng.iteye.com/blog/964040) 一.字段配置(schema) schema.xml位 ...
- solr schema.xml文档节点配置
首先,讲解一下/usr/local/solr/collection1/conf/schema.xml的配置,此文档功能类似于配置索引数据库. Field:类似于数据库字段的属性(此文统一使用用“字段” ...
- solr官方文档翻译系列之schema.xml配置介绍
常见的元素 <field name="weight" type="float" indexed="true" stored=" ...
- SOLR企业搜索平台 三 (schema.xml配置和solrj的使用)
标签:solrj 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://3961409.blog.51cto.com/3951409/8 ...
- solr的schema.xml配置属性解释
schema.xml做什么? SOLR加载数据,创建索引和数据时,核心数据结构的配置文件是schema.xml,该配置文件主要用于配置数据源,字段类型定义,搜索类型定义等.schema.xml的配置直 ...
- Solr schema.xml中修改id的类型为int
使用solr6的版本的时候(solr5不存在这个问题),在修改schema.xml的field时,想使用int做为id的数据类型,修改后重新加载配置的时候报错.原来schema.xml中field i ...
- 指尖上的电商---(5)schema.xml配置具体解释
这一节我们看下schema.xml文件中各个节点的配置极其作用.schema.xml文件中面主要定义了索引数据类型,索引字段等信息. 主要包含了下面节点 1.fieldtype节点 fieldtype ...
- SUSE12SP3-Mycat(2)Schema.xml配置详解
简介 Schema.xml 作为 MyCat 中重要的配置文件之一,管理着 MyCat 的逻辑库.表.分片规则.DataNode 以及 DataSource.弄懂这些配置,是正确使用 MyCat 的前 ...
- 根据mysql数据库 定义solr Schema.xml中配置业务域
<!--product--> <field name="product_name" type="text_ik" indexed=" ...
随机推荐
- 【并行计算-CUDA开发】英伟达硬件解码器分析
这篇文章主要分析 NVCUVID 提供的解码器,里面提到的所有的源文件都可以在英伟达的 nvenc_sdk 中找到. 解码器的代码分析 SDK 中的 sample 文件夹下的 NvTranscoder ...
- StormUI各参数详解
参考:http://www.malinga.me/reading-and-understanding-the-storm-ui-storm-ui-explained/
- 【leetcode算法-简单】20. 有效的括号
[题目描述] 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效. 有效字符串需满足: 左括号必须用相同类型的右括号闭合.左括号必须以正确的顺序闭合.注意空字 ...
- [转帖]Kafka 原理和实战
Kafka 原理和实战 https://segmentfault.com/a/1190000020120043 两个小时读完... 实在是看不完... 1.2k 次阅读 · 读完需要 101 分钟 ...
- Nginx之rewrite四种flag
利用nginx的rewrite命令,可以实现URL的重写,可在nginx配置文件的server.location.if部分使用,对于rewrite有四种不同的flag. redirect:返回302临 ...
- CentOS7下使用Sonatype Nexus3搭建Docker私有仓库
相关资料: Sonatype Nexus3官方网站:https://www.sonatype.com/download-oss-sonatype Sonatype Nexus3 Docker Hub地 ...
- PB做的托盘程序(最小化后在左下角显示图标)
见‘文件’资源
- -bash: /usr/librxec/grepconf.sh:Nosuch file or directory
最近修改/etc/profile文件时,不小心在后面添加了source /etc/profile,导致使用xshell登录远程linux的时候出现下面的信息, 一直无法进入linux,将profile ...
- javascript——onsubmit和onreset事件 和开发中常用的方式
<head> <meta charset="UTF-8"> <title></title> <script> funct ...
- 前端性能优化-Vue代码层面
1.v-if 和 v-show 区分使用场景 v-if 是 真正 的条件渲染,因为它会确保在切换过程中条件块内的事件监听器和子组件适当地被销毁和重建:也是惰性的:如果在初始渲染时条件为假,则什么也不做 ...