BYTE POST 14 : Azure Search 1000 result limitation with Sitecore

Here is a lesson learned the hard way with Azure search.

Once upon a time, there was a Sitecore 7.2 implementation that uses Solr in the backend. Kings and Queens of the land decided to upgrade it to Sitecore 9 and also use Azure PaaS. Awesome, Azure has shinny Azure Search that sounds awesome to use, since Sitecore will be using Azure. Let’s not use dusty old overused name called Solr. Let’s use Azure Search, it just sounds cool. It will be a all around cool.

Developers were brought in and given the specification.

Here comes the developers, doing a lift and shift for first round, with minimal code changes to meet a deadline. Preliminary code works as it should and all environments are good.

Few developers go to vacation and few were let go.

Content owner start putting content. Such a nice environment with all the toys they need.

BOOM !!!!!

RTE ( Run Time Error) all around. No developers are around to chase the root cause till they are back from vacation. Mess gets bigger, confusion grows.

Developers come back, hours of digging and many “oh my gosh, what happened” later. This is what was found.

Azure Search brings 1000 record at a time and at the end it will create a next item link. So when your model items are getting built in a loop, you will hit that line and it is not what was expected and BOOM goes the dynamite. You don’t see the issue with Solr, since Solr didn’t have that problem.

So, if you get more than a 1000 result, you will have to do separate query for each and then if you need to look at all those, you will have to keep the results in memory and compare. Pretty Ugly isn’t it.

Kings and Queens are not happy!!!