atom feed5 messages in org.apache.lucene.solr-userUsing properties from core configurat...
FromSent OnAttachments
gist...@gmx.deNov 17, 2008 6:27 am 
Noble Paul നോബിള്‍ नोब्ळ्Nov 17, 2008 7:47 pm 
Shalin Shekhar MangarNov 17, 2008 9:31 pm 
gist...@gmx.deNov 18, 2008 1:04 pm 
Noble Paul നോബിള്‍ नोब्ळ्Nov 18, 2008 8:20 pm 
Subject:Using properties from core configuration in data-config.xml (
Date:Nov 17, 2008 6:27:01 am


is it possible to use properties from core configuration in data-config.xml? I want to define the "baseDir" for DataImportHandler.

I tried the following configuration:

*** solr.xml ***

<solr persistent="false"> <cores adminPath='null'> <core name="core0" instanceDir="/opt/solr/cores/core0"> <property name="solrDataDir" value="/opt/solr/cores/core0/data" /> <property name="xmlDataDir" value="/home/xml/core0" /> </core> ... </cores> </solr>

*** data-config.xml ***

<dataConfig> <dataSource type="FileDataSource" /> <document> <entity name="xmlFile" processor="FileListEntityProcessor" baseDir="${xmlDataDir}" fileName="id-.*\.xml" rootEntity="false" dataSource="null"> <entity name="data" pk="id" url="${xmlFile.fileAbsolutePath}" processor="XPathEntityProcessor" ... </dataConfig>

But this is the result:

... Nov 17, 2008 1:50:08 PM org.apache.solr.handler.dataimport.DataImporter
doFullImport INFO: Starting Full Import Nov 17, 2008 1:50:08 PM org.apache.solr.core.SolrCore execute INFO: [posts-politics] webapp=/solr path=/dataimport
status=0 QTime=66 Nov 17, 2008 1:50:08 PM org.apache.solr.core.SolrCore execute INFO: [posts-politics] webapp=/solr path=/dataimport
params={qt=/dataimport&wt=javabin&version=2.2} status=0 QTime=0 Nov 17, 2008 1:50:08 PM org.apache.solr.update.DirectUpdateHandler2 deleteAll INFO: [posts-politics] REMOVING ALL DOCUMENTS FROM INDEX Nov 17, 2008 1:50:08 PM org.apache.solr.handler.dataimport.DataImporter
doFullImport SEVERE: Full Import failed org.apache.solr.handler.dataimport.DataImportHandlerException: 'baseDir' should
point to a directory Processing Document # 1 at
org.apache.solr.handler.dataimport.FileListEntityProcessor.init( ...

I tried also to configure all dataimport settings in solrconfig.xml, but I don't
know how to do this exactly. Among other things, I tried this format:

*** solrconfig.xml ***

... <requestHandler name="/dataimport"
class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <lst name="datasource"> <str name="type">FileDataSource</str> <lst name="document"> <lst name="entity"> <str name="name">xmlFile</str> <str name="processor">FileListEntityProcessor</str> <str name="baseDir">${xmlDataDir}</str> <str name="fileName">id-.*\.xml</str> <str name="rootEntity">false</str> <str name="dataSource">null"</str> <lst name="entity"> <str name="name">data</str> <str name="pk">id</str> <str name="url">${xmlFile.fileAbsolutePath}</str> ... </requestHandler> ...

But all my tests (with different "dataimport" formats in solrconfig.xml) failed:

... INFO: Reusing parent classloader Nov 17, 2008 2:18:14 PM org.apache.solr.common.SolrException log SEVERE: Error in solrconfig.xml:org.apache.solr.common.SolrException: No system
property or default value specified for xmlFile.fileAbsolutePath at
org.apache.solr.common.util.DOMUtil.substituteProperty( at
org.apache.solr.common.util.DOMUtil.substituteProperties( ...

Thanks again for your excellent support!