Solr入门-Solr服务安装(windows系统)
安装Solr
首先保证已经正确安装了Java
下载Solr,当前最新版6.1.0
Solr从6.0之后需要Java1.8所以如果使用Solr6.0及其以上版本,请确保Java版本在1.8之上
将Solr下载之后解压在电脑的某个目录,我解压到了D盘根目录下
启动Solr
启动Solr(windws版,以下都是windows下的)
进入solr的解压目录
cd bin
solr.cmd start
Solr启动成功!
管理控制台地址为
第一次使用的时候提醒No cores available
什么是core
先来看一段官方说明。
In Solr, the term is used to refer to a single index and associated transaction log and configuration files core
(including the and Schema files, among others). Your Solr installation can have multiple solrconfig.xml
cores if needed, which allows you to index data with different structures in the same server, and maintain more
control over how your data is presented to different audiences. In SolrCloud mode you will be more familiar with
Behind the scenes a collection consists of one or more cores. the term collection.Cores can be created using script or as part of SolrCloud collection creation using the APIs. C bin/solr ore-spe
cific properties (such as the directories to use for the indexes or configuration files, the core name, and other
options) are defined in a core.properties file. Any core.properties file in any directory of your Solr
installation (or in a directory under where solr_home is defined) will be found by Solr and the defined properties
will be used for the core named in the file.
主要的意思是which allows you to index data with different structures in the same server
允许用户以不同的数据结构来对数据进行索引。
可以使用
bin/solr create -c <name>
来创建core
运行示例数据
这里我们使用官方给的示例。
先停掉solr
停掉solr必须指定端口号,也可以使用 -all来停掉所有的solr服务
solr.cmd stop -all
使用示例core启动solr(没有特殊说明所处的目录为solr解压路径\bin下)
solr.cmd -e techproducts
我们来看一下上面的命令solr都做了什么操作
- 创建目录 在example下创建了techproducts\solr目录
- 启动solr 使用-s指定了solr.home
- 创建core
- 索引
- 上传文件
等操作
其中启动命令使用了-s 我们来看一下-s的含义
Sets the solr.solr.home system
property; Solr will create core
directories under this directory. This
allows you to run multiple Solr instances
on the same host while reusing the
same server directory set using the -d
parameter. If set, the specified directory
should contain a solr.xml file, unless
solr.xml exists in ZooKeeper. The
default value is . server/solr
This parameter is ignored when running
examples (-e), as the solr.solr.home
depends on which example is run.
我们看一下原始的solr下example目录
执行之后example目录
techproducts下面有logs和solr目录
执行post命令提交了一下文件
再回控制台
在此进入
我们在core admin中就可以看到创建的techproducts了
Solr is built to find documents that match queries. Solr’s schema provides an idea of how content is structured
(more on the schema ), but without documents there is nothing to find. Solr needs input before it can do later
much.
solr是用来查找关键字匹配的文档的。solr的schema决定了内容的结构,没有文档,就无从查询。
刚才我们使用的-e启动命令已经将示例文档提交了。
接下来我们来查询(依然以官方的示例,查询video)
http://localhost:8983/solr/techproducts/select?q=video
结果如下
还有很多详细的查询可以参考官方文档
快速预览
下图简单描述了Solr如何集成到应用中
In the scenario above, Solr runs along side other server applications. For example, an online store application
would provide a user interface, a shopping cart, and a way to make purchases for end users; while an inventory
management application would allow store employees to edit product information. The product metadata would
be kept in some kind of database, as well as in Solr.
Solr使用步骤如下
- 定义schema,schema告诉Solr文档如何被索引,在在线商店示例中,schema可以用来定义商品名称,描述,价格,制造商等字段。
- 部署Solr
- 将solr文档提供给用来来检索
- 在应用中暴露搜索接口
更进一步
You already have some idea of Solr’s schema. This section describes Solr’s home directory and other
configuration options.
When Solr runs in an application server, it needs access to a home directory. The home directory contains
important configuration information and is the place where Solr will store its index. The layout of the home
directory will look a little different when you are running Solr in standalone mode vs when you are running in
SolrCloud mode.
The crucial parts of the Solr home directory are shown in these examples:
Solr的主目录
当Solr在应用服务器上运行的时候,它需要访问主目录,主目录包含重要的配置信息,也是Solr存储索引的地方。主目录的结构如下
最主要的文件如下
solr.xml
为Solr实例指定配置
core.properties
定义每一个core的配置,比如名字,所在的core,schema的位置和其他参数
转http://blog.csdn.net/frankcheng5143/article/details/52291176
Solr入门-Solr服务安装(windows系统)的更多相关文章
- Solr系列2-Solr服务安装
1: Solr简介 1.1 简介: 1.2 下载: 2:Solr 安装 2.1 安装 2.2 目录结构 3 :启动Solr 3.1 启动 3.2使用Solr提供的测试数据 3.5 Solr配置文集 3 ...
- Jacoco远程统计tomcat服务(Windows系统)的代码覆盖率
Jacoco远程统计tomcat服务(Windows系统)的代码覆盖率 2017-09-21 目录 1 Jacoco的安装和设置 1.1 什么是Jacoco? 1.2 Jacoco安装 1.3 ...
- 第二节:用PE安装Windows系统
用PE安装Windows系统 认识PE系统 Windows Preinstallation Environment(Windows PE),Windows预安装环境,是带有有限服务的最小Win32子系 ...
- 批量安装Windows系统
今天我们利用Windows server 2019自带的Windows部署服务通过网络批量安装Win 10 一.Windows服务 1)WDS WDS(Windows Deployment Servi ...
- 烂泥:kvm安装windows系统蓝屏
本文由秀依林枫提供友情赞助,首发于烂泥行天下. 最近一直在学习有关KVM的知识,实验一直是在虚拟机VM中进行的.今天刚好公司有一台空闲的服务器,直接拿来安装centos.kvm等等,然后相关的配置. ...
- virtualbox 安装windows系统的一些问题
今天总结一下,使用virtualbox安装windows系统的一些问题. 安装的是Ghost的系统,正版系统也可以参考. 首先本人的机器原系统是ubuntu 16.04 LTS x64 1.win7或 ...
- Linux下使用VirtualBox安装Windows系统
(文档比较长,只是写的详细,实际操作起来相对简单.) 由于一些特殊原因,我们并不能完全抛下Windows而使用Linux.VirtualBox 是一款虚拟机软件,支持多系统.在Linux下安装 Vir ...
- Linode KVM安装Windows系统的设置方法
以前我们用老的Linode VPS主机的时候是采用的XEN架构的,如今我们新注册账户,以及新开的机器是KVM架构.根据后台的设置,我们看到好多网友有在LINODE中安装WINDOWS系统,理论上是可以 ...
- Linux下硬盘安装Windows系统。
注意:本方法安装后会把Linux系统损坏,方法适用于完全不再需要Linux系统. 本方法在ubuntu 14.04,centos 6.5,debian 8测试成功. 安装方法是通过grub2引导Win ...
随机推荐
- 【转】Postgres SQL sort 操作性能调优
这篇文章将以实战的方式结合笔者在项目中真实遇到的情况来讲解.说到SQL,大家可能会遇到一些写法稍微复杂的写法.比如SQL中遇到的有聚合函数sum等,也有遇到使用group by / order by的 ...
- 面试的加分项:懂点 Nginx 反向代理与负载均衡
学到老活到老 前端圈一直很新,一直要不停的学习,而且在进入大厂的路上,还要求熟悉一门后台语言等等.用一句别人开玩笑的话来说,java十年前的技术现在还能用,而前端的技术就不是这样的了 突然想起了d ...
- JUC并发编程--AQS
转自: https://www.jianshu.com/p/d8eeb31bee5c 前言 在java.util.concurrent.locks包中有很多Lock的实现类,常用的有Reentrant ...
- 关于Xilinx PCIE DMA的问答
关于Xilinx PCIE DMA的问答 很久没上博客园了,但由于之前在博客园写了几篇关于PCIE DMA的文章,很多同学给我发消息询问相关知识点,之前有空的时候都是语音一小时跟人细讲,最近由于工作繁 ...
- 商品现货数据不好拿?商品季节性难跟踪?一键解决没烦恼的Python爬虫分享
更多精彩内容,欢迎关注公众号:数量技术宅.探讨数据分析.量化投资问题,请加技术宅微信:sljsz01 季节性在大宗商品的交易中至关重要 大宗商品交易中,特别是在期货市场,由于商品价格周期的存在,季节性 ...
- Anaconda安装Pytorch(通过本地安装包)
前提:你已经事先安装好了Anaconda 在线安装pytorch总是出现这样那样的问题,所以我选择先去清华镜像下载好与python版本对应的pytorch和torchvision文件,然后本地安装 清 ...
- Layman CSS3+H5实现上下垂直居中的几种主要方法
方法1:通过 translate 移位来实现 H5+CSS3: <div style="width: 100%; height: 100%; margin:0; padding: 0; ...
- OpenCV计算机视觉学习(2)——图像算术运算 & 掩膜mask操作(数值计算,图像融合,边界填充)
在OpenCV中我们经常会遇到一个名字:Mask(掩膜).很多函数都使用到它,那么这个Mask到底是什么呢,下面我们从图像基本运算开始,一步一步学习掩膜. 1,图像算术运算 图像的算术运算有很多种,比 ...
- I2C总线的Arduino库函数
I2C总线的Arduino库函数 I2C即Inter-Integrated Circuit串行总线的缩写,是PHILIPS公司推出的芯片间串行传输总线.它以1根串行数据线(SDA)和1根串行时钟线(S ...
- 《穷查理年鉴》习惯 & 工作 & 自省 & 自律 (关于自己)
习惯 001.在那充满古老年鉴的年代里,扔掉你的恶行,不管它们曾经给你带来多大的好处. 002.许多关于预言的争论都可以简化为:当你说是时,就有人说浊;当你认为不是时,一定有人说是. 003.坏习惯和 ...