Udostępnij za pośrednictwem


SharePoint 2010: Search results by “Create Date” instead of “Modified Date”

 

You may want to have your search results of Office documents with “Created date” instead of “Modified Date”. Or maybe you want both? There’s no out of the box setting or feature to enable or disable the "Create date" property in the SharePoint Server 2010 search results. FAST Search Server for SharePoint 2010 can expand the search back-end as well as the user-interface for SharePoint enterprise environments. But what if we have to deal with SharePoint 2010 without FAST?

It’s still possible having search results with “Create Date” in addition or instead of “Modified Date” for your Office documents, it only requires the below modification.

 

1. Go to Central Administration -> Search Service Application ->Metadata Property Mappings

2. Create a “New Managed Property”

a. Property name: Created

b. Select “Date and Time” for “The type of information in this property”

c. Add mapping “Office:12(Date and Time)” under “Mappings to crawled properties”

d. Select “Add managed property to custom result set retrieved on each query”

e. Hit the OK button

3. Click “Start Full Crawl” under Central Administration -> Search Service Application -> Manage Content Sources

4. Now go to your Search and search for something in order to get the “results.aspx” page

5. Click on “Site Actions” -> “Edit Page”

6. Click “Edit Web part” on the “Search Core Results” web part

7. On the “Search Core Results” web part settings, expand “Display Properties”

8. Uncheck the “Use Location Visualization” checkbox

9. Edit the “Fetched Properties”

a. Click in the text field and hit CRTL+A followed by CTRL+X

b. Open Notepad and hit CTRL+V in order to paste

c. If not present add your new Manager Property "Created" as a column:
<Columns> .... <Column Name="Created"/>....</Columns>

From an out of the box environment, this should look like:
<Columns> <Column Name="WorkId"/> <Column Name="Rank"/> <Column Name="Title"/> <Column Name="Author"/> <Column Name="Size"/> <Column Name="Path"/> <Column Name="Description"/> <Column Name="Write"/> <Column Name="SiteName"/> <Column Name="CollapsingStatus"/> <Column Name="HitHighlightedSummary"/> <Column Name="HitHighlightedProperties"/> <Column Name="ContentClass"/> <Column Name="IsDocument"/> <Column Name="PictureThumbnailURL"/> <Column Name="PopularSocialTags"/> <Column Name="PictureWidth"/> <Column Name="PictureHeight"/> <Column Name="DatePictureTaken"/> <Column Name="ServerRedirectedURL"/> <Column Name="Created"/> </Columns>

d. In Notepad hit CRTL+A followed by CTRL+X

e. Click in the textbox of “Fetched Properties” and hit CTRL+V

10. Modify the XLS:

a. Click on the XSL Editor

b. Copy and paste the content in an advanced text editor (e.g. Notepad++)

c. Locate the below section
<xsl:call-template name="DisplayDate">

<xsl:with-param name="write" select="write" />

</xsl:call-template>

d. Change it to:
<xsl:call-template name="DisplayDate">

<xsl:with-param name="write" select="created" />

</xsl:call-template>

e. Hit CRTL+A followed by CTRL+X

f. Paste back your new XSL content into your Web Part XSL popup.

g. Hit the Save button

11. Hit Apply / OK button on the “Search Core Results” web part settings.

12. Click Save and Close

13. Search again and see the date.

 

Happy searching!  Sukkelige emoticon

Comments

  • Anonymous
    October 26, 2012
    This is what I was looking for!!! Many thanks. Saved my life!

  • Anonymous
    March 04, 2014
    Just perfect... crisp and to the point... long live!!!

  • Anonymous
    November 26, 2014
    Doesn't this just display created date, but still order the results by Modified date (or Relevance)?