Return-Path: Delivered-To: apmail-lucene-solr-dev-archive@locus.apache.org Received: (qmail 61535 invoked from network); 23 Jul 2008 04:16:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jul 2008 04:16:25 -0000 Received: (qmail 66406 invoked by uid 500); 23 Jul 2008 04:16:22 -0000 Delivered-To: apmail-lucene-solr-dev-archive@lucene.apache.org Received: (qmail 66335 invoked by uid 500); 23 Jul 2008 04:16:22 -0000 Mailing-List: contact solr-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-dev@lucene.apache.org Received: (qmail 66263 invoked by uid 99); 23 Jul 2008 04:16:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jul 2008 21:16:22 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jul 2008 04:15:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E1089234C18C for ; Tue, 22 Jul 2008 21:15:31 -0700 (PDT) Message-ID: <1951340706.1216786531920.JavaMail.jira@brutus> Date: Tue, 22 Jul 2008 21:15:31 -0700 (PDT) From: "Noble Paul (JIRA)" To: solr-dev@lucene.apache.org Subject: [jira] Commented: (SOLR-646) Configuration properties in multicore.xml In-Reply-To: <4759380.1216748251628.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/SOLR-646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615875#action_12615875 ] Noble Paul commented on SOLR-646: --------------------------------- how is this evaluated? The syntax is not obvious as to what it is doing. I am referring to the type attribute in the following snippet {code} {code} I can't imagine a usecase where field types are dynamically assigned > Configuration properties in multicore.xml > ----------------------------------------- > > Key: SOLR-646 > URL: https://issues.apache.org/jira/browse/SOLR-646 > Project: Solr > Issue Type: New Feature > Affects Versions: 1.3 > Reporter: Henri Biestro > Fix For: 1.3 > > Attachments: solr-646.patch > > > This patch refers to 'generalized configuration properties' as specified by [HossMan|https://issues.apache.org/jira/browse/SOLR-350?focusedCommentId=12562834#action_12562834] > This means configuration & schema files can use expression based on properties defined in multicore.xml. > h3. Use cases: > Share the same schema and/or config file between multiple cores but point to different dataDirs using a ${core.datadir} > Change the general layout between data, config & schema directories. > Define 'installation' wide properties (for replication for instance) in multicore.properties (different base/install/data directories on different hosts). > h3. Syntax: > h4. Defining properties: > Either in the multicore.properties file (usual property format): > {code:xml} > env.value=an installation value > env.other_value=another installation value > {code} > In the multicore.xml: > {code:xml} > > a value > ${env.value} } > > some value > ${mp0}-and some data > > > {code} > h4. Using properties: > Besides used defined properties, the following core descriptor properties are automatically defined in each core context, namely: > {code} > solr.core.instanceDir > solr.core.instancePath > solr.core.name > solr.core.configName > solr.core.schemaName > {code} > All properties can be used in any attribute or text node of a solrconfig.xml or schema.xml as in: > {code:xml} > ${core.dataDir} > {code} > h4. Technical specifications > Multicore.xml can define properties at the multicore & each core level. > Properties defined in the multicore scope can override system properties. > Properties defined in a core scope can override multicore & system properties. > Property definitions can use expressions to define their name & value; these expressions are evaluated in their outer scope context . > Multicore serialization keeps properties as written (ie as expressions if they were defined so). > The core descriptor properties are automatically defined in each core context, namely: > solr.core.instanceDir > solr.core.instancePath > solr.core.name > solr.core.configName > solr.core.schemaName > h4. Test: > The following (contrived) multicore.xml: > {code:xml} > > 33 > 0 > 1 > bogus > bogus > > core${zero}_id > solr.DirectUpdateHandler2 > 11 > > > core${one}_id > solr.DirectUpdateHandler2 > 22 > > > {code} > allows this config.xml: > {code:xml} > > > > > > > > > > > > > > solr > solrconfig.xml schema.xml admin-extra.html > > qt=standard&q=solrpingquery > > > > {code} > and this schema.xml: > {code:xml} > > > > > > > > > > > > > > id > name > > > {code} > Allow the trunk test to work. > h3. Coding notes: > The code itself refactored some of DOMUtil (the ant based property substitution) into one added class (PropertyMap & PropertyMap.Evaluator). > The PropertyMap are chained (one link chain between core to multicore map); those maps are owned by each core's ResourceLoader. > Config is modified a little to accommodate delaying & specializing property expansions. > Multicore is modified so it properly parses & serializes. > Tested against the example above. > Reviews & comments more than welcome. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.