Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Smart search on custom tables linked to document types View modes: 
User avatar
Certified Developer 8
Certified Developer 8
liquidmagic - 5/4/2012 3:13:26 AM
   
Smart search on custom tables linked to document types
Hello,

I have the following case. I have a document type (articles) that on one field holds a primary key of a custom table. The custom table has categories for the articles. So, the custom table has two fields: itemid and category. The itemid is a number and the category is text.
The document type field holds the number (the id of the custom table). On the form there is a drop down from which the editors select the category.

The problem is that when someone searches using smart search the actual field of the category is not searchable. Is there a way to have this custom field searchable? So for example if someone searches "books" which is the category of some articles those articles are displayed.

Also, normally what is the way to display this field on transformations? What I do is join the custom table with the document type on the selectdocument query and get the category field. Is there a better way to do it?

Any help is appreciated.

Dimitris

User avatar
Member
Member
kentico_michal - 5/6/2012 5:09:50 AM
   
RE:Smart search on custom tables linked to document types
Hi,

I would like to point you to the following forum thread which describes a solution you can take advantage of: Custom table search.

In case of Kentico CMS 6.0, you can use the same approach. The only difference is that you can use the global event DocumentEvents.GetContent, as demonstrated here: Event handlers overview.

In terms of the search results transformation, the GetSearchValue returns the ID of the custom table record, so to display the text, you would need to create a custom transformation method: Adding custom functions to transformations.

If you need more information about code customization possibilities in Kentico CMS 6.0, the following blog could give you more information: Code customization in Kentico CMS 6.


Best regards,
Michal Legen