Solr Delta Import

219 views Asked by At

We have a Post Table

       Post
        PostID, Title, Description, isDeleted, ModifiedDateTime

and Each Post can be assigned or deleted multiple Tags

         Tag
           TagID, PostID, TagValue

How can i Write a sub entity Tag, when i do a delta import if a Tag is Deleted or a New Tag is added then Post Document should be Updated ?

Here is a part of my mapping.xml

      <document name="CollabDocument">

      <entity name="post" transformer="RegexTransformer" dataSource="db" pk="PostID" 

      query="SELECT PostID, Title, Description, CreatedDate FROM Post where isDeleted =   
       0"

     deltaImportQuery="select PostID, Title, Description,CreatedDate FROM Post where              
     PostID='${dataimporter.delta.PostID}'"

     deltaQuery="select PostID from Post where ModifiedDate >

       ${dataimporter.last_index_time}' and isDeleted = 0"

            deletedPkQuery="select PostID from Post where 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 '|') AS TagValues from 
               tags ts  where ts.postid = ${post.PostID} group by ts.PostId">

          <field name="TagValues" column="TagValues" /> 

             </entity>      


0

There are 0 answers