Solr:Slor初识(概述、Windows版本的安装、添加IK分词器)
1、Solr概述
(1)Solr与数据库相比的优势
搜索速度更快、搜索结果能够按相关度排序、搜索内容格式不固定等
(2)Lucene与Solr的区别
Lucene提供了完整的查询引擎和索引引擎,目的是为软件开发人员提供一个简单易用的工具包
Solr的目标是打造一款企业级的搜索引擎系统,它是一个搜索引擎服务,可以独立运行,通过Solr可以非常快速的构建企业的搜索引擎,通过Solr也可以高效的完成站内搜索功能。
2、Solr的Windows版本的安装
(1)目录结构

Solr的启动在bin目录下,用的是内置的服务器不是很稳定
contrib:插件
dist:jar包

(2)安装
- 将Solr的example的webapps目录下的solr.war复制到tomcat的webapps目录下并解压
- 将example目录下的jar包放到tomcat的lib目录下:

- 配置家目录:

目录的内容是从solr中复制过来的:

在配置文件中配置:

<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>D:\Program_files\solr\solrhome</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
(3)启动
- 先在bin目录下启动tomcat并访问Solr

3、Solr的后台界面
(1)添加核

在Solr的家目录复制一个collection并修改目录的名称,打开目录将配置文件中的name属性也更改为目录的名称

效果:

(2)功能

analysis:分词器
dataimport:导入数据库数据
Documents:进行增删改查

Query:查询

Files:配置文件(在核的conf目录下)

Ping:测试服务是否存在
(3)schema.xml配置文件中的域
域:
<field name="title" type="text_general" indexed="true" stored="true" multiValued="true"/>
<field name="subject" type="text_general" indexed="true" stored="true"/>
<field name="description" type="text_general" indexed="true" stored="true"/>
<field name="comments" 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="resourcename" type="text_general" indexed="true" stored="true"/>
<field name="url" type="text_general" indexed="true" stored="true"/>
<field name="content_type" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="last_modified" type="date" indexed="true" stored="true"/>
<field name="links" type="string" indexed="true" stored="true" multiValued="true"/>
动态域:
<dynamicField name="*_i" type="int" indexed="true" stored="true"/>
<dynamicField name="*_is" type="int" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="*_s" type="string" indexed="true" stored="true" />
<dynamicField name="*_ss" type="string" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="*_l" type="long" indexed="true" stored="true"/>
<dynamicField name="*_ls" type="long" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="*_t" type="text_general" indexed="true" stored="true"/>
<dynamicField name="*_txt" type="text_general" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="*_en" type="text_en" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
<dynamicField name="*_bs" type="boolean" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="*_f" type="float" indexed="true" stored="true"/>
<dynamicField name="*_fs" type="float" indexed="true" stored="true" multiValued="true"/>
<dynamicField name="*_d" type="double" indexed="true" stored="true"/>
<dynamicField name="*_ds" type="double" indexed="true" stored="true" multiValued="true"/>
拷贝域:
<copyField source="cat" dest="text"/>
<copyField source="name" dest="text"/>
<copyField source="manu" dest="text"/>
<copyField source="features" dest="text"/>
<copyField source="includes" dest="text"/>
<copyField source="manu" dest="manu_exact"/>
实际搜索的是text域,就是将多个域进行合并,只搜索一个域
4、配置IK分词器
(1)导入jar包

(2)新建classes目录并创建配置文件

(3)自定义域的类型
<fieldType name="text_ik" class="solr.TextField">
<analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/>
</fieldType>
(4)自定义域
<field name="title_ik" type="text_ik" indexed="true" stored="true" />
<field name="content_ik" type="text_ik" indexed="true" stored="false" multiValued="true"/>
(5)重启测试

