Let’s start by making a strong statement with the only goal of keeping your attention: If you are a very experienced Coveo for Sitecore developer with long years of experience using Hive Framework to create the most beautiful Coveo Search Interfaces in this planet, don’t worry. This new way of creating search interfaces don’t replace the so famous Hive Framework. It comes to add not to divide. Let me explain that…
When Should We Use It Instead of Hive?
There is no such thing as Hive versus Hosted Search Page. One can use both, it all depends on the scenario. However, I can easily see some cases on which a developer may benefit a lot from this new component and its simplicity:
- For an MVC developer who are just starting on Sitecore and doesn’t even know what is this Hive thing;
- For Sitecore developers who never played with Coveo Hive in the past;
- For experienced Coveo developers who doesn’t have any experience at all with Sitecore;
- For a Coveo for Sitecore expert who wants to test the exact same search interface among different Sitecore instances.
If you are part of any of the above groups stay tuned because I’m about to blow your mind away!
What Is a Coveo Hosted Search Interface?
The first thing you should learn about this new concept is that it is not limited to the Sitecore world at all. Coveo has been working with a cloud-hosted interface for years. It’s part of what we call the Coveo Cloud Platform. The only thing new here is that it is now part of the out-of-the-box Coveo for Sitecore offering.
I could write tons of cool things about this beast but I’m glad to say that Coveo already did it. They have a very extensive and comprehensive documentation on this already established component, you should check it out.
Evidently, I won’t let you sitting there all curious about it so here is a short summary: Instead of having your search interface, its components and its HTML code stored as part of your solution, Coveo can store it for you in their cloud. They offer a cloud-based user-friendly interface with drag-and-drop features to create and configure a complete search interface, with facets, filters, and even different search results templates.
The outcome of the above operation is a URL that redirects your customers to a proper Coveo search interface.
In a non-Sitecore project the developer may take this URL as simply use it as part of their website solution. However, here we are talking about Sitecore, right? So let’s get specific now…
How to Leverage it On Sitecore?
Trust me, dear reader. It’s at least 10x easier than you may be thinking. Coveo has come up with a new rendering and even a branch template to make our lives easier. Right-click, Insert, Insert from template and then:
After doing that you should see a newly created page and a data source item under it. Open it and make sure you set the two required fields. Note: You should have created the hosted search page at this point. If you didn’t, just go back to the previous section of this article and do so.
Go ahead and publish everything. Open your brand new page and boom! Now you tell me, wasn’t that easy?
Keep in mind that you can create multiple Sitecore search interfaces across different instances and target the same cloud-hosted search page. It may be useful when you want to perform some quick testing.
Bonus Track: How to Scope Queries to Specific Databases?
You may have seen that the above interface has results coming from both web and master databases. That’s an issue that is addressed automatically when dealing with Hive search interfaces. But hosted search pages are totally agnostic about the fact that there is a beast called Sitecore behind the scenes using it. Don’t worry, I’ve got your back buddy. Let’s fix it right now.
We are going to use Coveo Cloud Query Pipeline filter to get this fixed. All you need is to add a new filter on Advanced Query (aq) parameter to make sure you are getting results from the Sitecore web source:
And there we go! Just refresh your search interface and all the master results should go away.
I know, I know, I’m always doing some bold statements over here, but please, wasn’t that at least 10x easier than you thought? I hope you enjoyed this article and found it helpful. Please reach me out if you still have questions!
One thought on “Coveo for Sitecore – Cloud Hosted Search Page, The Fastest Way of Creating a Sitecore Search Interface Ever”