Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
In Sharepoint 2013 Search Results refinement panel, the OOTB date refinement Modified Date has the dates option set as Last day, week, month, six months and year.
But the slider with the graph, does not have any option to refine by last six months. It directly goes from last month to last year.
Is this a bug or something I am missing? I have checked and there is content for last 6 months.
If you export the web part and locate the JSON string that contains the "refinerConfigurations" you can change the "useDefaultDateIntervals":false
and then set your own intervals like "intervals":[-365,-180,-30,-7,-1]. Dates in the past are negative and the future are positive.
If you don't know how to export and import a web part let me know and I'll add that detail to the answer.
Thanks Matt, this would definitely be useful and I have upvoted it. But the question still remains, is this a bug? If yes, I haven't seen any reports of it being listed as a bug, so that the dev team can fix it. It even applies to SharePoint online.
A Display Template "~sitecollection/_catalogs/masterpage/Display Templates/Filters/Filter_SliderBarGraph.html" is responsible for displaying the refinement Panel. The Display Template gets its parameters from the Web Part.
When you export the "Refinement Panel" Web Part, you will see this section:
The section "userDefaultDateIntervals":true forces the display. You will need to change that to false in order to have the option to alternative date intervals.
So, even though -180 is a default value in the refiner type, it is not a default "Interval" to be shown in the "Display Template"
When you examine the bar chart that is controlling a Date-based Refiner, you will also notice that each bar takes 2 values rather than a single one in order to display a "date range". For example one of the bar charts take from "one month" to "one year". This means the values in the web parts are not mapped one to one to the display template. but 2 values from the refiner is used to construct "one" refinement options.
The separation of parameters configure in the refiner from the parameters that govern the display helps prevent one key issue: you do not want someone to specify large number of values in the refinement search schema other than the default which ends up damaging the display. For example, you do not want to have 20 bars in the left side of the screen and very little space to show the data on a standard Monitor.
Can you explain a little more? Maybe I am being naive. If it says refine by 6 months, then it should show 6 months OOTB, correct? Why do I need to modify the webpart and update the JSON properties?
@RansherSingh This is infact by design. All people have different needs. Maybe you require 6 months slider and I want a 3 month. Somebody else will require a 9 month. We can customize it but the OOTB is like that only.
I agree, but if the OOTB control says 6 months should it not display it? Ok, I will assume that this was what the dev team meant was that 6 months is possible but just not available out of the box. Thanks to everyone who gave their inputs.