Solr:Slor初识(概述、Windows版本的安装、添加IK分词器)的更多相关文章
- Solr4.4入门,介绍Solr的安装、IK分词器的配置及高亮查询结果(转)
一.Windows下安装solr-4.4.0 1. 下载solr.4.4 2. 下载绿色版tomcat6.0.18 3. 解压下载的solr到d:\study\solr,将dist目录下的sol ...
- Docker 下Elasticsearch 的安装 和ik分词器
(1)docker镜像下载 docker pull elasticsearch:5.6.8 (2)安装es容器 docker run -di --name=changgou_elasticsearch ...
- Solr(四)Solr实现简单的类似百度搜索高亮功能-1.配置Ik分词器
配置Ik分词器 一 效果图 二 实现此功能需要添加分词器,在这里使用比较主流的IK分词器. 1 没有配置IK分词器,用solr自带的text分词它会把一句话分成单个的字. 2 配置IK分词器,的话它会 ...
- [Linux]Linux下安装和配置solr/tomcat/IK分词器 详细实例一.
在这里一下讲解着三个的安装和配置, 是因为solr需要使用tomcat和IK分词器, 这里会通过图文教程的形式来详解它们的安装和使用.注: 本文属于原创文章, 如若转载,请注明出处, 谢谢.关于设置I ...
- ElasticSearch(六):IK分词器的安装与使用IK分词器创建索引
之前我们创建索引,查询数据,都是使用的默认的分词器,分词效果不太理想,会把text的字段分成一个一个汉字,然后搜索的时候也会把搜索的句子进行分词,所以这里就需要更加智能的分词器IK分词器了. 1. i ...
- IK分词器的安装与使用IK分词器创建索引
之前我们创建索引,查询数据,都是使用的默认的分词器,分词效果不太理想,会把text的字段分成一个一个汉字,然后搜索的时候也会把搜索的句子进行分词,所以这里就需要更加智能的分词器IK分词器了. 1. i ...
- 史上最全Windows版本搭建安装React Native环境配置
史上最全Windows版本搭建安装React Native环境配置 配置过React Native 环境的都知道,在Windows React Native环境配置有很多坑要跳,为了帮助新手快速无误的 ...
- 史上最详细Windows版本搭建安装React Native环境配置 转载,比官网的靠谱亲测可用
史上最详细Windows版本搭建安装React Native环境配置 2016/01/29 | React Native技术文章 | Sky丶清| 95条评论 | 33530 views ...
- windows版本免安装redis, nginx, zookeeper
redis官网:https://redis.io/ windows版本免安装redis下载链接:https://github.com/MSOpenTech/redis/releases nginx官网 ...
随机推荐
- 近50种语言编写的“Hello, World”,你会几种?可不要贪杯哦~
本文转自公众号CSDN(ID:CSDNnews)作者:Sylvain Saurel,译者:风车云马
- Kafka分布式查询引擎
1.概述 Kafka是一个分布式消息中间件系统,里面存储着实际场景中的数据.Kafka原生是不支持点查询的,如果我们想对存储在Topic中的数据进行查询,可能需要对Topic中的数据进行消费落地,然后 ...
- LeetCode 010 Regular Expression Matching
题目描述:Regular Expression Matching Implement regular expression matching with support for '.' and '*' ...
- Zabbix监控使用进阶
1. Zabbix基于SNMP监控 1.1 zabbix-web所能指定的监控方式 ssh/telnet agent:master/agent SNMP:Simple Network Manageme ...
- HTTP请求头和响应头详解【转】
最近老猿在开始学习爬虫相关的知识,由于老猿以前只做非web的后台应用,发现相关知识太过匮乏,导致学习很困难,为此不得不从一些基础知识恶补开始,对于这些知识,老猿会将网上找到的比较认可的内容直接转发. ...
- PyQt学习随笔:QWidget的QFont的kerning、Antialiasing属性用途
专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 引言 在Designer中,QWidget的font属性有两个比较陌生 ...
- PyQt(Python+Qt)学习随笔:QTreeView树形视图的itemsExpandable属性
老猿Python博文目录 专栏:使用PyQt开发图形界面Python应用 老猿Python博客地址 QTreeView树形视图的itemsExpandable属性用于控制视图中用户是否可以通过操作展开 ...
- 安装虚拟机(centos7)
安装VMware 15 这里就不介绍VMware如何安装了,可以自行百度安装. 准备centos7镜像 我选择的是网易的镜像源,地址是:http://mirrors.163.com/centos/7/ ...
- Alpha冲刺阶段Day4
[Alpha冲刺阶段]Scrum Meeting Daily4 1.会议简述 会议开展时间 2020/5/25 7:30-7:50 PM 会议基本内容摘要 讨论了各自任务完成情况以及明日计划 参与 ...
- 剑指offer二刷——数组专题——数组中重复的数字
题目描述 在一个长度为n的数组里的所有数字都在0到n-1的范围内. 数组中某些数字是重复的,但不知道有几个数字是重复的.也不知道每个数字重复几次.请找出数组中任意一个重复的数字. 例如,如果输入长度为 ...