Solr DatImportHandler,同一类型的多个结果?
嘿伙计们,我们将一如既往地感谢这里的一些帮助。
我正在使用 Solr 从数据库索引数据。第一个表 event_titles 中的每一行可以有多个与其关联的开始日期,这些开始日期包含在表 event_dates 中。数据配置如下;
<entity name="events"
query="select id,title_id,name,summary,description,type from event_titles">
<entity name="events"
query="select start from event_dates where title_id = '${events.title_id}'">
</entity>
</entity>
使用 DIH 开发控制台,我可以看到它按应有的方式返回每个日期,但它只保存第一个日期,例如;
<lst name="entity:event_dates">
<str name="query">
select start from event_dates where title_id = '38947'
</str>
<str name="time-taken">0:0:0.10</str>
<str>----------- row #1-------------</str>
<date name="start">2010-04-25T23:00:00Z</date>
<str>---------------------------------------------</str>
<str>----------- row #2-------------</str>
<date name="start">2010-04-26T23:00:00Z</date>
<str>---------------------------------------------</str>
<str>----------- row #3-------------</str>
<date name="start">2010-04-27T23:00:00Z</date>
<str>---------------------------------------------</str>
</lst>
但是,运行选择时的结果如下......
...
<arr name="start">
<date>2010-04-25T23:00:00Z</date>
</arr>
...
我会认为它会将所有返回的日期放入开始“数组”中?
任何人都可以阐明这是否可能吗?
干杯!
Hey guys, some help here would as always be greatly appreciated.
I'm indexing data from a db using Solr. Each row in the first table, event_titles, can have more than one start date associated with it, contained in the table event_dates. Data-config is as follows;
<entity name="events"
query="select id,title_id,name,summary,description,type from event_titles">
<entity name="events"
query="select start from event_dates where title_id = '${events.title_id}'">
</entity>
</entity>
Using the DIH Develpment Console, I can see that it returns each date as it should, but it only ever saves the first one, for example;
<lst name="entity:event_dates">
<str name="query">
select start from event_dates where title_id = '38947'
</str>
<str name="time-taken">0:0:0.10</str>
<str>----------- row #1-------------</str>
<date name="start">2010-04-25T23:00:00Z</date>
<str>---------------------------------------------</str>
<str>----------- row #2-------------</str>
<date name="start">2010-04-26T23:00:00Z</date>
<str>---------------------------------------------</str>
<str>----------- row #3-------------</str>
<date name="start">2010-04-27T23:00:00Z</date>
<str>---------------------------------------------</str>
</lst>
But, the result when you run a select is as follows....
...
<arr name="start">
<date>2010-04-25T23:00:00Z</date>
</arr>
...
I would have though it would put all the returned dates into the start 'array'?
Can anyone shed any light on whether this is even possible?
Cheers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已修复,架构中的 multiValued 应设置为 true。
Fixed, multiValued in schema should be set to true.