Download Apache Solr Reference Guide: For Solr 7.3 PDF

TitleApache Solr Reference Guide: For Solr 7.3
LanguageEnglish
File Size13.0 MB
Total Pages1200
Table of Contents
                            Apache Solr Reference Guide: For Solr 7.3
Table of Contents
Apache Solr Reference Guide
About This Guide
	Hosts and Port Examples
	Directory Paths
	API Examples
	Special Inline Notes
Getting Started
	Solr Tutorial
	A Quick Overview
	Solr System Requirements
	Installing Solr
Deployment and Operations
	Solr Control Script Reference
	Solr Configuration Files
	Taking Solr to Production
	Making and Restoring Backups
	Running Solr on HDFS
	SolrCloud on AWS EC2
	Upgrading a Solr Cluster
	Solr Upgrade Notes
Using the Solr Administration User Interface
	Overview of the Solr Admin UI
	Getting Assistance
	Logging
	Cloud Screens
	Collections / Core Admin
	Java Properties
	Thread Dump
	Suggestions Screen
	Collection-Specific Tools
	Core-Specific Tools
Documents, Fields, and Schema Design
	Overview of Documents, Fields, and Schema Design
	Solr Field Types
	Defining Fields
	Copying Fields
	Dynamic Fields
	Other Schema Elements
	Schema API
	Putting the Pieces Together
	DocValues
	Schemaless Mode
Understanding Analyzers, Tokenizers, and Filters
	Using Analyzers, Tokenizers, and Filters
	Analyzers
	About Tokenizers
	About Filters
	Tokenizers
	Filter Descriptions
	CharFilterFactories
	Language Analysis
	Phonetic Matching
	Running Your Analyzer
Indexing and Basic Data Operations
	Indexing Using Client APIs
	Introduction to Solr Indexing
	Post Tool
	Uploading Data with Index Handlers
	Uploading Data with Solr Cell using Apache Tika
	Uploading Structured Data Store Data with the Data Import Handler
	Updating Parts of Documents
	Detecting Languages During Indexing
	De-Duplication
	Content Streams
	UIMA Integration
Searching
	Overview of Searching in Solr
	Velocity Search UI
	Relevance
	Query Syntax and Parsing
	JSON Request API
	JSON Facet API
	Faceting
	Highlighting
	Spell Checking
	Query Re-Ranking
	Transforming Result Documents
	Suggester
	MoreLikeThis
	Pagination of Results
	Collapse and Expand Results
	Result Grouping
	Result Clustering
	Spatial Search
	The Terms Component
	The Term Vector Component
	The Stats Component
	The Query Elevation Component
	Response Writers
	Near Real Time Searching
	RealTime Get
	Exporting Result Sets
	Streaming Expressions
	Parallel SQL Interface
	Analytics Component
SolrCloud
	Getting Started with SolrCloud
	How SolrCloud Works
	SolrCloud Resilience
	SolrCloud Configuration and Parameters
	Rule-based Replica Placement
	Cross Data Center Replication (CDCR)
	SolrCloud Autoscaling
Legacy Scaling and Distribution
	Introduction to Scaling and Distribution
	Distributed Search with Index Sharding
	Index Replication
	Combining Distribution and Replication
	Merging Indexes
The Well-Configured Solr Instance
	Configuring solrconfig.xml
	Solr Cores and solr.xml
	Configuration APIs
	Implicit RequestHandlers
	Solr Plugins
	JVM Settings
	v2 API
Monitoring Solr
	Metrics Reporting
	MBean Request Handler
	Configuring Logging
	Using JMX with Solr
	Monitoring Solr with Prometheus and Grafana
	Performance Statistics Reference
Securing Solr
	Authentication and Authorization Plugins
	Enabling SSL
Client APIs
	Introduction to Client APIs
	Choosing an Output Format
	Client API Lineup
	Using JavaScript
	Using Python
	Using SolrJ
	Using Solr From Ruby
Further Assistance
Solr Glossary
	Solr Terms
Errata
	Errata For This Documentation
How to Contribute to Solr Documentation
                        
Document Text Contents
Page 1

Apache Solr Reference Guide
For Solr 7.3

Written by the Apache Lucene/Solr Project

Published 2018-03-27

Page 2

Table of Contents
Apache Solr Reference Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2

About This Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4

Hosts and Port Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  5

Directory Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6

API Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7

Special Inline Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8

Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9

Solr Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  10

A Quick Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  38

Solr System Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  40

Installing Solr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  41

Deployment and Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  46

Solr Control Script Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  47

Solr Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  66

Taking Solr to Production . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  68

Making and Restoring Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  76

Running Solr on HDFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  81

SolrCloud on AWS EC2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  86

Upgrading a Solr Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  94

