Solr 多个 entity 怎么指定一个entity进行查询

_Ricky_ 2018-11-15 10:28:32

创建了多个entity,查询的时候不知道怎么区分,导入到solr索引库时,没有指定导入哪个表,默认导入了article表,查询出的数据也是article表的,我想查employee_info的数据怎么查???

<dataConfig>
<dataSource type="JdbcDataSource" name="dataSource1" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/solr" user="root" password="root" />
<document>
<entity name="article" pk="id"
query="select id,title,author,type from article"
deltaImportQuery="select * from article where id ='${dih.delta.id}'"
deltaQuery="select id from article where update_time > '${dataimporter.last_index_time}'">
<field name="id" column="id"/>
<field name="title" column="title"/>
<field name="author" column="author"/>
<field name="type" column="type"/>
<field name="update_time" column="update_time"/>
</entity>

<entity name="employee_info" flag="emp" pk="id"
query="select id,company_name,user_name,industry,position from employee_info"
deltaImportQuery="select * from employee_info where id ='${dih.delta.id}'"
deltaQuery="select id from employee_info where update_time > '${dataimporter.last_index_time}'">
<field name="id" column="id"/>
<field name="company_name" column="company_name"/>
<field name="user_name" column="user_name"/>
<field name="industry" column="industry"/>
<field name="position" column="position"/>
<field name="update_time" column="update_time"/>
</entity>
</document>
</dataConfig>

...全文
418 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Nihility/ 2018-12-06
  • 打赏
  • 举报
回复
solr 维基百科:https://wiki.apache.org/solr
Nihility/ 2018-12-06
  • 打赏
  • 举报
回复
纠正上一个回复错别字,entity参数不指定 另外solr查,不能说是指定entity查询,查询可以指定索引列,也可以指定过滤的索引列 5.5的文档中索引导入的一些参数。
Nihility/ 2018-12-06
  • 打赏
  • 举报
回复
entity参数不置顶,默认就是导入所有配置的entity。entity的参数的值是你entity的name
weixin_42227350 2018-12-05
  • 打赏
  • 举报
回复
顶上去!!!!
_Ricky_ 2018-12-05
  • 打赏
  • 举报
回复
继续顶!!
_Ricky_ 2018-11-15
  • 打赏
  • 举报
回复
顶上去

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