Apache Solr – Open Source Enterprise Search Platform – Installation

               In this post ,we will discuss about the Apache Solr installation using tomcat web container. In this article, we are using Apache Solr 4.2.1 version. By the time you read this article, if the latest version is available, you can use the same.

To get start with installation, follow the below steps.Apache Solr

Step 1: Download the Apache Solr from the given link(http://www.apache.org/dyn/closer.cgi/lucene/solr/4.2.1 ) and extract the zip folder. After unzipping the folder , we can see the below folder structure.        

Solr_Folder_StructureStep 2: Download the Apache Tomcat from the given link(http://tomcat.apache.org/download-70.cgi).

Step 3: From the “dist” folder, copy “solr-4.2.1.war” to tomcat “webapps” directory and rename “ solr-4.2.1.war” to “ solr.war”

Step 4: Now, we need to create “SOLR HOME”.The Solr home contains all the configuration files related to our search setup. To create “SOLR HOME” ,create a folder with any name in your local file system. In this example, I have created folder as “solr_home”. The directory structure under “solr_home” is given below.

             solr_home1

Here,”sampleCatalog” is the Solr core name. The core is configured in “solr.xml”. The configuration from the solr.xml is given below.


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<solr sharedLib="lib" persistent="true">

<cores adminPath="/admin/cores">

<core default="true" instanceDir="sampleCatalog" name="sampleCatalog"/>
</cores>
</solr>

Step 5: The folder structure under “sampleCatalog” core is given below.

 solr_home2

 

Here, the purpose of each directory is given below.

conf → contains all the configuration files

data → contains the index files

lib → contains all the libraries.All the libraries which will be availble under lib folder will be in class path.

Step 6: Copy solr-core-4.2.1.jar,solr-dataimporthandler-4.2.1.jar and solr-dataimporthandler-extras-4.2.1.jar files from the “dist” directory( see step 1) to the lib directory of solr home(see step 5).

Step 7: The files under “conf” folder is given below(Copy the below files from example/example-DIH/solr/solr/conf) folder which we have in Step 1).

        solr_home3

Here,we need to concentrate on db-data-config.xml,schema.xml and solrconfig.xml files.We will talk more about these files in the coming post.

Step 8: Now, configure solr home environment variable under tomcat configuration file called “context.xml” by adding the below line.

<Environment name="solr/home" type="java.lang.String" value="<PATH TO THE SOLR HOME WHICH WE CREATED UNDER STEP 4>" override="true" />

Step 9: Start the tomcat container and issue the request <http>://<hostname >:<port>/solr. If the configuration is done properly, you are able to see the below response.

Solr Admin

Now, the installation of Solr is done.In the coming post, we will discuss, how to configure data import handler to import the data from the database.

Stay tuned….

Advertisements

I am Siva Prasad Rao Janapati. Working as a software developer. Has hands on experience on ATG Commerce(DAS/DPS/DCS), Mozu commerce, Broadleaf Commerce, Java, JEE, Spring, Play, JPA, Hibernate, Velocity, JMS, Jboss, Weblogic,Tomcat, Jetty, Apache, Apache Solr, Spring Batch, JQuery, NodeJS, SOAP, REST, MySQL, Oracle, Mongo DB, Memcached, HazelCast, Git, SVN, CVS, Ant, Maven, Gradle, Amazon Web services, Rackspace, Quartz, JMeter, Junit, Open NLP, Facebook Graph,Twitter4J, YouTube Gdata, Bazzarvoice,Yotpo, 4-Tell, Alatest, Shopzilla, Linkshare. I have hands on experience on open sources and commercial technologies.

Tagged with: ,
Posted in Apache Solr, SolrInstall

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

DZone

DZone MVB

Java Code Geeks
Java Code Geeks
%d bloggers like this: