Gravatar for madhu.sudan@honeywell.com

Question by Madhusudan, Jan 11, 2019 9:04 AM

How to overwrite the default title using custom post/pre conversion script

Hi All,

For one of our source, we want overwrite the default "Title" value coming from source by some custom field. In my post conversion script I have tried below options but nothing seems to working out.

#1 DocumentInfo.SetFieldValue("Title", newTitleFromFileName);

#2 DocumentInfo.SetFieldValue("coveo_Title", newTitleFromFileName);

#3 DocumentInfo.SetFieldValue("systitle", newTitleFromFileName);

Can anyone please help, how can we overwrite the original "Title" value

Thanks!

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jan 14, 2019 10:55 AM

Is this question for Coveo Enterprise Search (CES) on-premises index?

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Jan 14, 2019 11:18 AM

CES Converter API documentation archive: https://docs.coveo.com/en/2692//preconversion+scriptsarchived-content/converter-api---ces-7-0

From this documentation, I was able to find that the correct syntax is `DocumentInfo.Title = "value"`.

The reason is that title is not only a field on the indexed documents but it is primarily a document property. You have to set it from the property and it will propagate to the field as well.

Gravatar for madhu.sudan@honeywell.com

Comment by Madhusudan, Jan 14, 2019 11:25 AM

Yes, that's correct "Title" is not ordinary field that's why "DocumentInfo.SetFieldValue" was not working. Later I figured it out how to do it :)

Thanks for response.

Ask a question