Pergunta

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.

Foi útil?

Solução

A similar question has been asked before: https://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.

Outras dicas

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.

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.

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.

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top