6

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.

12
+50

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. – Ransher Singh Jul 3 '15 at 12:42
  • It's not a bug. – Matthew McDermott Jul 3 '15 at 14:36
  • 1
    Then why did it not show six months refinement OOTB? It goes directly from one month to one year. – Ransher Singh Jul 3 '15 at 14:50
1

It is not a bug. This is by design.

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:

{"propertyName":"LastModifiedTime","type":"DateTime","sortOrder":0,"displayTemplate":"~sitecollection/_catalogs/masterpage/Display Templates/Filters/Filter_SliderBarGraph.js","sortBy":0,"maxNumberRefinementOptions":0,"displayName":"","useDefaultDateIntervals":true,"aliases":["Write","FileWrite","DAV:getlastmodified"],"refinerSpecStringOverride":"","intervals":null}

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.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • 1
    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? – Ransher Singh Jul 6 '15 at 19:22
  • Can you provide some back-up to your statement? Answers with no supporting facts aren't very helpful. – wjervis Jul 6 '15 at 20:00
  • @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. – Taran Goel Jul 7 '15 at 5:02
  • 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. – Ransher Singh Jul 7 '15 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.