Custom search index for 'RighNodeID' in CMS_Relationship

Rashid Hannan asked on September 28, 2018 10:43

Hello, I'm new in Kentico and would like to create a custom index, in the K11 documentation its showing how to create a custom index on file, but i want it on system table "CMS_Relationship".

Can anyone help me with this please. Thank you in advance

Recent Answers


Brenden Kehren answered on September 28, 2018 18:51

Check out the Kentico API Examples on how to work with relationships. Instead of using files, you can change your code to use relationships.

0 votesVote for this answer Mark as a Correct answer

Rashid Hannan answered on October 1, 2018 09:03

@Brenden thank you for your answer,

apparently I Want to index pages and not relationship names, The only current issue is "RightNodeID" column is not searchable using a Pages index.

I'm using the below SQL in the (Smart Search Filter), but whenever I select a value nothing showing in the (Smart search Restults)

"SELECT DISTINCT 'RightNodeID', '(int)' + CONVERT(varchar(10), [DocumentID]), CategoryDisplayName, [DocumentID] FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) INNER JOIN SiteName_CategoriesPageType AS C WITH (NOLOCK) ON [V].[DocumentForeignKeyValue] = [C].CategoriesPageTypeID AND V.ClassName = N'SiteName.CategoriesPageType' INNER JOIN [CMS_Relationship] AS D WITH (NOLOCK) ON [V].[DocumentID] = [D].[RightNodeID] AND [RelationshipNameID] = 2"

as I'm new in Kentico and not fully aware of all its classes/methods.

I don't know if anyone already create a custom index includes all of the data from a Pages index and added an additional fields?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.