SharePoint Search Results with DateTime field refiner

When configuring a SEARCH RESULTS page, you can include any of your own custom columns as ‘refiners’.   These show on the side of the results, allowing users to filter down the results.

When you choose a field as a refiner, the data shown will depend on the type of the field.      Eg.  TEXT fields, will just show as the item values

image

When using a DATE field – for some reason, there’s a nasty symptom that doesn’t show the values correctly !

This symptom was also highlighted and blogged by Simon Doy.

WHY ?    The field is showing as 2,012 and 2,013 ??

My refiner is doing the same thing – compared to the Out Of The Box Created field :

image

RESOLUTION

I’m happy to report that there’s a very simple fix – and it’s related to the NAME of the managed property you create.

In my example :

  • DON’T name the property as “STaRCreatedDateTime”
  • Instead – it should be “STaRCreatedDateTimeOWSDATE

There’s some SharePoint JavaScript code that looks for the ‘type’ of the field – within the tail of the field name.    Sure enough – it works !

image

Thanks to SIMON for the tips and investigation – his blog goes into a lot of depth, with a custom refiner to change the look/feel.

It was this tip that saved the day :

image

Thanks Eman !      (Credit where credit is due)

🙂

Advertisements

One thought on “SharePoint Search Results with DateTime field refiner

  1. Pingback: Fixing the slider refiner for custom date managed property - @eliostruyf

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s