A healthcare customer of ours (we’ll call them X Pharma) runs half a dozen websites for all of its products & services. They asked for help rebuilding all the sites in a single Sitefinity CMS – what’s called a “multi-site instance.” (Yes, Sitefinity can run multiple websites all at once—from the same interface!)
We got to work. But while we were busy rebuilding sites, X Pharma had an additional request. Could we put silo search in too?
What is Silo Search?
In terms of content and websites, a “silo” is a collection of content dedicated to a specific purpose. Think of a silo like a grain storage tower (which is where the term ‘silo’ comes from). In one tower you have corn, another you have wheat, etc.
When you perform a search on a website, the results normally come from all its sections: pages, blog posts, news items, and so on.
Silo Search narrows the focus. When you a Silo Search, you see results only from the specific silo container – designated groups of content from 1 website, in this case.
Why did X Pharma want this? Because their visitors included both healthcare professionals and patients. Some of their websites contain content meant only for healthcare workers. Other content is meant for patients.
By putting their content in respective silos, they can prevent a patient from seeing information not intended for (and thus confusing) to them.
Silo Search is popular among many privacy-minded organizations for this reason. Other healthcare companies, local governments, businesses who must maintain confidential records for customers, etc.
The Challenge: Implement Silo Search for All 6 Sites Using Custom Code
Here’s where we hit the snag. See, Sitefinity’s normal Search function does separate its results out by site. If you do a search on Site1.com, it will show you results from Site1.com. Even if it’s running half a dozen other websites in the background.
But the Search function doesn’t have the ability to “silo” its results – it can’t limit its search to certain groups of pages within that one site. In other words, if it finds some relevant content in both the HealthCare Professionals section and the Patients section, it will display both results.
This is why X Pharma asked us for help. They didn’t want to confuse visitors with content not relevant to them. Not to mention potentially violating patients’ privacy!
We had to develop a custom method to make Silo Search work. Here’s how we did it.
Coding a Solution: Redirecting the Search Command
Here’s where it gets technical. I’ll explain the steps as clearly as possible.
In order to accomplish a Silo Search, first you need a silo. In Sitefinity, you do this by creating search indexes. An index here is much like one of Google or Bing’s search indexes – it’s a list of pages.
Now, we have to store the available content in the right index. Sitefinity would do a good job of creating indexes, but data privacy mandates that we develop the sharpest possible organization.
What we did was code some instructions for Sitefinity. Essentially we told it how to recognize where we want a page to go, based on certain criteria. For example, is the page a child of the Patients page group? The Healthcare Professionals page group? Or is it part of the mobile website section of pages?
Which index the page goes into is based 100% on that criteria. Then it’s able to return specific results for, say, the Healthcare Professionals silo.
Next we built a custom Page Inbound Pipe. This is an event handler for publishing events. It’s invoked when you create a new page in Sitefinity, or change an existing page.
Why customize a page pipe? It connects to the instructions from before. Customizing the page pipe allowed us to “pipe” pages into their proper indexes, based on the aforementioned criteria.
This new Page Inbound Pipe was configured to access the separated search indexes, using the instructions. Think of this like putting in a new pipe fitting under the sink. Instead of leading down to one big pipe, the new fitting splits water between two smaller pipes. Depending on where you tell it, water only flows into one of the pipes.
But in order to make the pipe fitting do that, it needs the instructions. This part has to be done by a developer, because it involves creating specific code & adding it into Sitefinity.
Our developer wrote a custom C# class which inherits the base class of the default Page Inbound Pipe into the custom Pipe. That means it can do anything the original Page Inbound Pipe can do. Then, he wrote in an override of the “PushData” method. This event is called whenever a publishing event occurs: Create a Page, Edit a Page, Search the site…
With this method in place, the custom Inbound Pipe can do something new: It scans the URL of the page from which the search was entered, and determines which criteria the page must be routed toward. When it knows that, it knows which index – which silo – it should place the page reference in.
Result: Silo Search Every Time a Patient or Healthcare Pro Accesses the Site
With this Silo Search function in place, X Pharma now knows their site visitors will see content relevant to them when they click that Search box.
This is what happens when they type in a search term and click “Search”:
- Depending on which section of the site the user is on, the search form tells the server which index to return results from.
- The user enters the search term they would like to search for.
- Also depending on which section of the site they’re on, the page pipe routes the search query through the selected index. Are they on pages that have been indexed in the Healthcare Professionals section? Then the pipe returns results from the Healthcare Professionals index.
- The same applies to the Patients, or Mobile sections of the website that have been added to the search silos.
- If the search coming from a page not in the Healthcare Professionals or Patients sections? Then the pipe returns results from the default index for that site.
Boom, search results show up. Relevant to the search term and where the visitor is.
The process of a Silo Search working happens behind the scenes. Visitors don’t see any of this happening. But the results they get come back tailored to the kind of content they want to see.
Silo Search doesn’t have to be implemented to protect customer privacy. You can also use it to avoid confusing visitors with too many search results. Or use silos to restrict information behind a members’ section. And plenty more.
If you implemented Silo Search on your website, what would be its purpose? Leave a comment or email with your ideas! If you have questions about using Silo Search, please leave those too.