Sitecore Azure: Request size exceeded Azure Search Service limits
Sitecore Azure: Request size exceeded Azure Search Service limits
Azure search is an alternative to SOLR when hosting in Azure. It is pretty straight forward to configure, especially in Sitecore 9 where it really is a flip of a property from one provider to the next. But we ran into a bit of a snag that I thought I would share.
We started noticing some lag and missed data when it came to indexing our article items. These were items that had large body content fields. Through our logs we saw an error message that referenced "Request size exceeded Azure Search Service limits".
By default, Sitecore sends 1000 documents to the Azure Search in a single REST call. Through testing we discovered that some of our larger articles that were grouped together in this single call were triggering this error. We simply patched the batch size to 250 to resolve this issue.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<cloudBatchBuilder type="Sitecore.ContentSearch.Azure.CloudBatchBuilder, Sitecore.ContentSearch.Azure">
<maxDocuments>250</maxDocuments>
</cloudBatchBuilder>
</contentSearch>
</sitecore>
</configuration>
Our index also went from over an hour down to under 10 minutes. This was a bit of a surprise as we were not seeing any other issues that would suggest the index was having problems. But it makes sense that a failed REST call would trigger some sort of retry and would impact overall time.