Solr Delta Import -
we have post table
post postid, title, description, isdeleted, modifieddatetime
and each post can assigned or deleted multiple tags
tag tagid, postid, tagvalue
how can write sub entity tag, when delta import if tag deleted or new tag added post document should updated ?
here part of mapping.xml
<document name="collabdocument"> <entity name="post" transformer="regextransformer" datasource="db" pk="postid" query="select postid, title, description, createddate post isdeleted = 0" deltaimportquery="select postid, title, description,createddate post postid='${dataimporter.delta.postid}'" deltaquery="select postid post modifieddate > ${dataimporter.last_index_time}' , isdeleted = 0" deletedpkquery="select postid post isdeleted = 1"> <field column="postid" name="id" /> <field column="postid" name="postid" /> <field column="title" name="title" /> <field column="description" name="description" /> <field column="createddate" name="createddate"/> <entity name="triples" datasource="db" transformer="regextransformer" query="select group_concat(ts.value separator '|') tagvalues tags ts ts.postid = ${post.postid} group ts.postid"> <field name="tagvalues" column="tagvalues" /> </entity>
Comments
Post a Comment