Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

Include more data on an PageData object

$
0
0

Hi,


First, I'm not using PageTypeBuilder in this project, but maybe I'm gonna add that for some specific page types.


Alot of the web pages are a collection of other pages, e.g. teaser pages and more specific in this case tabs.

Now I'm using the PageIndexer and sets some conventions, like;

PageIndexer.Instance.Conventions.ForInstancesOf<PageData>()
    .ShouldIndex(page =>
        PageTypesToIndex.Contains(page.PageTypeID) &&
        page["ExcludePageInSearch"] == null);

But how do I include more data to the pages, like tabs and teasers? The client class has IncludeField, so I tried that;

IClient client = Client.CreateFromConfig();
client.Conventions.ForInstancesOf<PageData>()
    .IncludeField(page => page.GetExtraContent());

GetExtraContent() is an extension method which loops through all tab pages and generates a string of all content. But the content this methods returns is not searchable. I can't see the content in 'Explore Index' either.


How can I add more content to an PageData so it's searchable?

 


Viewing all articles
Browse latest Browse all 6894

Trending Articles