locked
Refinement Panel Drill Down Content Types and Sub Content Types RRS feed

  • Question

  • Hi,

    I am busy with a question of a customer regarding filtering and drilling down on Content Types in a refinement panel of the SharePoint Enterprise Search.

    I defined allready the primary refinement, but the customer also would like to filter based on the Content Type and show the Sub Content Types of this Content Type.

    I don't know if there is a simple way to resolve this question, or do I have to develop a custom Refinement Panel Web Part?

    Regards

    Friday, June 15, 2012 12:40 PM

Answers

  • Andre,

    If you mean is there some way for the refinement panel to magically know which content types inherit from your specified content type then the answer is no.  The CustomFilters element can only specify three Data Types:

    <CustomFilters
         MappingType="ValueMapping|RangeMapping"
         DataType="Date|Numeric|String"
         ValueReference="Relative|Absolute"
         ShowAllInMore="True|False">
         ...
    </CustomFilters>

    So if you want automatic discovery of inherited content types, you will probably need to write your own refiner - unless you can get a custom managed property to return the content type ID instead of the content type name.  In that case, you would be able to use a relative ValueReference and specify ranges like "0X101.." since all child content type IDs start with the same characters as the parent.  Another way you could do this (which is not at all practical) would be to maintain a strict naming convention, like "Documents", "Documents - Legal", "Documents - HR" etc.

    Two more things I'll mention here:

    • If your document type hierarchy doesn't change that often and you don't mind mirroring your document type structures in XML, simply apply it to the Refinement Schema like so:
    <CustomFilter CustomValue="Document">
            <OriginalValue>Document</OriginalValue>
            <OriginalValue>Document - Legal</OriginalValue>
            <OriginalValue>Document - HR</OriginalValue>
     </CustomFilter>

    and that will do just what you want but you would have to make sure to update your xml each time a change to the content hierarchy was changed.

    • Writing your own refiner wouldn't be that hard because of the property of content type IDs which I've already mentioned.

    I hope that helps.  If you need any more information or want assistance with a custom refiner, I suggest you open a Service Request with us.


    Adam


    Thursday, July 5, 2012 6:24 PM

All replies

  • Hi,

    Thanks for sharing the post.

    I’m trying involve someone familiar with this topic to further look at this issue.

    Thanks,


    Qiao Wei

    TechNet Community Support

    Tuesday, June 19, 2012 9:41 AM
  • Hi,

    Thanks for sharing the post.

    I’m trying involve someone familiar with this topic to further look at this issue.

    Thanks,


    Qiao Wei

    TechNet Community Support

    Thank you!!
    Wednesday, June 20, 2012 7:30 AM
  • Hi Andre,

    You will need to do two things:

    1) Make sure you are indexing a custom property.  For example call it: ContentTypeRefinement and map it to to the ows_ContentType property.

    2) Modify the Filter Category Definition" under "Refinement" in the Tool Part for the Refinement Panel.  You'll need to add a <Category> tag something like the following:

     <Category Title="Content Type" Description="The content type of the item" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="1"

                NumberOfFiltersToDisplay="4" MaxNumberOfFilters="0" SortBy="Frequency" SortDirection="Descending" SortByForMoreFilters="Name" SortDirectionForMoreFilters="Ascending"

                ShowMoreLink="True"  MappedProperty="ContentTypeRefinement" MoreLinkText="show more"   LessLinkText="show fewer">

        <CustomFilters MappingType="ValueMapping" DataType="String" ValueReference="Absolute" ShowAllInMore="False">

          <CustomFilter CustomValue="Announcement">

            <OriginalValue>Announcement</OriginalValue>

          </CustomFilter>

          <CustomFilter CustomValue="Document">

            <OriginalValue>Document</OriginalValue>       

          </CustomFilter>

          <CustomFilter CustomValue="Wiki Page">

            <OriginalValue>Wiki Page</OriginalValue>

          </CustomFilter>

        </CustomFilters>

      </Category>

    Of course you will need to change the <OriginalValue> tags to conform to your custom content types.

    Please see:

    http://msdn.microsoft.com/en-us/library/ee819920

    for more information about the Refinement Panel XML Schema. You'll need to carefully consider all the properties of the schema to make sure you are getting the results you expect.

    Best of luck.


    Adam



    Wednesday, July 4, 2012 3:21 AM
  • Hi,

    Thank you for your answer, I don't know if I should rephrase the question, but say I have the Content Type document and I have two categories:

    Content Type

    • Document (Selected)
    • Wiki Page
    • Announcement

    Sub Content Type

    • Functional Design (derived from Document)
    • Technical Design (derived from Document)

    If I hit Document It should display all Sub content types derived from Document.

    Regards

    Thursday, July 5, 2012 7:59 AM
  • Andre,

    If you mean is there some way for the refinement panel to magically know which content types inherit from your specified content type then the answer is no.  The CustomFilters element can only specify three Data Types:

    <CustomFilters
         MappingType="ValueMapping|RangeMapping"
         DataType="Date|Numeric|String"
         ValueReference="Relative|Absolute"
         ShowAllInMore="True|False">
         ...
    </CustomFilters>

    So if you want automatic discovery of inherited content types, you will probably need to write your own refiner - unless you can get a custom managed property to return the content type ID instead of the content type name.  In that case, you would be able to use a relative ValueReference and specify ranges like "0X101.." since all child content type IDs start with the same characters as the parent.  Another way you could do this (which is not at all practical) would be to maintain a strict naming convention, like "Documents", "Documents - Legal", "Documents - HR" etc.

    Two more things I'll mention here:

    • If your document type hierarchy doesn't change that often and you don't mind mirroring your document type structures in XML, simply apply it to the Refinement Schema like so:
    <CustomFilter CustomValue="Document">
            <OriginalValue>Document</OriginalValue>
            <OriginalValue>Document - Legal</OriginalValue>
            <OriginalValue>Document - HR</OriginalValue>
     </CustomFilter>

    and that will do just what you want but you would have to make sure to update your xml each time a change to the content hierarchy was changed.

    • Writing your own refiner wouldn't be that hard because of the property of content type IDs which I've already mentioned.

    I hope that helps.  If you need any more information or want assistance with a custom refiner, I suggest you open a Service Request with us.


    Adam


    Thursday, July 5, 2012 6:24 PM