Tuesday, August 19, 2014

“Optimize for frequent use” setting in a Result Type

image

You have probably seen the check box for Optimize for frequent use if you have ever created a Result Type in SharePoint. But, what does this mean?

If you read over at http://technet.microsoft.com/en-us/library/dn135239(v=office.15).aspx it states:

Select the Optimize for frequent use check box if you expect this result type to appear frequently in search results.

So what does this actually mean?

If you check this box, all managed properties defined in the associated display template will be retrieved for all queries executed. Let me say that again: All defined managed properties in your display template will be retrieved for all searches, not just the ones using your display template.

The benefit is that the value of the managed property is readily available to be returned back in the result directly from the index.

If you however do not check this box, the Query Processing Component might have to do an extra call back to the index in order to populate the value if the value is needed by a display template, and is not part of the default properties brought back.

Say you are creating a display template which applies to perhaps 100 items in your index which use a custom managed property appearing in almost all items. Then it might be an overhead to check this box, as all items will load up the value, even though you are not using it when displaying the result.

Then again, how big is the actual overhead, and if you read my post The 100% way of getting your custom properties to show in your Display Templates, then it seems you have to check this one anyways if you are using a non-default managed property.

And this brings us to, remove any managed property definitions in your display templates if you are not using them!