Search widget content in Kentico 12 mvc

Yowaraj Chhetri asked on September 9, 2019 03:02

Hi, My client has a requirements to be able to search content of widgets which is applied to a page in kentico 12 mvc. For example, widgets is a richtext editor and it is applied to a page type article. I need to be able to search through content of that richtext editor widget apart from content of that page which was inserted from the form tab. Is this possible and if so how can this be done. Thanks in advance.

Regards, Yowaraj

Correct Answer

Dmitry Bastron answered on September 10, 2019 10:10

Hi,

If you want to index a content of the page (including widgets) the best would be using Page Crawler index instead. Please refer to documentation.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Zach Perry answered on September 9, 2019 18:06

The data for the widgets is stored in the CMS_Document table under the column DocumentPageBuilderWidgets. It looks like it is stored in json format.

So you can search for pages that contain a certain string by doing a query like this:

select * from dbo.CMS_Document cd
where cd.DocumentPageBuilderWidgets like '%Lorem Ipsum%'

If you want more detail than that, like what widget contains that string, you will have to parse the data.

0 votesVote for this answer Mark as a Correct answer

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