Search by Algolia
How does a vector database work? A quick tutorial
ai

How does a vector database work? A quick tutorial

What’s a vector database? And how different is it than a regular-old traditional relational database? If you’re ...

Catherine Dee

Search and Discovery writer

Removing outliers for A/B search tests
engineering

Removing outliers for A/B search tests

How do you measure the success of a new feature? How do you test the impact? There are different ways ...

Christopher Hawke

Senior Software Engineer

Easily integrate Algolia into native apps with FlutterFlow
engineering

Easily integrate Algolia into native apps with FlutterFlow

Algolia's advanced search capabilities pair seamlessly with iOS or Android Apps when using FlutterFlow. App development and search design ...

Chuck Meyer

Sr. Developer Relations Engineer

Algolia's search propels 1,000s of retailers to Black Friday success
e-commerce

Algolia's search propels 1,000s of retailers to Black Friday success

In the midst of the Black Friday shopping frenzy, Algolia soared to new heights, setting new records and delivering an ...

Bernadette Nixon

Chief Executive Officer and Board Member at Algolia

Generative AI’s impact on the ecommerce industry
ai

Generative AI’s impact on the ecommerce industry

When was your last online shopping trip, and how did it go? For consumers, it’s becoming arguably tougher to ...

Vincent Caruana

Senior Digital Marketing Manager, SEO

What’s the average ecommerce conversion rate and how does yours compare?
e-commerce

What’s the average ecommerce conversion rate and how does yours compare?

Have you put your blood, sweat, and tears into perfecting your online store, only to see your conversion rates stuck ...

Vincent Caruana

Senior Digital Marketing Manager, SEO

What are AI chatbots, how do they work, and how have they impacted ecommerce?
ai

What are AI chatbots, how do they work, and how have they impacted ecommerce?

“Hello, how can I help you today?”  This has to be the most tired, but nevertheless tried-and-true ...

Catherine Dee

Search and Discovery writer

Algolia named a leader in IDC MarketScape
algolia

Algolia named a leader in IDC MarketScape

We are proud to announce that Algolia was named a leader in the IDC Marketscape in the Worldwide General-Purpose ...

John Stewart

VP Corporate Marketing

Mastering the channel shift: How leading distributors provide excellent online buying experiences
e-commerce

Mastering the channel shift: How leading distributors provide excellent online buying experiences

Twice a year, B2B Online brings together America’s leading manufacturers and distributors to uncover learnings and industry trends. This ...

Jack Moberger

Director, Sales Enablement & B2B Practice Leader

Large language models (LLMs) vs generative AI: what’s the difference?
ai

Large language models (LLMs) vs generative AI: what’s the difference?

Generative AI and large language models (LLMs). These two cutting-edge AI technologies sound like totally different, incomparable things. One ...

Catherine Dee

Search and Discovery writer

What is generative AI and how does it work?
ai

What is generative AI and how does it work?

ChatGPT, Bing, Bard, YouChat, DALL-E, Jasper…chances are good you’re leveraging some version of generative artificial intelligence on ...

Catherine Dee

Search and Discovery writer

Feature Spotlight: Query Suggestions
product

Feature Spotlight: Query Suggestions

Your users are spoiled. They’re used to Google’s refined and convenient search interface, so they have high expectations ...

Jaden Baptista

Technical Writer

What does it take to build and train a large language model? An introduction
ai

What does it take to build and train a large language model? An introduction

Imagine if, as your final exam for a computer science class, you had to create a real-world large language ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

The pros and cons of AI language models
ai

The pros and cons of AI language models

What do you think of the OpenAI ChatGPT app and AI language models? There’s lots going on: GPT-3 ...

Catherine Dee

Search and Discovery writer

How AI is transforming merchandising from reactive to proactive
e-commerce

How AI is transforming merchandising from reactive to proactive

In the fast-paced and dynamic realm of digital merchandising, being reactive to customer trends has been the norm. In ...

Lorna Rivera

Staff User Researcher

Top examples of some of the best large language models out there
ai

Top examples of some of the best large language models out there

You’re at a dinner party when the conversation takes a computer-science-y turn. Have you tried ChatGPT? What ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What are large language models?
ai

What are large language models?

It’s the era of Big Data, and super-sized language models are the latest stars. When it comes to ...

