EPiServer scheduled job will index the whole web site. However you can restrict your search to be under a particular root using search datasource by provind PageLink something like
var searchDataSource = new SearchDataSource
{
PageLink = startSearchFrom,
};
Hope that helps
Hi,
Yes you can configure how Find should index your content. Create an InitializableModule and then you can add:
PageIndexer.Instance.Conventions.ForInstancesOf<PageData>().ShouldIndex(page => page.PageTypeID == 1 && page.IsDecendantOf(root)));
In my example you have to create the IsDecendantOf extension method and check if the page is descendant of your input.
You can read more about indexing here.
The default EPiServer scheduled job is not configurable in that sense.
As for EPiServer Find you can use the answer provided by Johan. If you are using CMS 7 it will automatically index all properties on the pages and blocks but if you are using CMS 6 without PageType builder you will be very limited when searching as you cannot use any of your custom properties.
Hi Henrik,
In CMS 6 I understand that without PageType builder we can't access custom properties. In CMS 7 if I don't use PageType builder can I access the custom properties.
Hi Johan/Henrik,
In the following specified code:
PageIndexer.Instance.Conventions.ForInstancesOf<PageData>().ShouldIndex(page => page.PageTypeID == 1 && page.IsDecendantOf(root)));
What does "root" refer to? Does it refer to the corresponding root page whose child pages alone should be included in indexing and the root page should be declared prior the above ShouldIndex statement as following
PageData root = DataFactory.Instance.GetPage(new PageReference(5));
And how is the current page reference passed to the "IsDesendant(root)" method, as I see only the root page reference is passed to the method assuming the IsDesendant method shall be like the following:
protected bool IsDesendant(root)
{
//return true or false
//here we have the reference of the root page. How do we refer the current page for which the IsDesendant logic should be checked?
}
Thanks.
I have all my pages created through page types in admin mode and haven't used page-type builder. I want to index only pages under a particular root node, say the news items (all of the same page-type). Can the default EPiServer scheduled job configured to carry out such custom indexing? Else how do I do this in an custom indexing scheduled job.