SOLR multicore trial note)

Source: Internet
Author: User
Tags solr

Source:Http://blog.chenlb.com/2009/01/try-solr-multicore.html

SOLR multicore is a new feature of SOLR 1.3. The target SOLR instance can have multiple search applications. Let's take a test.

Official release example. Under the solr1.3/example/multicore directory (which can be considered as multi. Home), there is a SOLR. XML (this is only the default file, of course, you can also specify another file), such:

  1. <?XML Version="1.0" Encoding=UTF-8" ?>
  2. <SOLR Persistent="False">
  3. cores adminpath = "/admin/cores " >
  4. core name = " core0 " instancedir = " core0 " />
  5. <Core Name="Core1" Instancedir="Core1" />
  6. </Cores>
  7. </SOLR>
 
 

This file tells SOLR to load those cores. Some files contain core0 and core1, and the two directories should be in the Multi. Home Directory. Core0 (similar to the previous SOLR. Home)/conf directory contains schema. xml and solrconfig. XML, which can be used to copy the actual application. In this example, the official website is used.

Deployment: Copy solr1.3/Dist/apache-solr-1.3.0.war to put under webapps such as Tomcat server, and rename it to solr-cores.war (of course it can be other ). Write a solr-cores.xml file in the tomcat/CONF/Catalina/localhost directory, such:

  1. <Context Docbase=Solr-cores.war" Reloadable="True" >
  2. <Environment   Name = "SOLR/home"   Type = "Java. Lang. String"   Value = "E:/solr1.3/example/multicore"   Override = "True"   />
  3. </Context>
 
 

Start Tomcat. WatchHttp: // localhost: 8080/SOLR-coresYou can see admin core0 and Admin core1. Now the data is submitted. Copy solr1.3/example/exampledocs/post. jar to the solr1.3/example/multicore/exampledocs directory. Then submit data for the two cores, as shown below:

  1. E: \ solr1.3 \ example \ multicore \ exampledocs> JAVA-durl = http: // localhost: 8080/SOLR-cores/core0/update-dcommit = yes-jar post. Jar ipod_video.xml
  2. Simpleposttool: version 1.2
  3. Simpleposttool: Warning: Make sure your XML documents are encoded in UTF-8, other encodings are not currently supported
  4. Simpleposttool: POSTing files to http: // localhost: 8080/SOLR-cores/core0/update ..
  5. Simpleposttool: posting file ipod_video.xml
  6. Simpleposttool: Committing SOLR index changes ..
  7. E: \ solr1.3 \ example \ multicore \ exampledocs> JAVA-durl = http: // localhost: 8080/SOLR-cores/core1/update-dcommit = yes-jar post. Jar ipod_other.xml
  8. Simpleposttool: version 1.2
  9. Simpleposttool: Warning: Make sure your XML documents are encoded in UTF-8, other encodings are not currently supported
  10. Simpleposttool: POSTing files to http: // localhost: 8080/SOLR-cores/core1/update ..
  11. Simpleposttool: posting file ipod_other.xml
 
 

After submitting the data, you can check it.
Http: // localhost: 8080/SOLR-cores/core0/select /? Q = * % 3A * & version = 2.2 & START = 0 & rows = 10 & indent = on
Http: // localhost: 8080/SOLR-cores/core1/select /? Q = * % 3A * & version = 2.2 & START = 0 & rows = 10 & indent = on

The result is returned!

SOLR multicore combines SOLR distributed searching to split large indexes for search

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.