Book Image

Apache Solr for Indexing Data

Book Image

Apache Solr for Indexing Data

Overview of this book

Apache Solr is a widely used, open source enterprise search server that delivers powerful indexing and searching features. These features help fetch relevant information from various sources and documentation. Solr also combines with other open source tools such as Apache Tika and Apache Nutch to provide more powerful features. This fast-paced guide starts by helping you set up Solr and get acquainted with its basic building blocks, to give you a better understanding of Solr indexing. You’ll quickly move on to indexing text and boosting the indexing time. Next, you’ll focus on basic indexing techniques, various index handlers designed to modify documents, and indexing a structured data source through Data Import Handler. Moving on, you will learn techniques to perform real-time indexing and atomic updates, as well as more advanced indexing techniques such as de-duplication. Later on, we’ll help you set up a cluster of Solr servers that combine fault tolerance and high availability. You will also gain insights into working scenarios of different aspects of Solr and how to use Solr with e-commerce data. By the end of the book, you will be competent and confident working with indexing and will have a good knowledge base to efficiently program elements.
Table of Contents (18 chapters)
Apache Solr for Indexing Data
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Inserting data into Solr


Solr provides an easy-to-use command-line tool for sending data in various formats to the Solr server. We can use the post.jar or post.sh tool to send data to the Solr server to index data. Both of these tools are located in %SOLR_HOME%/example/exampledocs in the default installation folder.

Note

To see the commands for Solr 5.x, visit the Solr Wiki (https://wiki.apache.org/solr/).

We'll copy the two files (post.sh and post.jar) to the %SOLR_HOME/bin folder. The post.sh is a Unix shell script that wraps around the cURL command to send data to the Solr server. For Windows users, Solr has provided a standalone Java application packaged in a JAR format. It can be used in a way similar to the post.sh tool.

To run post.jar, open Command Prompt in Windows and enter the following:

$ %SOLR_HOME%/bin>java –jar post.jar –h

The result obtained by executing the preceding commands is as follows:

SimplePostTool version 1.5
Usage: java [SystemProperties] -jar post.jar [-h|-] [&lt...