Posting example documents to the first Solr core

First, we will cover how to write a generic, simple, and useful configuration for Solr core and become familiar with the number of binary files saved to the disk.

We will write our new configuration from the beginning, using as few elements as we can, reducing them to essential parts in order to focus on the main concepts.

Analyzing the elements we need in Solr core

In order to use Solr we have to create a small set of files that define what we usually call a configuration for a core. Solr core is simply a working Lucene index with Solr configuration files, which we need to learn to write.

A typical Solr core directory looks like the one shown in the following figure, which is a structure for the basic example I have put on the disk under the /SolrStarterBook/solr-app/chp01/ directory, after posting some documents:

Analyzing the elements we need in Solr core

We call the Solr Home folder on the filesystem, where a running Solr instance reads the configuration to start with. This should not be confused with the installation of Solr, as that can be on a different path. Solr Home contains one or more Solr cores, each containing a special /conf directory that holds its configurations and a /data directory for storing the index on the disk.

Note

You can obtain a copy of the resources for this book at https://bitbucket.org/seralf/solrstarterbook. It contains the instructions to download the correct resource files.

We will refer to the resources path as /SolrStarterBook, so please remember where you copy the provided examples! To simplify things a bit more, I suggest you download the latest Solr distribution and put it under the directory /SolrStarterBook/solr; this would make it easier to adapt a relative path to the library when needed for our configurations.

If you look at the /SolrStarterBook/solr-app directory in the sources provided for the book, you will find that it contains different examples of core configuration, organized according to the chapters in which they are explained. Every folder of a chapter can be used as a Solr Home directory. Even for Chapter 1, Getting Ready with the Essentials, I created an example (named basic, in the /chp01 directory), with the smallest set of configurations derived from the default example. Feel free to use them in your first tests as a sort of template for your own experimentation.

After posting some data, you should find some files in the other /data/index directory. These are the binary files to save the state of the index on a disk, split into optimized segments.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.211.166