lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Biestro (JIRA)" <>
Subject [jira] Updated: (SOLR-215) Multiple Solr Cores
Date Wed, 30 May 2007 16:19:15 GMT


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
java -Durl='http://localhost:8983/solr/core0/update' -jar post.jar solr.xml
Will index the 2 documents in solr.xml & monitor.xml
Will produce the statistics page from the admin servlet on core0 index; 2 documents
Will produce the statistics page from the admin servlet on core1 index; no documents
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:
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Henri Biestro
>            Priority: Minor
>         Attachments: solr-trunk-533775.patch, solr-trunk-538091.patch, solr-trunk-542847.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
> Some background on the 'whys':

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

View raw message