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:
-
- <?XML Version="1.0" Encoding=UTF-8" ?>
-
- <SOLR Persistent="False">
-
- cores adminpath = "/admin/cores " >
- core name = " core0 " instancedir = " core0 " />
- <Core Name="Core1" Instancedir="Core1" />
-
- </Cores>
- </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:
- <Context Docbase=Solr-cores.war" Reloadable="True" >
- <Environment Name = "SOLR/home" Type = "Java. Lang. String" Value = "E:/solr1.3/example/multicore" Override = "True" />
-
- </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:
-
- E: \ solr1.3 \ example \ multicore \ exampledocs> JAVA-durl = http: // localhost: 8080/SOLR-cores/core0/update-dcommit = yes-jar post. Jar ipod_video.xml
- Simpleposttool: version 1.2
-
- Simpleposttool: Warning: Make sure your XML documents are encoded in UTF-8, other encodings are not currently supported
-
- Simpleposttool: POSTing files to http: // localhost: 8080/SOLR-cores/core0/update ..
-
- Simpleposttool: posting file ipod_video.xml
-
- Simpleposttool: Committing SOLR index changes ..
-
-
- E: \ solr1.3 \ example \ multicore \ exampledocs> JAVA-durl = http: // localhost: 8080/SOLR-cores/core1/update-dcommit = yes-jar post. Jar ipod_other.xml
- Simpleposttool: version 1.2
-
- Simpleposttool: Warning: Make sure your XML documents are encoded in UTF-8, other encodings are not currently supported
-
- Simpleposttool: POSTing files to http: // localhost: 8080/SOLR-cores/core1/update ..
-
- 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