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

Setting up SolrCloud


In this section, we will see how we can set up multiple nodes of Solr servers on a single physical machine. We'll clone the example folder that comes with the default Solr installation to create multiple shards.

Let's go ahead and set up a two-node Solr instance. We'll navigate to our Solr instance and execute the following command:

$ cd $SOLR_HOME
$ cp -r example shard1
$ cp –r example shard2

After running the preceding commands, we'll see that there are two folders (shard1 and shard2) that are now ready.

Let's go ahead and start the two solr nodes that we just created. To do this, we'll navigate to $SOLR_HOME/bin folder:

  • shard1:

    $ ./solr start -cloud -d ../shard1 -p 8983
    
  • shard2:

    $ ./solr start -cloud -d ../shard2 -p 8987 -z localhost:9983
    

After running the two nodes, we can navigate to http://localhost:8983/solr and can see a Cloud tab activated. This example was performed on a fresh installation of Solr, so the results will be different if we don't use a fresh installation...