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

Back in November 2015, we released the first full version of InstantSearch. We’ve received tons of feedback, leading to over 11,000 commits and 3,300 stars on GitHub as we continually refine this library. Now that we’re on v4, we figured this would be a good time to jot down the thought process behind problem-solving with InstantSearch.

We’ll keep this short, so it’ll be a good resource for you to come back to, but the gist is that whenever you need to tackle adding a new feature with InstantSearch, you’ll follow these three steps:

Making good use of premade widgets

Right out of the box, InstantSearch comes loaded with tons of interesting widgets that incorporate nearly every functionality Algolia offers. Almost anything you’d want to build in a typical search interface can be constructed by piecing together these widgets like Lego.

Take a look at this showcase for a good example of how they can be pieced together.

Here’s a good example of our friends at Starschema putting this into action. Before doing anything else, their engineer Soma was able to plan out the entire UI with a simple wireframe, knowing that Algolia’s widgets would fill in the rest. Steps 3.1 to 3.8 show the premade widgets that he chose to include and how he went about implementing them.

There’s more detail in the article, but the gist of it is that you call the addWidgets function on the InstantSearch object, passing it an array of widget objects.

Extending the premade widgets to include custom functionality

To continue the Lego illustration, there’s only so much you can build with the basic blocks. To build something truly interesting, realistic, or complicated, you’d need to start experimenting with colors and dimensions and connection points. Most times, it wouldn’t make sense to design a completely new brick, but to modify an existing one to fit.

That’s the same approach we take with InstantSearch widgets: before jumping all the way to building a new widget, we try to modify an existing one to do what we’re looking for.

This is the guide to customizing an existing widget. It involves hijacking just part of the widget to add some new functionality while not getting rid of what makes InstantSearch so valuable. You could edit just the logic part by creating a connector, or just the textual part for translation purposes, or just the styles to make the widget look different, among other things.

The widgets are made up of their renderer (for styles and markup) and their connector (for logic), and there are myriad ways to mess with either of those.

Building new widgets from scratch into InstantSearch

But say you’re looking for something so radical that there’s no clear path of modifications you can make to get from an existing widget to what you want. Your only way forward is to create your own new widget from scratch.

Like we mentioned, a widget is formed by a renderer (for styles and markup) and a connector (for logic) working together, so to make your own widget, you just need to create those two subcomponents. There’s an excellent guide on that here

With these steps, you can build almost anything with InstantSearch, even non-Algolia functionality. We’ve experimented with this process a lot here on the blog and with our customers, and every time it’s proved to be a very flexible and powerful system that gives you a lot of options without being a burden for more straightforward implementations.

We promised we’d keep this short, so if you’ve got any more questions, feel free to ping us on Discourse. Happy building!

About the author
Jaden Baptista

Technical Writer

Recommended Articles

Powered byAlgolia Algolia Recommend

Connectors, Docs & the Future — a Deeper Look into InstantSearch.js v2
product

Alexandre Stanislawski

Harnessing API’s with React: a different approach
engineering

Alexandre Stanislawski

Announcing instantsearch.js: Everything you need for great search in one library
product

Alexandre Stanislawski