【Solr】Experience the fast installation of solr


+ Preface

Solr is developed based on java, so solr needs to use the jdk environment, and solr needs to run in the tomcat container, so the jdk and tomcat environments need to be configured in advance.

+ install download

have to be aware of is:

  1. src.tgz: With src, it means a compressed package with source code files, without src, it means a compiled compressed package
  2. .tgz: Compressed packages used by Linux-related operating systems
  3. .zip: Compressed package used by Windows operating system

- Method 1: download from the official website

Solr official address: https://solr.apache.org/Official
website download location:
insert image description here

- Method 2: Warehouse download

Solr download warehouse location: https://archive.apache.org/dist/lucene/solr/
Warehouse download (download required version):
insert image description here

+ start method

Solr's start, stop, and view commands:

  1. Start: bin\solr.cmd start
  2. Stop: bin\solr.cmd stop or bin\solr.cmd stop -all
  3. View: bin\solr.cmd status

insert image description here
Open the terminal (administrator) in advance, enter the current directory, and enter the startup command: .\solr.cmd start
insert image description here
The default port of solr is 8983, so you need to enter in the web page: http://localhost:8983/solr/#/
insert image description here
Done~

+ quick use

input the command:solr create -c xxx
insert image description here

The information prompts that the creation is successful, we can go back to the webpage to view~
insert image description here

+ about inquiries

Is it right to be a human being? Let me summarize the query rules for readers:
insert image description here

Query syntax:

	q  查询的关键字,此参数最为重要,例如,q=id:1,默认为q=*:*,
	fl  指定返回哪些字段,用逗号或空格分隔,注意:字段区分大小写,例如,fl= id,title,sort
	start  返回结果的第几条记录开始,一般分页用,默认0开始
	rows  指定返回结果最多有多少条记录,默认值为 10,配合start实现分页
	sort  排序方式,例如id  desc 表示按照 “id” 降序
	wt  (writer type)指定输出格式,有 xml, json, php等
	fq  (filter query)过虑查询,提供一个可选的筛选器查询。返回在q查询符合结果中同时符合的fq条件的查询结果,例如:q=id:1&fq=sort:[1 TO 5],找关键字id为1 的,并且sort是1到5之间的。
	df   默认的查询字段,一般默认指定。
	qt  (query type)指定那个类型来处理查询请求,一般不用指定,默认是standard。
	indent   返回的结果是否缩进,默认关闭,用 indent=true|on 开启,一般调试json,php,phps,ruby输出才有必要用这个参数。

operator:

  “:”  指定字段查指定值,如返回所有值*:*
  “?”  表示单个任意字符的通配
  “*”  表示多个任意字符的通配(不能在检索的项开始使用*或者?符号)
  “~”  表示模糊检索,如检索拼写类似于”roam”的项这样写:roam~将找到形如foam和roams的单词;roam~0.8,检索返回相似度在0.8以上的记录。
  AND、||  布尔操作符
  OR、&&  布尔操作符
  NOT、!、-(排除操作符不能单独与项使用构成查询)
  “+”  存在操作符,要求符号”+”后的项必须在文档相应的域中存在²
  ( )  用于构成子查询
  []  包含范围检索,如检索某时间段记录,包含头尾,date:[201507 TO 201510]
  {
    
    }  不包含范围检索,如检索某时间段记录,不包含头尾date:{
    
    201507 TO 201510}

ok bye bye ~ you guys play.

Guess you like

Origin blog.csdn.net/ruisasaki/article/details/131306162