Gravatar for mskutta@onenorth.com

Question by Mike Skutta, Nov 1, 2016 4:04 PM

Modified Date coming up as 12/31/1400

Hello,

I performed a rebuild of the indexes and several of the items in the index have a modified date of 12/31/1400. I created a Post Item pipeline step to check the args.CoveoItem.ModfiedDate of these items to confirm the modified date, and the modified dates are correct. At some point after the Post Item Processor, the date changes to 12/31/1400.

I even tried programtically setting args.CoveoItem.ModifiedDate and the date is not respected.

Could this be a bug? This is not happening to all items.

License Type: SitecoreCloudTrialEdition Version: 4.0.450

Thanks, Mike

Gravatar for flguillemette@coveo.com

Comment by François Lachance-Guillemette, Nov 1, 2016 4:24 PM

What are the items where you have this problem?

The modified date is set using Sitecore's API.

Some native Sitecore items have a badly-formed date set in the Modified field. Those items should not be indexed OOTB though.

Gravatar for mskutta@onenorth.com

Comment by Mike Skutta, Nov 1, 2016 5:08 PM

The items are custom items in the content tree. They are not native items. I took a look at the Raw Value for the Updated date and it has this value: 20160721T195519Z. When I looked at the Modified Date in the Post Item Processor, it actually looked like it was correct. It matches the Update date in Sitecore. It is just that the Modified date in the Coveo index does not match.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Nov 2, 2016 8:21 AM

Do you index the HTML version of those items for quickview? If so, does your HTML contains this meta?

<meta http-equiv="last-modified" content="YYYY-MM-DD@hh:mm:ss TMZ" />

Is the meta content attribute value a valid date too?

I think the Coveo index HTML converter would take this date if available instead of the date set on the Sitecore item.

Gravatar for mskutta@onenorth.com

Comment by Mike Skutta, Nov 2, 2016 8:36 AM

I am setting args.CoveoItem.BinaryData to custom HTML in a Post Item Processor. The custom HTML is built using the HtmlContentBuilder. I am not specifically setting that tag. I have looked through the resulting HTML generated by the HtmlContentBuilder and there are no dates present. I have not setup Coveo to crawl the HTML content. If you think it is beneficial, I can add that tag.

Is there a Modified Date Selection Sequence similar to the Title Selection Sequence?

Gravatar for mskutta@onenorth.com

Comment by Mike Skutta, Nov 3, 2016 11:17 AM

I tried setting the tag as indicated and it didn't resolve the date issue. I have since removed the tag…

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Nov 3, 2016 3:37 PM

1400 seems to be the minimum date from the boost C++ library used by the index. It seems to me that your items were indexed without a modified date or with an invalid one which caused a default on the minimum date.

The accepted date format of the Coveo index is yyyy/MM/dd@HH:mm:ssZ. If you are setting the date in another format, you're likely to get that kind of problems.

Gravatar for mskutta@onenorth.com

Comment by Mike Skutta, Nov 3, 2016 4:09 PM

Hi Jean-Francois,

I added the tag back to the HTML using the format you specified and rebuilt the index, it did not resolve the issue. Here is the HTML I am using:

<html><head><meta http-equiv="last-modified" content="2014/05/27@05:00:00Z" /></head><body>...</body></html>"

The Items that have the incorrect date also have the following custom fields:

  • Date
  • PostedRssDateAndTime
  • DisplayDate
  • ArchiveDate

Is it possible that these fields are being picked up? Maybe the Date field? The Date field has a raw value of: 20140527T000000. (this is how Sitecore stores the date)

Thanks! Mike

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Nov 3, 2016 5:06 PM

The meta suggestion was a blind guess on my side. I guessed that if present, it could override the set modifieddate. But I didn't suggest to add it.

Since you are setting the binaryData/body of the indexed documents with HTML content, you are in fact setup Coveo to crawl some HTML content.

Maybe the Sitecore Date field is overriding the modifiedDate. Can you try renaming this field?

Gravatar for mskutta@onenorth.com

Comment by Mike Skutta, Nov 3, 2016 6:18 PM

Thanks Jean-Francois,

It was the custom "Date" field we had on our Items that conflicted. Removing the "date" field from the Metadata in the Post Item Processor resolved the issue. Thanks for all of your help.

Is there a list of custom field names that Coveo may pick up and try to use for its own internal purposes? So far I have found that any custom fields named "Date" and "Title" are picked up by Coveo and have special meaning.

Thanks, Mike

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Nov 4, 2016 8:25 AM

I think all the Coveo index system fields are subject to be overridden by Sitecore fields with the same name. That includes addeddate, author, concepts, date, language, links, month, parents, site, size, title, year and much more.

Ask a question