Noble Paul നോബിള് नोब्ळ् schrieb:
apparently you have not specified the deltaQuery attribute in the entity.
Check the delta-import section in the wiki
http://wiki.apache.org/solr/DataImportHandler
or you can share your data-config file and we can take a quick look
here is my data-config. I configured both, the deltaQuery and query
entity in one data-config. Is this the correct usecase?
Also, I found it easier to join the document on the database level
instead of leaving it to solr.
<dataConfig>
<dataSource type="JdbcDataSource" driver="org.postgresql.Driver"
url="jdbc:postgresql://bm02:5432/bm" user="user" />
<document name="articles">
<entity name="articles" deltaQuery="SELECT a.id AS article_id,a.stub AS
article_stub,a.ref AS article_ref,a.id_blogs,a.title AS article_title,
a.normalized_text, au.url AS article_url, bu.url AS blog_url, b.title AS
blog_title,b.subtitle AS blog_subtitle, r.rank,
coalesce(a.updated,a.published,a.added) as ts FROM articles a join blogs
b on a.id_blogs = b.id join urls au on a.id_urls = au.id join urls bu on
b.id_urls = bu.id LEFT OUTER JOIN ranks r on a.id = r.id_articles WHERE
b.id_urls is not null AND a.hidden is false AND b.hidden is false AND
a.ref is not null AND b.ref is not null AND (rankid in (SELECT rankid
FROM ranks order by rankid desc limit 1) OR rankid is null) AND
coalesce(a.updated,a.published,a.added) >
'${dataimporter.last_index_time}'"
query="SELECT a.id AS article_id,a.stub AS article_stub,a.ref AS
article_ref,a.id_blogs,a.title AS article_title, a.normalized_text,
au.url AS article_url, bu.url AS blog_url, b.t\
itle AS blog_title,b.subtitle AS blog_subtitle, r.rank,
coalesce(a.updated,a.published,a.added) as ts FROM articles a join blogs
b on a.id_blogs = b.id join urls au on a.id_urls = au\
.id join urls bu on b.id_urls = bu.id LEFT OUTER JOIN ranks r on a.id =
r.id_articles WHERE b.id_urls is not null AND a.hidden is false AND
b.hidden is false AND a.ref is not null AN\
D b.ref is not null AND (rankid in (SELECT rankid FROM ranks order by
rankid desc limit 1) OR rankid is null) AND
coalesce(a.updated,a.published,a.added)">
<field column="article_id" name="a_id" />
<field column="normalized_text" name="norm_text" />
<field column="article_ref" name="id" />
<field column="article_stub" name="stub" />
<field column="id_blogs" name="blog_id" />
<field column="article_title" name="a_title" />
<field column="article_url" name="article_url" />
<field column="ts" name="ts" />
<field column="rank" name="rank" />
<field column="blog_ref" name="blog_ref" />
<field column="blog_title" name="b_title" />
<field column="blog_subtitle" name="subtitle" />
<field column="blog_url" name="blog_url" />
</entity>
</document>
</dataConfig>
Florian