lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From haopham <anhhaoapt...@gmail.com>
Subject Problem with db-data-config.xml in solr
Date Wed, 29 Dec 2010 09:56:21 GMT

Hi all,
I am doing with solr, and when I create this db-data-config.xml file, run to
import data from database to solr

<dataConfig>   
	<dataSource  driver="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:./database/demo/exampledb" user="sa"/> 		
    <document name="solr_prototype">
		<entity name="company" 
				pk="company_id"
				query="select company_id, company_name, company_location,
company_director from company">
				
            <field column="company_id" name="company_id" />
            <field column="company_name" name="company_name" />
            <field column="company_location" name="company_location" />			
			<field column="company_director" name="company_director" />
			
			<entity name="persons"					
					processor="org.apache.solr.handler.dataimport.CachedSqlEntityProcessor" 
					pk="person_id" 
					query="select person_id, person_name, person_address, person_aemail
from persons where person_id = ${company.company_director}  ">
					
				<field column="person_id" name="person_id" />
				<field column="person_name" name="person_name" />
				<field column="person_address" name="person_address" />
				<field column="person_aemail" name="person_aemail" />
			</entity>			
        </entity>
    </document>
</dataConfig>



It allway said that it can not execute the query .

"select person_id, person_name, person_address, person_aemail from persons
where person_id = "
It mean there is nothing after =
So it can not execute query.

The problem is that, if I replace person_id = ${company.company_director} by
person_id = 1
it run well and return result.

Please tell me what I am wrong  and how to fix it
Best regards,
Hao Pham

-- 
View this message in context: http://lucene.472066.n3.nabble.com/Problem-with-db-data-config-xml-in-solr-tp2162025p2162025.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Mime
View raw message