[ 
https://issues.apache.org/jira/browse/SOLR-215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Henri Biestro updated SOLR-215:
-------------------------------

    Attachment: solr-trunk-542847.patch

A revised version of the patch based on revision 542847.

The patch was produced with the following command run from trunk directory:
svn diff --diff-cmd /usr/bin/diff -x "-w -B -b -E -d -N" > 
solr-trunk-542847.patch
This should take care of the white spaces as well as inclusion of new files.
All unit tests behave as in the single core version; 133 tests, 5 failures, 0 
errors

The content of the patch also includes modifications to the admin, servlet & 
filters to accomodate the declaration & handling of multiple cores. The example 
conf & web.xml have been modified to declare 2 other cores (besides the 
default) named 'core0' and 'core1'.
The filter itself forwards to the proper servlet if no specific handler exists 
in the core configuration.
Example:
Step0
java -Durl='http://localhost:8983/solr/core0/update' -jar post.jar solr.xml 
monitor.ml
Will index the 2 documents in solr.xml & monitor.xml
Step1:
http://localhost:8983/solr/core0/admin/stats.jsp
Will produce the statistics page from the admin servlet on core0 index; 2 
documents
Step2:
http://localhost:8983/solr/core1/admin/stats.jsp
Will produce the statistics page from the admin servlet on core1 index; no 
documents
Step3:
java -Durl='http://localhost:8983/solr/core0/update' -jar post.jar ipod*.xml
java -Durl='http://localhost:8983/solr/core1/update' -jar post.jar mon*.xml
Adds the ipod*.xml to index of core0 and the mon*.xml to the index of core1;
running queries from the admin interface, you can verify indexes have different 
content.

Comments & advice welcome.



> Multiple Solr Cores
> -------------------
>
>                 Key: SOLR-215
>                 URL: https://issues.apache.org/jira/browse/SOLR-215
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Henri Biestro
>            Priority: Minor
>         Attachments: solr-trunk-533775.patch, solr-trunk-538091.patch, 
> solr-trunk-542847.patch, solr-trunk-src.patch
>
>
> Allow multiple cores in one web-application (or one class-loader):
> This allows to have multiple cores created from different config & schema in 
> the same application.
> The side effect is that this also allows different indexes.
> Implementation notes for the patch:
> The patch allows to have multiple 'named' cores in the same application.
> The current single core behavior has been retained  - the core named 'null' - 
> but code could not be kept 100% compatible. (In particular, Solrconfig.config 
> is gone; SolrCore.getCore() is still here though).
> A few classes were only existing as singletons and have thus been refactored.
> The Config class feature-set has been narrowed to class loading relative to 
> the installation (lib) directory;
> The SolrConfig class feature-set has evolved towards the 'solr config' part, 
> caching frequently accessed parameters;
> The IndexSchema class uses a SolrConfig instance; there are a few parameters 
> in the configuration that pertain to indexing that were needed.
> The SolrCore is built from a SolrConfig & an IndexSchema.
> The creation of a core has become:
> //create a configuration
> SolrConfig config = SolrConfig.createConfiguration("solrconfig.xml");
> //create a schema
> IndexSchema schema = new IndexSchema(config, "schema0.xml");
> //create a core from the 2 other.
> SolrCore core = new SolrCore("core0", "/path/to/index", config, schema);
> //Accessing a core:
> SolrCore core = SolrCore.getCore("core0");
> There are few other changes mainly related to passing through constructors 
> the SolrCore/SolrConfig used.
> Some background on the 'whys':
> http://www.nabble.com/Multiple-Solr-Cores-tf3608399.html#a10082201
> http://www.nabble.com/Embedding-Solr-vs-Lucene%2C-multiple-Solr-cores--tf3572324.html#a9981355

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to