Skip to Content

How to Add Swiftype Site Search to Your Website


Swiftype by Elastic is a powerful search utility that gives you granular control over search results on your website. We'll show you how to get started in minutes by adding a Javascript snippet to your page.

We take internet search for granted. It wasn't so long ago that we had to fuss with the Dewey Decimal System while thumbing through a card catalog. Or weed through miles of microfiche to find an obscure article.

In those days, "search" was really more like "research." It was broad and inexact, excruciatingly time-consuming, and you accepted the mind-numbing reality that you might not find what you're looking for. Of course, the web changed everything; now, you just type (or speak) what you're looking for and answers appear. Like magic.

Still, most of us would agree that site search isn't that great. Sure, the magnifying glass might conjure results to your query, but it's often clumsy and misaligned. That's Boolean logic for you.

According to the usability experts at Nielsen Norman group, more than half of users are search dominant, meaning that they opt for the search bar over your website's navigation menus. That makes it pretty darn important. 

Wouldn't it be great if you could get more out of your search? What if you could gather focused analytics to see what people are searching for on your website? And what if you could curate their search results to increase engagement?

Well, now you can with Swiftype from Elastic. This dynamite cloud-based utility can be plugged into any website, giving you the foundation to build a search experience strategy. Swiftype lets you refine search results and surface more relevant content based on queries. It also uses machine learning to improve results and gives you deep analytics around searches. It also has some simple yet cool features like predictive autocomplete in search bars.

Ready to add Swiftype and start your search experience strategy? We've broken down the steps below:

alt text

How Swiftype works

Swiftype is one of the easiest ways to add search-as-a-service to your website. As an Elastic product, it's backed by one of the leading enterprise search providers, powering the best technology, algorithms, framework, and analytics tool for customizing your search experience strategy. 

Once you're signed up (which is something we can help you do), Swiftype takes all your website content and renders it searchable. As your users are conducting searches, Swiftype collects detailed analytics about who your audience is, where they come from, what they're looking for, and what content they engage with the most. What's great is that you can access these analytics and learn more about your search performance and your users' search behaviors. 

Swiftype offers some fantastic capabilities. First, it's optimized for mobile out-of-the-box, so it works across form factors. Their faceted search dynamically expands on simple search, which allows your users to refine results by attributes such as date, price, author, location, or content type. And as already mentioned, it provides a predictive autocomplete feature that allows you to guide users in real-time as they type a query into your search box.

We'll share a bit more in a minute about Swiftype's content refinement capabilities, which bring an unprecedented level of control. You can further fine-tune and sync your content with developer-friendly APIs for acquisition and querying – and create your own schema that fits your unique data model.

While installing Swiftype is largely a code-free experience, some of these more advanced features can get a little complex. If you need help, contact us.

How to integrate Swiftype into your website

Adding Swiftype to your website is pretty easy and relatively headache-free. No coding is required, but developers can use an API for extra control. 

After you've registered and entered your web address, Swiftype indexes your site and creates your search engine in real-time. From here, you just need to add a Javascript snippet to your pages:

1. Install the code below between the opening and closing body HTML tags on every page of your website that you would like Swiftype's embedded options to appear.

2. Finish your installation by following the design and customization guide.

How to customize Swiftype for better search results

Here's where the fun begins – and how you can start refining your results. There are three types of customizations on the Swiftype dashboard:

Custom Result Rankings: Swiftype offers this very useful tool to promote content based on user search activity. It lets you customize the order of search results for a specific query, drag and drop existing results into a new order, add new results that don't appear by default, or even eliminate results you don't want to be displayed. You can also "pin" specific pieces of content at the top position for related searches and drive users to high-value landing pages.

alt text

Weights: This handy tool lets you fine-tune your search relevance with granular control. You can adjust how different attributes like product rating or article popularity impact your search results. Weights are expressed in fields with a value between 1 and 10; by default, each field has a weight of 1, which means it has the same probability of turning up in a standard search result. Altering a field’s weight will increase its significance – and elevate the likelihood that a user will see that result. 

alt text

Synonyms: With Synonyms, you can relate two or more words together to form a common set and serve the same search result. For example, if you had an eCommerce website that sold cars, you might have various users conduct searches with car, vehicle, or automobile. Odds are, you'll have visitors that use very different words to describe the same thing – and with Synonyms, you can surface the same result every time. 

alt text

Additional Features

The Swiftype API gives you full control over the schema of your search engine and the content you index. Swiftype's API is a JSON-based REST API, and with the endpoints, you can index data, execute search queries, and access rich analytics.

Swiftype also supports libraries for:

Need help getting started?

Swiftype is pretty simple to set up, but there are a few places where code needs to be pasted and a bit of complexity comes into play. If you need help – or want more advanced support – feel free to contact us. 


Sign up to explore

Create an account in seconds and start building today.

Sign up for Solodev