Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have Search Server Express 2010 that is crawling web site content such as this:

<meta name="publishDate" content="04/26/2011 16:58:00" />

In search administration my tags appear in Crawled Properties as a text field: crawled property

I want to map publishDate to the lastModifiedDate property, but I can't. How can I change its type to 'date'?

UPDATE

Tried to do it with powershell and command Set-SPEnterpriseSearchMetadataCrawledProperty but had no luck. It says the VariantType parameter doesn't exist.

share|improve this question
add comment

5 Answers

up vote 4 down vote accepted
+50

A similar question has been asked before: http://stackoverflow.com/questions/166178/searching-date-meta-tags-in-sharepoint

The short answer involves writing your own protocol handler - not for the faint hearted, but it should work nicely.

share|improve this answer
add comment

This is how we configure crawled props (before indexing them!):

New-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $searchapp 
    -Name publishdate -Category Web 
    -IsNameEnum $false -VariantType 64 
    -PropSet "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX" -IsMappedToContents $true

Variant type is 64 - which is the date/time type. Add the correct Propset Guid.

share|improve this answer
add comment

It seems the field is of data type Text (with content which represents a date), since it's crawled as Text. If you want to use the field for dates with time, you have to set the data type of the field (the data type of the column in the list or library) to Date and Time. Then it will be crawled as a real Date and Time data type and the mapping will be possible.

When you change the column data type from Text to Date and Time a new crawled property will be created with data type Date and Time.

share|improve this answer
    
I've tried to create a new managed property of DateTime type. But after crawl search server creates duplicate property with the same name but string type –  Sly May 20 '11 at 12:55
    
Of what data type is the column in the list or library which shows up as crawled property? –  Anita Boerboom May 20 '11 at 13:03
    
crawled property comes from <meta /> tag of crawled HTML web page. Its not sharepoint content –  Sly May 23 '11 at 9:21
add comment

Perhaps you should try surfacing the lastModified coulmn in your page directly?
Maybe a small section in the footer that says: Page Published with a DateTimeField surfacing the column.
This way the crawler will correctly identify the underlying datatype of the column, create the mapped property with the right variant type and you can map it as you desire.

share|improve this answer
    
What do you mean by surfacing? –  Sly May 23 '11 at 13:42
    
Put a feild in the page that references the coulmn. Like this one: <SharePointWebControls:FieldValue FieldName="[FieldGuid]" runat="server"></SharePointWebControls:FieldValue > –  GavinB May 25 '11 at 20:37
    
its not sharepoint page. Its html –  Sly May 26 '11 at 6:17
add comment

Did you try to create a new crawled property with the appropriate VariantType (Date) by PowerShell command New-SPEnterpriseSearchMetadataCrawledProperty. Also, maybe the DateTime value has to be in the correct format to be parsable.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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