Moving blogs post with Attachments using Rest API

We are trying to move blogs posts to a blog in an Archive Group using Rest.  When a blog post contains an attachment, I'm finding that there is a duplicate file created in Te_attachments table and the original attachment is marked as isindexed so it still shows up in Search for the original group.  Is there a proper way to handle the attachment?

Parents
  • te_Attachments doesn't have its own index, do you mean that the blog post shows up as indexed?

    Have you ensured that Search Index has run since the move?

    Are there any exceptions in the exceptions log?

  • Let me clarify.  The blog post shows up in the old group in the search facet.   It is actually located in the correct group.  However, the duplicate file in te_attachment is still concerning because it is tied to both the old and new blog application with the same contentid.

    9109 454 1 0 34207 2482 2012-11-30 14:26:24.770 ESG Offsite Agenda 5 DEC 2012 Rev 4.docx application/vnd.openxmlformats-officedocument.word
    27210 836 1 0 34207 0 2021-02-11 19:08:45.670 ESG Offsite Agenda 5 DEC 2012 Rev 4.docx application/vnd.openxmlformats-officedocument.word

  • Can you share the syntax with the sensitive data removed?

    I confirmed that the old attachment record stayed after a move, but after giving search time to update its index, it was showing up properly in the new location for me when searching by title, text, etc.

    Is search running properly? Any related exceptions in the logs?

  • All the moved posts have isindexed=0 in te_blog_posts.  There is nothing wrong with search that I can see and no exceptions show up.  Is the group name correct in the facet in your test? It shows correctly in the results, but the facet filter still has old group name.  This definitely indicates the search is not updating.  

  • IsIndexed = 0 is definitely indicating the search is not updating. What is the schedule of your Search Indexing job? What's the next scheduled time at Administration > Monitoring > Jobs > filter to "Search Index"?

    I logged a bug for the extra attachment record... However, it's not affecting the search indexing issue.

    TE-17054

  • It is Job e112276f-46f9-401d-b763-a1d0e2488280 is scheduled to process at Wed, Aug 25 2021 3:48 PM.

    Some of these blogs posts were moved 6 months ago, so the search should have updated by now :-)

  • Indeed... and there are no exceptions in Administration > Monitoring > Exceptions for the time frame around moving the posts? or any Search Indexing exceptions around/after those times?

    Are any of these posts showing the proper updated location when searched?

  • There are no errors in the logs.  The posts are show correctly in the new blog when searched.  Only issue with that since the search is not updated the facet is incorrect and I can't search by the new tag I applied to the post during the move.  This is only an issue with posts with attachments.  Other posts are fine without attachments are fine

  • Does UpdateTags also make a REST call? Can you share the code for that? I'm unable to reproduce this issue making the same REST request to move a blog post with an attachment. My post is quickly indexed again after move, despite the secondary issue with the duplicate Attachment record noted above.

    When you say the posts show correctly in the new blog - do you mean when you click the search result you get to the new location? when you mouse over the link, is it the correct link to the new location or does it stil show the old location?

    And you say other posts without attachments are being moved and marked as indexed with no issues? There are no exceptions like "There was an error indexing content" in Administration > Monitoring > Exceptions? and the Search Index Job is enabled and running at a regular schedule?

  • Yes, the Update Tags makes are rest call.  I sent the code in a PM.  The search results show correct links and when you click on the link, you go to new group.  There are no messages in the Exception log.  I have tried editing the blog posts to trigger re-index, but still nothing happens, they don't get indexed.

  • How are you populating the custom search facet? It doesn't line up with tag/convert code you sent. Do you have additional customizations around populating search records?

    At this point, the root cause that needs to be solved is the blog posts that are not being indexed (SELECT * FROM te_Blog_Posts WHERE IsIndexed = 0). Search Indexing does not ignore posts, and would throw errors if something goes wrong in the indexing. How often is Search Index Job running? Is there something custom that is continuing to update these posts, for example an AfterUpdate listener calling the Update API?

  • There are no customization to search results other than the facet being buttons instead of dropdownlists.  That is just HTML and CSS. There are no updates to blog posts by customizations.  Again the search works and does not list any errors indexing unless the attachment is over 40MB which is normal.  There are 349 records with isindexed=0 in that te_Blog_posts table.  This is more than 124 that was due to moving posts to a new group...

Reply
  • There are no customization to search results other than the facet being buttons instead of dropdownlists.  That is just HTML and CSS. There are no updates to blog posts by customizations.  Again the search works and does not list any errors indexing unless the attachment is over 40MB which is normal.  There are 349 records with isindexed=0 in that te_Blog_posts table.  This is more than 124 that was due to moving posts to a new group...

Children