Hugo Santos - Sitecore Architect
16 Nov 2020
If you are using the October 2020 Coveo for Sitecore release (https://docs.coveo.com/en/3360/coveo-for-sitecore-v5/october-30-2020-release-5-0-822-2#downloads) or newer, you might think about this new feature. When applied properly, it increases query performance dramatically. To understand how it works, let’s start by explaining what is this proxy thing.
Before this new feature, every time your search page was used to search for anything on a Coveo Cloud index hosted on the Coveo Cloud Platform, the query used to be sent to the Sitecore Server first, on which everything related to documents security/access and the Query Processing Pipeline was applied. After doing so, the proxy would send the query to the proper Cloud Index, and handle its response, applying the so-called Response Processing Pipeline on it. Finally, after this entire loop, the results were sent to the Coveo Search Interface and users would see the result items.
As described in the above section, there are some features that are pretty useful in the proxy. So why Coveo is now offering the option to disable it? Well, as we know, the real world is different from theory, and Coveo realized that more often than not customers are not leveraging the Query Processing and the Response Processing pipelines. So at the end of the day, the proxy was basically handling the security, which is absolutely necessary but can be handled by the Search Interface itself just like at any other Coveo setup different from Sitecore.
The issue with that is that having every single triggered query (sometimes hundreds of thousands per month) passing through your Sitecore Server puts a huge load on the server. It doesn’t make any sense to do this if the proxy is not being useful at all. Not only that, but the proxy obviously adds complexity to the query and increases its execution time.
With that in mind, Coveo came up with a new configuration on its module which allows administrators or developers to disable the proxy. Long history short, when this feature is used you don’t have the pipelines I listed above and the security (which documents are accessible for the current user) is handled by the Search Page. Otherwise, both pipelines are applied to the query, and the security is handled by the Sitecore Server.
If you ever find yourself in a situation in which the proxy is not needed at all, here is what you have to do. First, confirm that your queries are being sent to the proxy. Just open your navigator developer tool and look at the target hostname of the query request. You should see your Sitecore instance hostname here.
Then, open your Coveo Command-Center (https://hls-consulting.com/2018/12/18/coveo-for-sitecore-5-a-new-era-has-begun-the-era-of-the-command-center-part-i/) and select the Reverse Proxy tab. Go ahead and uncheck the “Enable Coveo for Sitecore proxy” checkbox.
Click on “Apply and Restart”. This is going to change a Sitecore configuration file, so keep in mind that your IIS Application is going to be restarted.
Then do another search and observe again the target hostname. You should now see that the query is being sent directly to the Coveo Cloud Platform.
This feature is everything I like: useful, easy, and performant. We won’t be using it on every single Coveo deployment for sure but I can definitely see it being used in some of my projects. Performance is always a concern when it comes to search, so being able to do this little tweak is a huge addition to the Coveo For Sitecore module, kudos to the team for developing this! See you all in the next blog post!
Hugo Santos Search Practice Lead Konabos Consulting Contact Me
Hugo is bright, amiable, and energetic. He is passionate about creating great solutions that don't just follow best practices, but further them. His passion for doing great work is equaled only by his willingness to share his expertise with the Sitecore community by blogging and advocacy, like helping to organize the Quebec Sitecore User Group. In recognition for all that he does for the Sitecore Community, Sitecore awarded him his first, but certainly not last, Sitecore Technology MVP award in 2020. Hugo specializes in search and automation, including testing automation.