You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by haopham <an...@gmail.com> on 2010/12/29 11:03:03 UTC

Problem with db-data-config.xml when import data from database to solr

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-when-import-data-from-database-to-solr-tp2162049p2162049.html
Sent from the Apache Tika - Development mailing list archive at Nabble.com.