Date Range Custom Refiner

Recently, I had a project where a group wanted to show an aging report using SharePoint’s search capabilities. The easiest way to accomplish this is the use of refiners, but I struggled with this quite a bit until I figured out that the left argument of the custom value must ALWAYS be less than the right argument. Here was my final refinement XML markup:

 <Category Title="Aging" Description="Aging groups for items based on the submission date"
  MetadataThreshold="3" NumberOfFiltersToDisplay="5"
  MaxNumberOfFilters="0" SortBy="Custom" ShowMoreLink="True"
  MappedProperty="SubmitDate" MoreLinkText="show more"
  LessLinkText="show fewer">
    <CustomFilters MappingType="RangeMapping" DataType="Date"
    ValueReference="Relative" ShowAllInMore="False">
      <CustomFilter CustomValue="0-30 Days">
      <CustomFilter CustomValue="30-60 Days">
      <CustomFilter CustomValue="60-90 Days">
      <CustomFilter CustomValue="60-90 Days">
      <CustomFilter CustomValue="120+ Days">

This is part of a much larger application that has several search customizations, but you could use this with any out of the box managed properties dealing with dates.

If you want more details on custom refiners, check out Michal Prisarek’s Custom Refinement Filters in SharePoint 2010 Overview. This is a great overview of custom refiners and was one of my jumping off points for this project.


5 thoughts on “Date Range Custom Refiner

  1. I personally blog also and I’m posting a thing comparable to this particular post, “Date
    Range Custom Refiner | SharePoint Dev Notes” ocomp .
    Would you care in cases where Iapply a number of of your own tips?
    Thanks for your effort ,Jillian

      1. Hi can we create multiple surveys in a single survey list?
        How to display all the questions of a survey in a page provided with a feedback button?
        Please respond to my question…..

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s