none
How to remove obsolete/orphaned items from TaxonomyHiddenList? RRS feed

  • Question

  • Explanation of Environment: I am running SharePoint 2010 SP1, December CU's.  I have a list item which has a taxonomy column.   As expected, if a term (e.g. “foo”) is deleted from the term store, users no longer see “foo” as an option for new items, but the term remains on previous items because “foo” is not deleted from the TaxonomyHiddenList by the Taxonomy Update Scheduler job. 

    Problem: This presents problems with search because if “foo” is deleted, we don’t want anyone to ever know “foo” existed anywhere on our site.  E.G in search results, listed with the list item.

    Desired Behavior: In addition to updating current items, I would like orphaned terms to be deleted from the TaxonomyHiddenList

    Proposed Solution: Write a custom timer job to iterate through all terms and delete any orphaned items from the TaxonomyHiddenList

    Question: Is this a viable solution?  Am I missing something?  Is there a more elegant way to handle this than manhandling the TaxonomyHiddenList?


    Peter Walke - Clarity Consulting
    • Edited by Pwalke Monday, January 30, 2012 6:18 PM
    Monday, January 30, 2012 6:15 PM

Answers

  • I would say :-) remove it from the TaxonomyHiddenList (this is more performant to remove it from one place than from several places), but then you might jeopardize your migration to a future release of SharePoint, so be very careful...
    Serge Luca; SharePoint MVP ; blog: http://sergeluca.wordpress.com/ Devoteam Belgium. http://twitter.com/sergeluca
    • Marked as answer by Pwalke Monday, January 30, 2012 8:16 PM
    Monday, January 30, 2012 8:12 PM

All replies

  • If you delete foo from all the existing list items that use foo, then why does it matter if you remove it from the hidden list? The hidden list is not searchable and should not cause a problem with searching.
    Blog | SharePoint Field Notes Dev Tool | ClassMaster
    Monday, January 30, 2012 7:01 PM
  • Hi Steve, 

    Thanks for the reply.  I am deleting the item from the term store, not the term from the list.  Once the term is deleted and I run the update job the term still shows up in views for that list.

    Hope this clarifies my situation.


    Peter Walke - Clarity Consulting
    Monday, January 30, 2012 7:11 PM
  • If there are current list items still using the term that was deleted then they should remain in the hidden list. The update job does not remove the term that the list item is still using.
    Blog | SharePoint Field Notes Dev Tool | ClassMaster
    Monday, January 30, 2012 7:30 PM
  • Thanks again for the reply.  I appreciate the thinking behind the default behavior, but the business requirement is for the term to be maintained in the term store, even for deletes, so that "foo" doesn't ever show up again on the site once its deleted from the term store.

    What is the best way to do this?  A custom timer job that performs similar logic to the default timer job?  How much of a "no-no" is it to touch the TaxonomyHiddenList?  Is it as bad as interacting with the SP database directly?

     

     


    Peter Walke - Clarity Consulting
    Monday, January 30, 2012 7:35 PM
  • I would  not touch it. It is used for performance reasons. If the issue is about searching and not wanting the value to show up, then remove the term from all the items that are using it. Do a search, identify the items and remove the term from those items and then it will no longer show up in search results.
    Blog | SharePoint Field Notes Dev Tool | ClassMaster
    Monday, January 30, 2012 7:51 PM
  • I would say :-) remove it from the TaxonomyHiddenList (this is more performant to remove it from one place than from several places), but then you might jeopardize your migration to a future release of SharePoint, so be very careful...
    Serge Luca; SharePoint MVP ; blog: http://sergeluca.wordpress.com/ Devoteam Belgium. http://twitter.com/sergeluca
    • Marked as answer by Pwalke Monday, January 30, 2012 8:16 PM
    Monday, January 30, 2012 8:12 PM
  • Hi Serge, 

    I agree that going through each list is probably the more "blessed" approach, but there is a lot more work to go through each and every list on the site to find where the columns is being used and do maintenance.  Since the TaxonomyHiddenList provides the backing lookup column for metadata, I'm going write the timer job to clean up that list.  I've already confirmed that it behaves as expected when I deleted it through the UI.

    Thanks, all.

    ...Peter


    Peter Walke - Clarity Consulting
    Monday, January 30, 2012 8:16 PM
  • I am pretty confident that this will not get you your desired behavior. If an administrator adds the managed property to the properties returned in the Core Search Results web part then users will still see Foo in the search results. The search crawler will still store foo in the managed properties if foo is still stored with item. I would be curious to know that by removing it from the hidden list that the timer job will also remove it from the items.


    Blog | SharePoint Field Notes Dev Tool | ClassMaster
    Monday, January 30, 2012 8:31 PM
  • Saturday, August 25, 2012 6:39 PM