Solr入门-Solr服务安装(windows系统)

安装Solr

首先保证已经正确安装了Java

下载Solr,当前最新版6.1.0

Solr各个版本下载地址

Solr从6.0之后需要Java1.8所以如果使用Solr6.0及其以上版本,请确保Java版本在1.8之上

将Solr下载之后解压在电脑的某个目录,我解压到了D盘根目录下

启动Solr

启动Solr(windws版,以下都是windows下的)

进入solr的解压目录

cd bin
solr.cmd start

Solr启动成功!

管理控制台地址为

http://localhost:8983/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都做了什么操作

 

  1. 创建目录 在example下创建了techproducts\solr目录
  2. 启动solr 使用-s指定了solr.home
  3. 创建core
  4. 索引
  5. 上传文件 
    等操作

其中启动命令使用了-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命令提交了一下文件

再回控制台

在此进入

http://localhost:8983/solr/#/

我们在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使用步骤如下

  1. 定义schema,schema告诉Solr文档如何被索引,在在线商店示例中,schema可以用来定义商品名称,描述,价格,制造商等字段。
  2. 部署Solr
  3. 将solr文档提供给用来来检索
  4. 在应用中暴露搜索接口

更进一步

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

原文地址:https://www.cnblogs.com/tuanz/p/9121016.html

时间: 2024-08-30 03:51:47

Solr入门-Solr服务安装(windows系统)的相关文章

vultr vps安装windows系统教程

在欧美vps安装windows系统,主要用途是: 外贸业务人员,远程操作获得国外IP用于刷单,通常是美国亚马逊Amazon商家: 安装Windows系统支持的软件工具.国外Windows VPS主机价格昂贵,毕竟国外保护版权,Windows VPS包含了给微软的授权费用.于是,选择Linux VPS价格便宜,自行安装盗版Windows系统,省钱爽歪歪. 还有少数站长安装Windows Server生产环境,用于部署网站或企业服务. 你先要在Vultr免费注册账户,购买一台VPS服务器.我推荐De

亦大自学51cto ——安装Windows系统修改磁盘类型技巧

笔名亦大,整理归纳自学之路有用的方法---------安装Windows系统修改磁盘类型 一般安装Windows 8以上的系统,以前的老电脑安装时都会报错"不能把系统安装在当前磁盘",原因一般是以前的硬盘类型不同,可能是MBR引导,不支持UEFI引导,怎么修改呢?方法很简单如下: 1.shift+F10调出命令提示符 2.输入diskpart命令,在输入list disk查看磁盘目录,再输入select disk 0 (说明:disk 0是我们的硬盘磁盘名),然后输入clean(清楚硬

Linux系统入门之如何安装Linux系统

题目:Linux系统入门之如何安装Linux系统 一.准备工具: 1.Linux 镜像文件(Linux iso文件),直接的在 百度里面输入下载Linux系统版本即可 例如: 2.虚拟机模拟工具,例如:Vmare workstation 10 或者virtualbox虚拟机工具 抑或者vmware palyer虚拟机工具 3.笔记本的硬件要求,一般现在的笔记本几乎都是满足要求的,这个放心 内存至少2G,硬盘大小至少100G,其它的没有什么 二.简单的描述虚拟机的安装(重要点截图) 三.简单的描述

virtualbox 安装windows系统的一些问题

今天总结一下,使用virtualbox安装windows系统的一些问题. 安装的是Ghost的系统,正版系统也可以参考. 首先本人的机器原系统是ubuntu 16.04 LTS x64 1.win7或win10,运行过程中卡死的现象. 原因:安装了64位的系统. 本人机器内容有8G,打算分配4G给win7和win10,所以想安装64位的虚拟机. 安装的时候,还比较顺利,但是安装完成后,使用一阵子,系统会卡死.已经试过多次这种情况. 推测在virtualbox上安装64位,兼容性不太好,还是建议安

Android里面安装windows系统

? ? 安装前请确认以下条件:①:存储卡需要有大于302M的空间. 下载安装:1.下载文件并安装:①:下载地址:http://kuai.xunlei.com/d/hWIkAAIkJwAawgZUa3c?p=09122②:下载安装安卓平台的XP虚拟机 -- Bochs.apk(装好后先别打开!否则无法运行!)③:将附件解压出来的"SDL文件夹"连同里面的文件一起复制到手机内存卡根目录. 2.下载Windows XP镜像文件:①:下载地址:http://kuai.xunlei.com/d/

烂泥:kvm安装windows系统蓝屏

本文由秀依林枫提供友情赞助,首发于烂泥行天下. 最近一直在学习有关KVM的知识,实验一直是在虚拟机VM中进行的.今天刚好公司有一台空闲的服务器,直接拿来安装centos.kvm等等,然后相关的配置. 但是在KVM安装windows系统时,一直会出现蓝屏,无法进行系统的安装.如下图: 查看虚拟机的日志,如下图: tac /var/log/libvirt/qemu/server2008.log 没有看到很有用的信息.查看libvirtd日志,如下: tac /var/log/libvirt/libv

教你快速安装Windows系统

在这里给大家推荐一个最快速.最便捷安装Windows系统的方法,无需光盘和U盘安装.非常适合新手和不会安装系统的朋友们!主要教大家如何使用软媒魔方安装Windows系统,在安装系统之前要先准备好系统镜像一个,下载软媒魔方程序.以下为Windows系统的安装方法(以Win7系统安装为例),具体操作方法如下: 一.百度搜索  下载魔方. 二.下载魔方后,安装程序. 三.运行魔方(找到魔方的应用大全并打开). 四.找到虚拟光驱,并打开. 五.打开加载镜像按钮. 六.找到你要安装的Windows系统的路

Linux下使用VirtualBox安装Windows系统

(文档比较长,只是写的详细,实际操作起来相对简单.) 由于一些特殊原因,我们并不能完全抛下Windows而使用Linux.VirtualBox 是一款虚拟机软件,支持多系统.在Linux下安装 VirtualBox 后,我们就可以安装Windows系统,并使用Windows下的软件了. 1.下载首先需要下载 VirtualBox,下载地址:http://www.virtualbox.org/wiki/Downloads点击 VirtualBox 3.2.8 for Linux hosts,跳转到

命令行模式下安装windows系统

众所周知,在视窗模式下安装windows系统会存在分区数量限制,所以一般建议使用命令行模式下.安装在安装界面开始时: shift+F10   #进入命令行模式 diskpart   #进入diskpart命令环境 list disk   #显示所有硬盘 select disk n(磁盘号)  #选择硬盘 create partition primary size=s(分区大小)   #创建一个大小为s的主分区 active &nbsp:#激活分区 format quick   #快速格式化 cr

U盘安装windows系统

本文介绍GHO和ISO两种方法安装windows系统 准备一个干净的U盘(可以将使用过的U盘内容备份后删除) 第一步:制作U盘 常用的U盘制作工具有两种 1.大白菜 官网:http://www.bigbaicai.wang/ 2.老毛桃 官网:http://www.laomaotao.org.cn/ 在官网下载U盘制作安装包: 制作U盘:解压安装包.运行启动后,将干净的U盘插入电脑,如果是GHO镜像选择默认模式,如果是ISO镜像选择ISO模式  其他选项都默认,然后一键制作U盘,U盘制作完成.