concept logmill in category solr

appears as: logmill, logmill
Solr in Action

This is an excerpt from Manning's book Solr in Action.

To illustrate the core concepts in SolrCloud, we use the example of a search engine to power a log aggregation and analytics service called logmill. This fictitious application aggregates log messages from many systems into a centralized search engine to power monitoring, data visualization, and analytics of application activity.

In this section, we will launch a Solr cluster for our log aggregator service, logmill. Specifically, our first Solr cluster will have a single index split across two instances of Solr running on your local workstation. Each split, known as a shard, will contain roughly half the documents for the logmill application.

In SolrCloud, an index split across multiple nodes is called a collection. Up to this point, you have only worked with Solr cores (a single index on one node) and have not encountered the concept of a Solr collection. We’ll dig deeper into the details of a collection in section 13.2.1. For now, think of a collection as an index split across multiple Solr nodes. For our example application, we’ll call the collection logmill.

Figure 13.1. Cloud panel, showing the graph view of the logmill collection containing two shards. The first Solr instance we started is the leader for shard1.

Re-execute the match all docs query (*:*) against the logmill core to see that queries now execute successfully. Of course we have not added any documents to the logmill collection, so the result shows zero documents. Let’s fix this by adding a few example documents.

Because our fictitious logmill search application is for log files, let’s index an example log file containing Solr log messages using a simple utility provided in the example code.

cd $SOLR_IN_ACTION
java -jar solr-in-action.jar indexlog -log=example-docs/ch13/solr.log

The indexlog utility parses the specified solr.log file and indexes a new document for every log message. Re-execute the match all docs query (*:*) after running the indexlog utility to verify that the logmill index contains 300 documents. When a document is indexed in SolrCloud, it is routed to one of the shards based on a hash of its unique ID by default. We’ll cover the details of how documents get routed in section 13.3. A document can exist in only one shard. Each shard covers an exclusive hash range, and the hash function attempts to distribute documents evenly between shards so that each shard in your cluster remains about the same size. We’ll cover distributed indexing in more detail in section 13.3. Table 13.1 shows the distribution of documents after running the indexlog utility.