0

I have a custom visual web part with a single property named "SerializedTabs". It contains a JSON serialized set of tabs with titles and rich html content. I want these properties to be indexed by the search crawler, but I'm unable to make it work.

As far as I understand the crawler it uses the SharePoint object model to crawl the site and does not actually view the html content of each page. If that is the case then is it possible to tag the property with an attribute which will enable the crawler to index it?

I've tried dumping the actual html into a div (both hidden and visible) on the page itself and have the indexer crawl it, but that didn't work.

Anyone know how I can get the crawler to index my custom web part?

1 Answer 1

0

I solved it myself.

The SharePoint search crawler does not index aspx pages on incremental crawl so I had to do a full crawl.

The second thing I needed to do was to ensure my web part adds its content to the page in the Render method. The reason for this is that the search crawler apparently requests pages with a header that causes SharePoint to only partially process the page. This resulted in the OnPreRender event (in which I populated my content) never being called and my content was not rendered.

public override void Render(HtmlTextWriter writer){
    RenderMyContent(); //Render my stuff here
    base.Render(writer);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.