SOLR consolidates Tomcat examples, detailed steps;

Source: Internet
Author: User
Tags solr
1.1. SOLR Consolidated Tomcat 1.1.1. SOLR Home and Solrcore

Create a SOLR home directory, Solrhome is the home directory that SOLR runs, including the configuration files and data files running the SOLR instance, theSOLR instance is Solrcore, A solrhome can include multiple Solrcore (SOLR instances), each solrcore providing a separate search and Indexing Service.

EXAMPLE\SOLR is a SOLR home directory structure, as follows:

bin file; collectionl file; README.txt file; solr.xml file; zoo.cfg

In the image above, "Collection1" is a solrcore (SOLR instance) directory, the contents of which are as follows:

Conf folder; Data folder; core.properties file; README.txt file

Description

Collection1: Called a SOLR Run instance Solrcore,solrcore name is not fixed, a SOLR run instance provides an index and a search interface separately from the outside.

Multiple SOLR Run instance Solrcore can be created in Solrhome.

A running instance of SOLR corresponds to an index directory.

Conf is the configuration file directory for Solrcore.

The data directory that holds the index file needs to be created

1.1.2. Integration Steps

First step: Install Tomcat. D:\temp\apache-tomcat-7.0.53

Step two: Copy the Solr War package into Tomcat's WebApp directory.

Copy the \solr-4.10.3\dist\solr-4.10.3.war to the D:\temp\apache-tomcat-7.0.53\webapps.

renamed to Solr.war
Step three: Solr.war decompression. Use the compression tool to unzip or start the Tomcat automatic decompression. Remove Solr.war after decompression

Fourth step: Add all the jar packages under the \solr-4.10.3\example\lib\ext directory to the SOLR project

Fifth step: Configure Solrhome and Solrcore.

1) Create a solrhome (a folder that holds all of SOLR's configuration files). The \SOLR-4.10.3\EXAMPLE\SOLR directory is a standard solrhome.

2) Copy the \SOLR-4.10.3\EXAMPLE\SOLR folder to the D:\temp\0108 path, renamed to Solrhome, renaming is not necessary, is to facilitate understanding.

3) Under Solrhome There is a folder called Collection1 which is a solrcore. is an example of SOLR. A solrcore is equivalent to a database in MySQL. Solrcore are isolated from each other.

I. There is a folder called Conf in Solrcore that contains the configuration information for the index SOLR instance.

II. There is a solrconfig.xml under the Conf folder. Configures information about the instance. If you use the default configuration, you do not have to make any modifications.

configuration information FOR xml:

Lib: The SOLR service relies on the expansion pack, the default path is the Collection1\lib folder, and if not, create a

DataDir: The storage path of the index library is configured. The default path is the Collection1\data folder, which is created automatically if there is no Data folder.

RequestHandler:

//select is the URL to use when configuring queries

<requesthandler name= "/select" class= "SOLR. Searchhandler ">

<lst name= "Defaults" >

<str name= "Echoparams" >explicit</str>

<int name= "Rows" >10</int>

<str name= "DF" >text</str>

<lst>

Update is the URL that is used when configuring the maintenance index

<requesthandler name= "/update" class= "SOLR. Updaterequesthandler ">

<lst name= "Defaults" >

<str name= "Echoparams" >explicit</str>

<int name= "Rows" >10</int>

<str name= "DF" >text</str>

<lst>

Sixth step: Tell the SOLR server configuration file the location of Solrhome. Modify Web. Xml to tell the SOLR server how to use Jndi.

the Solr/home name must be fixed.

<env-entry>

<env-entry-name>solr/home</env-entry-name>

Configured as your own solrhome

<env-entry-value>/put/your/solr/home/here</env-entry-value>

<env-entry-type>java.lang.String</env-entry-type>

</env-entry>

Seventh Step: Start Tomcat

Eighth Step: Visit http://localhost:8080/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: info-contact@alibabacloud.com 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.