Helpful Episerver Find configuration parameters when bulk-changing Content

casper.rasmussen/ June 19, 2016/ Uncategorized/ 0 comments

Episerver Find is considered a near-realtime search engine. It’s achieved via a event-driven strategy that automatically propagates content-changes to the Search Index whenever Content changes in either Episerver CMS or Episerver Commerce. We’ve experienced that Episerver Find can have a hard time managing large – as in thousands – sets of bulk changes.

What we meet is an exception indicating that our host is running out of memory and is failing during some Episerver Find indexing.

An exception occurred while indexing content 5030: Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.IO.MemoryStream.set_Capacity(Int32 value)
at System.IO.MemoryStream.EnsureCapacity(Int32 value)
at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at EPiServer.Find.AttachmentConverter.ReadFully(Stream input)
at EPiServer.Find.AttachmentConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.Serialization.JsonSerializerProxy.SerializeInternal(JsonWriter jsonWriter, Object value, Type rootType)
at EPiServer.Find.Api.BulkActionConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at EPiServer.Find.Json.Serializer.SerializeToTextWriter(JsonSerializer serializer, Object value, TextWriter textWriter)
at EPiServer.Find.Json.Serializer.SerializeObjectsToJsonRequest(JsonSerializer serializer, IJsonRequest jsonRequest, IEnumerable values)
at EPiServer.Find.Api.BulkCommand.Execute()
at EPiServer.Find.Client.Index(IEnumerable objectsToIndex)
at EPiServer.Find.Cms.ContentIndexer.IndexWithRetry(IContent[] contents, Int32 maxRetries)
at EPiServer.Find.Cms.ContentIndexer.Index(IEnumerable`1 content, IndexOptions options)
at EPiServer.Find.Cms.ContentIndexer.IndexBatch(IEnumerable`1 content, Action`1 statusAction, Int32& numberOfContentErrors, Int32& indexingCount)

It’s caused by a a queue of content-changes that over time is building up due to a large amount of changes going on during e.g. a content import. There are a few handy configuration options that can control exactly this behaviour.

Control automatic indexing when Content Changes

First thing we often do is to disable the automatic propagation of content changes. It can easily be done with a simple adjustment to your Web.config.

<section name="episerver.find.cms" type="EPiServer.Find.Cms.Configuration, EPiServer.Find.Cms" requirePermission="false" />

And then include the use of the section inside <configuration/>.

<episerver.find.cms disableEventedIndexing = "true"/>

Applying the same change to Episerver Commerce is done via a simple adjustment of your AppSettings.config. It will ensure that changes done to Commerce related entities, through ECF APIs, are ignored.

<add key="episerver:FindCatalogEventUpdated" value="false"/>

Be aware that these changes disables the replication of Episerver CMS and Episerver Commerce changes to your Search Index and is something that you want to remove after all bulk changes is finalized.

It is important that your Search Index is aware of all your Content changes. Running the built-in “EPiServer Find Content Indexing Job”, that is available via the Scheduled Job section in Episerver CMS, will replicate everything within Episerver CMS to your index in a controlled manner.

Leave a Comment

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

Please type the characters of this captcha image in the input box

Please type the characters of this captcha image in the input box
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
*