Catherine Dee

Search and Discovery writer

Mobile search done right: Common pitfalls and best practices
ux

Mobile search done right: Common pitfalls and best practices

Did you know that 86% of the global population uses a smartphone? The 7 billion devices connected to the Internet ...

Alexandre Collin

Staff SME Business & Optimization - UI/UX

Looking for something?

facebookfacebooklinkedinlinkedintwittertwittermailmail

Jekyll is an open-source static site generator originally developed by Tom Preston-Werner (the creator of GitHub) as a response to the bloated systems of the day like WordPress. Despite largely kicking off the static/Jamstack movement though, the developer world seems to have largely moved off of it. In 2021, the last active maintainer of the project and our friend Frank Taillandier passed away, leaving the project essentially unshepherded.

Nevertheless, many companies are still using Jekyll for their ecommerce projects because of the investment required to switch. After all, if you’ve got a team of Ruby developers and a perfectly-running website already, why fix what isn’t broken just to be more “modern”?

It’s a valid argument in some cases, so we wanted to update this old article to reflect how you can use Algolia with Jekyll (or any other custom, outdated, or otherwise unsupported framework for that matter) in 2023.

If you’d like to give this a go on a prototype Jekyll site before messing with your own integration, maybe check out Tom Preston-Werner’s blog, a complete Jekyll project that’s free to use with attribution as long as you don’t republish any of his articles.

Because it’s only possible to demonstrate search when you’ve got searchable data indexed, we’re not going to provide a code repository or free index to use so as to respect the licensing of Tom’s content. But this will work with any site on any framework, so give this a shot with your sample project of choice.

It works like this:

    • Build your index. How would it make the most sense to get the data you want to be searchable into Algolia? For the Jekyll blog we mentioned earlier, it’d probably make sense to write some step into the deployment process that scrapes the folder of blog posts, generates a JSON file that contains all the searchable data, and uploads it into Algolia via the API. Take a look at this docs article for a more extensive guide on this.

 

    • Choose which InstantSearch implementation you want to use. The most logical for Jekyll users would be the JS flavor, but some of the others might be helpful in certain situations. A Gatsby site is going to be better served by the React flavor, and an Astro site could make use of a few of them.

 

    • Write out your HTML. This part is straightforward: just block out the layout like you’re used to and you’ll be good. Take a look at the widget showcase here; once you pick out what widgets you’d like to use, create a container element for each one.

 

    • Import the InstantSearch library into your JavaScript on the frontend and create the search object with whatever templating system your framework includes piping in your Algolia credentials:
      const searchClient = algoliasearch('YourApplicationID', 
      'YourSearchOnlyAPIKey');
      const search = instantsearch({
            indexName: 'demo_ecommerce',
            searchClient
      });

 

    • Register the widgets you want with the HTML containers you just set up.
      search.addWidgets([
            searchBox({
                  container: "#searchbox"
            }),
            hits({
                  container: "#hits"
            })
      ]);
      search.start();

 

    • Make it look pretty! InstantSearch gives you something good-looking right out of the box, but it gives you the flexibility to make things nicer with CSS.

 

    • For bonus points, can you work this into the makeup of your chosen framework? In those I’m used to working with, I’d get more mileage out of this approach by encapsulating my search implementation in a component or two, isolating the CSS and JavaScript from the markup so it’s easier to maintain.

 

And that’s it! We get a lot of questions about using Algolia on unsupported frameworks, but after following these seven steps, you’ve got yourself a search engine on your site regardless of the framework you’re using.

It’s much more flexible than the old way of having a plugin for each little framework. Plus, all of the developers using obscure frameworks and custom implementations can help each other find solutions now that they’re going about it the same way.

So if you’ve got any questions about adding search to your site, feel free to check out Stack Overflow, our Discourse forum, and if you need more personal help, you can get a hold of us here.

Happy building!

About the author
Jaden Baptista

Technical Writer

Recommended Articles

Powered byAlgolia Algolia Recommend

Add instant search to your blog or documentation using our Jekyll plugin
engineering

Tim Carry

4 questions to ask for relevant search results
product

Jaden Baptista

Technical Writer

How to create the best search engine experience
ux

Catherine Dee

Search and Discovery writer