Setting up EPiServer find demo index – The remote server returned an error: (413) Request Entity Too Large. 

When running indexing for EPiServer find, the “EPiServer Find Content Indexing Job” in admin tools. The episerver find logs were filling up with these errors:

The remote server returned an error: (413) Request Entity Too Large. 

Problem connected to restrictions for the developer demo index.
I added this setup method as last setup line to the FindInitializationModule:

	    private static void DemoIndexSetting()
	    {
	        string demoIndexSettings = ConfigurationManager.AppSettings["EnableEPiServerFindDemoIndexSettings"];
	        bool demoIndexEnabled = false;
	        if (bool.TryParse(demoIndexSettings, out demoIndexEnabled))
	        {
	            if (demoIndexEnabled)
	            {
                    /* 
                     * demo index has the following limitations:
                        Maximum 10000 documents
                        Maximum 5MB request size
                        Maximum 25 queries per second
                        The index will be removed after 90 days
                     */
                    ContentIndexer.Instance.Conventions.ForInstancesOf<IContentMedia>().ShouldIndex(x => false); //dont index any mediafiles, size limit is 5MB 
                    ContentIndexer.Instance.MediaBatchSize = 3; //default 5
	                ContentIndexer.Instance.ContentBatchSize = 20; //default 100, but demo has limit of 25 
	            }
	        }
	    }

Also added this setting to web.config to enable this feature for certain environments. (dev, test etc. using transformations)

<appSettings>
    ...
    <add key="EnableEPiServerFindDemoIndexSettings" value="true" />

Demo developer services:

https://find.episerver.com/

Leave a Reply

Your email address will not be published. Required fields are marked *