Try our conversational search powered by Generative AI!

Start Page not set in CatalogIndexer


I am trying to integrate a custom elastic search implementation.

In order to index products, I created a class inherited from CatalogIndexBuilder so when the indexing job is run, I can call my elastic search client to index the catalog items.

I need the start page of the site and for some reason, ContentReference.StartPage is not set.  When I run the site normally, the start page is set correctly but not when the scheduled job is run.

Any ideas?

Oct 14, 2015 17:15


check out thie blog post:

See Ted's comment: 

You may run into similar problems in scheduled jobs. One way around it is to add a wildcard binding (“*”) for your default site.

That will then be your default site definition (as in SiteDefinition.Current.StartPage or ContentReference.StartPage) when there’s no current site, or outside of web requests.

Oct 14, 2015 20:14

Thanks for the suggestion.  I can give that a try and probably will work until I have one site.  

Is there a way to figure out which site the job is running for and get the start page based on that?

Oct 14, 2015 20:25

Are you creating a multisite with several start pages? Otherwise it will not be a problem.

If you are running the scheduled the job in a multisite setup though, I don't think there is a way to see which site the job is running on, as the scheduled job is not running on a web request. A possible solution could be to get the RootPage instead (ContentReference.RootPage), and then do a GetChildren to get all start pages, and the find the correct one.

Oct 14, 2015 20:54
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.