开发者

Sharepoint 2010 Taxonomy not filtering correctly

开发者 https://www.devze.com 2023-02-09 23:57 出处:网络
I have a strange one with Taxonomy filtering in Sharepoint 2010, but I am able to replicate it on all 3 servers.开发者_如何学Go

I have a strange one with Taxonomy filtering in Sharepoint 2010, but I am able to replicate it on all 3 servers.开发者_如何学Go

Here is how the scenario plays out:

  1. Have a fully populated termSet with many child nodes (about 4500).
  2. Add 1 custom list, with 2 fields (Title , and a Managed Metadata field, this links to termSet) - all this done using GUI.
  3. Add a list item (or a couple) by hand, and select a term to populate the metadata field (depth in the tree structure is about 4 nodes down)
  4. Test the filtering on the list based on this term - works like a charm.

Now at this point I run my import job which adds items to another list. This 2nd list also has a managed meta data field pointing to the termSet.

  1. add 1000 items, no problem. Works like a charm
  2. add another 1000 , no problem.
  3. somewhere around 2000 and 4500 items something went wrong, because after run is finished, I'm now left in the following scenario:

List 1 filtering doesn't work. List 2 filtering, definitely doesn't work.

Exactly what happens is. I select a top level term, and it should include all sub items. It did this perfectly before the mass insert of list items that use terms in the termset. After the insert, when I select the top level term, I get an empty set back, and no button to include descendants.

I'm investigating this hidden list, which has a lot to do with filtering as I've noticed. Filtering primarily checks this (not yet exactly sure how / why).

Anyone else had this issue? The only source of documentation on this are Microsoft Sharepoint Evangelical Blogs (Marketing), no detailed explaination why this isn't working.

Please assist.


Rule number 1: when dealing with Sharepoint never trust it to work.

if (fRecursive && (numArray.Length > 300))
    {
        int[] numArray2 = numArray;
        object[] data = new object[] { termSetId.ToString(), termId.ToString(), numArray2.Length.ToString(CultureInfo.InvariantCulture) };
        ULS.SendTraceTag(0x66367766, ULSCat.msoulscat_DLC_DM, ULSTraceLevel.Medium, "Disable recursive term clause: Too many descendent IDs for term. Termset[{0}]Term[{1}] Descendent ID count[{2}]", data);
        numArray = TaxonomyField.GetWssIdsOfTerm(SPContext.Current.Site, termStoreId, termSetId, termId, false, 500);
        MetadataNavigationContext current = MetadataNavigationContext.Current;
        if (current != null)
        {
            current.ForceTreeDescendentsOff();
        }
    }
(numArray.Length > 300)

Reflected from Sharepoint.Taxonomy, notice the current.ForceTreeDescendentsOff();

So if you have a situation where you might need to return more than 300 records from a Taxonomy filter, it seems not to be able to do this. Pretty good for an enterprise solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消