Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > How to add extra Fields to smart search index View modes: 
User avatar
Member
Member
lancetek - 1/24/2014 7:37:14 AM
   
How to add extra Fields to smart search index
Hi,
How can I add an extra *calculated* search field to a Document's Smart Search index? eg: We have a Document type of 'Company'. The Company Smart Search index is named idxCompany. It's nice to be able to use the CMS to define the index fields - but I'd like to add an additional field 'UserFullName', which I want to populate when the index is rebuilt/updated via a query against the CMS_User table.

Any Ideas?

User avatar
Kentico Support
Kentico Support
kentico_romank - 2/13/2014 2:34:24 AM
   
RE:How to add extra Fields to smart search index
Hi,

At first I would like to mention that upcoming Kentico CMS version 8 will have more customization possibilities in terms of update and rebuild process.

As for version 7, you could add an additional field to your document type in Site Manager -> Development -> Document types -> Fields. After that you will have to go to Search fields tab and make this newly added field searchable and tokenized (in case you want to apply analyzer).

Next step would be creating an event handler (http://devnet.kentico.com/docs/devguide/index.html?event_handlers_overview.htm), this handler will be fired before a document is created or updated, in this handler you will populate the field with your data.

I hope this information helps.

Best Regards,
Roman Konicek