索引中索引多个表数据

时间:2017-02-13 14:01:29

标签: mysql solr

我目前正在使用Solr搜索索引我的数据库表数据。对于一个实体它工作正常但是当我试图从多个表中获取数据时我无法索引它们可以有人帮助我这个

我的data-config.xml如下

<dataConfig>
<dataSource type="JdbcDataSource" name="data_source_0" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://127.0.0.1:3306/akresidential_saya" user="root" password="gaian"/>
<document>             
 <entity name="events" 
                datasource="data_source_0" 
                pk="eveID"
                query="select eveID,name,type from events"
               >
         <field column="name" name="name"/>
            <field column="type" name="type"/>
            <field column="eveID" name="eveID"/>
          </entity>


    <entity name="publishers" 
        datasource="data_source_0" 
        pk="id"
        query="select name,cat,id,domain from publishers"
       >
       <field column="name" name="name"/>
        <field column="cat" name="cat"/>
        <field column="id" name="id"/>
    <field column="domain" name="domain"/>
      </entity>
</document>
</dataConfig>

由于我是Solr的新手,我无法定义我的schema.xml,因此我可以单独索引上述两个表数据,并且这两个表应该在同一个核心

之前我搜索过这个并且在我尝试它们时得到的一些例子并不是很顺利。所以我需要基于上面两个表文件的样本schema.xml,以便我可以满足我的要求

EDITED: 当我在事件表上完成全部数据导入时,我得到了这样enter image description here 但当我开始为我的发布商的表格进行完整的数据导入时,我得到了这样的enter image description here

它获取了记录但未在Solr中添加为文档 提前致谢

0 个答案:

没有答案
相关问题