"Can not convert Array to String" error while using Azure Search


Description

When using Azure Search, facets might not be displayed and the following error occurs:

An error has occurred and the facets cannot be displayed.

Also, the following error can appear in the log records:

[ArgumentException: Can not convert Array to String.]
   Newtonsoft.Json.Linq.JToken.op_Explicit(JToken value) +391
   Newtonsoft.Json.Linq.JToken.ToObject(Type objectType) +1538
   Newtonsoft.Json.Linq.JToken.ToObject() +46
   Sitecore.ContentSearch.Azure.Http.SearchResultsDeserializer.Deserialize(String textResults) +1142
   Sitecore.ContentSearch.Azure.Query.LinqToCloudIndex`1.Execute(CloudQuery query, Int32& countDoc, Int32& totalDoc, Dictionary`2& facetResult, SearchRequest& nextPageRequestParameters) +2572
   Sitecore.ContentSearch.Azure.Query.LinqToCloudIndex`1.Execute(CloudQuery compositeQuery) +997
   Sitecore.ContentSearch.Linq.QueryableExtensions.GetFacets(IQueryable`1 source) +363
   ...

Solution

To resolve the issue, consider one of the following options:


Be aware that hotfixes were built for a specific Sitecore XP version, and must not be installed on other Sitecore XP versions or in combination with other hotfixes. In case any other hotfixes have already been installed on a certain Sitecore XP instance, send a request for a compatibility check to Sitecore Support.
Note that the ZIP file contents need to be extracted to locate installation instructions and related files inside. The hotfixes must be installed on a CM instance and then synced with other instances using standard development practices.