Solr Upgrade Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  97

Using the Solr Administration User Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  109

Overview of the Solr Admin UI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  110

Getting Assistance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  112

Logging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  113

Cloud Screens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  114

Collections / Core Admin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  116

Java Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  118

Thread Dump. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  119

Suggestions Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  121

Collection-Specific Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  124

Core-Specific Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  135

Documents, Fields, and Schema Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  140

Overview of Documents, Fields, and Schema Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  141

Solr Field Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  143

Defining Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  165

Copying Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  168

Dynamic Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  170

Page 600

Result Clustering
The clustering (or cluster analysis) plugin attempts to automatically discover groups of related search hits
(documents) and assign human-readable labels to these groups.

By default in Solr, the clustering algorithm is applied to the search result of each single query -— this is
called an on-line clustering. While Solr contains an extension for full-index clustering (off-line clustering) this
section will focus on discussing on-line clustering only.

Clusters discovered for a given query can be perceived as dynamic facets. This is beneficial when regular
faceting is difficult (field values are not known in advance) or when the queries are exploratory in nature.
Take a look at the Carrot2 project’s demo page to see an example of search results clustering in action (the
groups in the visualization have been discovered automatically in search results to the right, there is no
external information involved).

The query issued to the system was Solr. It seems clear that faceting could not yield a similar set of groups,
although the goals of both techniques are similar—to let the user explore the set of search results and
either rephrase the query or narrow the focus to a subset of current documents. Clustering is also similar to
Result Grouping in that it can help to look deeper into search results, beyond the top few hits.

Clustering Concepts
Each document passed to the clustering component is composed of several logical parts:

Apache Solr Reference Guide 7.3 Page 595 of 1195

© 2018, Apache Software Foundation Guide Version 7.3 - Published: 2018-03-27

Page 601

• a unique identifier,

• origin URL,

• the title,

• the main content,

• a language code of the title and content.

The identifier part is mandatory, everything else is optional but at least one of the text fields (title or content)
will be required to make the clustering process reasonable. It is important to remember that logical
document parts must be mapped to a particular schema and its fields. The content (text) for clustering can
be sourced from either a stored text field or context-filtered using a highlighter, all these options are
explained below in the configuration section.

A clustering algorithm is the actual logic (implementation) that discovers relationships among the
documents in the search result and forms human-readable cluster labels. Depending on the choice of the
algorithm the clusters may (and probably will) vary. Solr comes with several algorithms implemented in the
open source Carrot2 project, commercial alternatives also exist.

Clustering Quick Start Example
The “techproducts” example included with Solr is pre-configured with all the necessary components for
result clustering — but they are disabled by default.

To enable the clustering component contrib and a dedicated search handler configured to use it, specify a
JVM System Property when running the example:

bin/solr start -e techproducts -Dsolr.clustering.enabled=true

You can now try out the clustering handler by opening the following URL in a browser:

http://localhost:8983/solr/techproducts/clustering?q=:&rows=100&wt=xml

The output XML should include search hits and an array of automatically discovered clusters at the end,
resembling the output shown here:

<response>
  <lst name="responseHeader">
  <int name="status">0</int>
  <int name="QTime">299</int>
  </lst>
  <result name="response" numFound="32" start="0" maxScore="1.0">
  <doc>
  <str name="id">GB18030TEST</str>
  <str name="name">Test with some GB18030 encoded characters</str>
  <arr name="features">
  <str>No accents here</str>
  <str>这是一个功能</str>
  <str>This is a feature (translated)</str>
  <str>这份文件是很有光泽</str>

Page 596 of 1195 Apache Solr Reference Guide 7.3

Guide Version 7.3 - Published: 2018-03-27 © 2018, Apache Software Foundation

Page 1199

Errata For This Documentation
Any mistakes found in this documentation after its release will be listed on the on-line version of this page:

https://lucene.apache.org/solr/guide/7.3/errata.html

Errata For Past Versions of This Documentation
Any known mistakes in past releases of this documentation will be noted below.

Page 1194 of 1195 Apache Solr Reference Guide 7.3

Guide Version 7.3 - Published: 2018-03-27 © 2018, Apache Software Foundation

Page 1200

How to Contribute to Solr Documentation
The Lucene/Solr project has made it easy for anyone to contribute to the Solr Reference Guide with a patch.

The Guide is written in simple AsciiDoc-formatted files, and the source lives in the main Lucene/Solr source
repository, right alongside the code.

Find information on how to contribute to documentation online at https://lucene.apache.org/solr/guide/
how-to-contribute.html.

Apache Solr Reference Guide 7.3 Page 1195 of 1195

© 2018, Apache Software Foundation Guide Version 7.3 - Published: 2018-03-27

Similer Documents