SOLR Tomcat Integration Tutorial

Source: Internet
Author: User
Tags mkdir solr zip tomcat

1. About SOLR

SOLR is a lucene-based Java search engine server. SOLR provides level search, hit highlighting, and supports multiple output formats (including XML/XSLT and JSON formats). It is easy to install and configure, and comes with an HTTP-based management interface. SOLR has been used in a number of large sites, more mature and stable. SOLR has packaged and expanded Lucene, so Solr basically follows the terms of Lucene. More importantly, the index created by SOLR is fully compatible with the Lucene search engine library. By properly configuring SOLR, some situations may require coding, and SOLR can read and use indexes built into other Lucene applications. In addition, many Lucene tools (such as Nutch, Luke) can also use the index created by SOLR.

2. Tomcat under SOLR installation configuration
Since SOLR is based on Java development, SOLR is well-deployed in both Windows and Linux, but since SOLR provides some shell scripts for testing and managing and maintaining more convenient shells, it is recommended to install Linux on production deployments. It can be used in Windows when testing.

The following is a description of the Linux under Installation configuration SOLR, similar to Windows.

wget Http://


MV Apache-tomcat-6.0.16/opt/tomcat

chmod 755/opt/tomcat/bin/*


Tar zxvf apache-solr-1.2.0.tgz

method based on the current path
CP Apache-solr-1.2.0/dist/apache-solr-1.2.0.war/opt/tomcat/webapps/solr.war


Cp-r apache-solr-1.2.0/example/solr//opt/solr-tomcat/



In this case (without setting the SOLR.SOLR.HOME environment variable or jndi), SOLR looks for./SOLR, so you need to switch to/opt/solr-tomcat at boot time

based on environment variable Solr.solr.home

Add the following environment variable in the current user's environment variable (. bash_profile) or in/opt/tomcat/


based on Jndi configuration


Touch/opt/tomcat/conf/catalina/localhost/solr.xml, the contents are as follows:

<context docbase= "/opt/tomcat/webapps/solr.war" debug= "0" crosscontext= "true" >

<environment name= "Solr/home" type= "java.lang.String" value= "/OPT/SOLR-TOMCAT/SOLR" override= "true" />


Access to the SOLR management interface HTTP://IP:PORT/SOLR

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.