Search by Algolia
Vector vs Keyword Search: Why You Should Care
ai

Vector vs Keyword Search: Why You Should Care

Search has been around for a while, to the point that it is now considered a standard requirement in many ...

Nicolas Fiorini

Senior Machine Learning Engineer

What is AI-powered site search?
ai

What is AI-powered site search?

With the advent of artificial intelligence (AI) technologies enabling services such as Alexa, Google search, and self-driving cars, the ...

John Stewart

VP Corporate Marketing

What is a B2B marketplace?
e-commerce

What is a B2B marketplace?

It’s no secret that B2B (business-to-business) transactions have largely migrated online. According to Gartner, by 2025, 80 ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

3 strategies for B2B ecommerce growth: key takeaways from B2B Online - Chicago
e-commerce

3 strategies for B2B ecommerce growth: key takeaways from B2B Online - Chicago

Twice a year, B2B Online brings together industry leaders to discuss the trends affecting the B2B ecommerce industry. At the ...

Elena Moravec

Director of Product Marketing & Strategy

Deconstructing smart digital merchandising
e-commerce

Deconstructing smart digital merchandising

This is Part 2 of a series that dives into the transformational journey made by digital merchandising to drive positive ...

Benoit Reulier
Reshma Iyer

Benoit Reulier &

Reshma Iyer

The death of traditional shopping: How AI-powered conversational commerce changes everything
ai

The death of traditional shopping: How AI-powered conversational commerce changes everything

Get ready for the ride: online shopping is about to be completely upended by AI. Over the past few years ...

Aayush Iyer

Director, User Experience & UI Platform

What is B2C ecommerce? Models, examples, and definitions
e-commerce

What is B2C ecommerce? Models, examples, and definitions

Remember life before online shopping? When you had to actually leave the house for a brick-and-mortar store to ...

Catherine Dee

Search and Discovery writer

What are marketplace platforms and software? Why are they important?
e-commerce

What are marketplace platforms and software? Why are they important?

If you imagine pushing a virtual shopping cart down the aisles of an online store, or browsing items in an ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What is an online marketplace?
e-commerce

What is an online marketplace?

Remember the world before the convenience of online commerce? Before the pandemic, before the proliferation of ecommerce sites, when the ...

Catherine Dee

Search and Discovery writer

10 ways AI is transforming ecommerce
e-commerce

10 ways AI is transforming ecommerce

Artificial intelligence (AI) is no longer just the stuff of scary futuristic movies; it’s recently burst into the headlines ...

Catherine Dee

Search and Discovery writer

AI as a Service (AIaaS) in the era of "buy not build"
ai

AI as a Service (AIaaS) in the era of "buy not build"

Imagine you are the CTO of a company that has just undergone a massive decade long digital transformation. You’ve ...

Sean Mullaney

CTO @Algolia

By the numbers: the ROI of keyword and AI site search for digital commerce
product

By the numbers: the ROI of keyword and AI site search for digital commerce

Did you know that the tiny search bar at the top of many ecommerce sites can offer an outsized return ...

Jon Silvers

Director, Digital Marketing

Using pre-trained AI algorithms to solve the cold start problem
ai

Using pre-trained AI algorithms to solve the cold start problem

Artificial intelligence (AI) has quickly moved from hot topic to everyday life. Now, ecommerce businesses are beginning to clearly see ...

Etienne Martin

VP of Product

Introducing Algolia NeuralSearch
product

Introducing Algolia NeuralSearch

We couldn’t be more excited to announce the availability of our breakthrough product, Algolia NeuralSearch. The world has stepped ...

Bernadette Nixon

Chief Executive Officer and Board Member at Algolia

AI is eating ecommerce
ai

AI is eating ecommerce

The ecommerce industry has experienced steady and reliable growth over the last 20 years (albeit interrupted briefly by a global ...

Sean Mullaney

CTO @Algolia

Semantic textual similarity: a game changer for search results and recommendations
product

Semantic textual similarity: a game changer for search results and recommendations

As an ecommerce professional, you know the importance of providing a five-star search experience on your site or in ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What is hashing and how does it improve website and app search?
ai

What is hashing and how does it improve website and app search?

Hashing.   Yep, you read that right.   Not hashtags. Not golden, crisp-on-the-outside, melty-on-the-inside hash browns ...

Catherine Dee

Search and Discovery writer

Conference Recap: ECIR23 Take-aways
engineering

Conference Recap: ECIR23 Take-aways

We’re just back from ECIR23, the leading European conference around Information Retrieval systems, which ran its 45th edition in ...

Paul-Louis Nech

Senior ML Engineer

Looking for something?

facebookfacebooklinkedinlinkedintwittertwittermailmail

The desire to automate everything is pretty common, especially with developers: why should I waste my time doing the same operation countless times?

That desire is at the base of the process that led to the making of our Atom plugin: an autocomplete that allows importing packages from NPM quickly, with a few keystrokes. On top of this, the plugin will prompt the user to save the selected package as a project dependency if a `package.json` is present.

We published the extension on the Atom Package Registry and open-sourced the code on GitHub, and here is the story about how we built it.

The problem we sought to solve

Many of us use JavaScript and Node daily for a variety of different tasks: scraping data, slackbots, contacting APIs, indexing content… you name it. Luckily, there are plenty of open source libraries on NPM which we can leverage to perform any task in the simplest and fastest way.

We really wanted to solve two main productivity issues in the process of building tools:

  • Looking up packages on NPM or Yarn, either via CLI or on the web
  • Installing the package in our `node_modules` folder (normally via CLI)

Let’s make a contrived example: let’s say we’re writing a small terminal script which needs to add padding to a string, and we don’t want to re-implement this functionality from scratch.

We would normally start by researching the library on NPM or Yarn’s Website, querying for “pad” and evaluating each library by looking at the number of downloads and GitHub stars, and checking if it’s maintained or not.

researching the library on NPM or Yarn’s Website
After selecting our library, we need to explicitly require it in our project dependencies using the command line:

explicitly requiring the library in project dependencies using the command line:

 

 

 

Finally, we can get back to our text editor to actually require the package:

requiring the package

 

 

 

 

 

The number of required steps in order to install a simple library is definitely high and requires to hop from your text editor of choice to a browser and to the terminal – all that for just one library.

Context Matters

While installing a one-shot library is not a problem, doing this operation frequently can lead to a frustrating experience. We didn’t want to waste time researching libraries or running the same instructions again and again. We rather wanted to spend our time focusing on solving our functional problems and creating product features.

One of the first pain points we wanted to solve with our extension was to reduce the need to switch to a browser in order to search for a library. On top of that, we wanted to contextually provide useful information for exploring different options.

In order to provide a selection of the most relevant packages, we’re using an Algolia index with custom ranking which takes into account the number of downloads from NPM in the last 30 days, in conjunction with a Boolean attribute `popular` computed at indexing time, which sorts the most popular results to appear first.

In short, having contextual help (in this case, importing JS modules) is tremendously helpful compared to using 3-4 separate tools.

Let me do that for you

After researching and finding the best suited package for our task, we still need to install it locally on our laptops and track in our project that we’re using that dependency.

Normally, this is automatically handled by NPM or Yarn by using their CLI; that said, the Atom extension will detect if the package is missing and will prompt the user to save it:

 researching the library on NPM or Yarn’s WebsiteThe different options come down to different types of dependencies handled by NPM and Yarn, `dependencies` and `devDependencies` being the most used ones for developing a project.

Proof of concept in the time it takes to brew a double shot

The idea for Algolia Atom autocomplete was born in front of a coffee machine on a rainy Parisian morning. My colleague Raymond (the author of Vue InstantSearch, amongst other things) and I discussed how we could leverage Algolia to build something that may prove useful to other developers.

We remembered that Haroen, another fellow Algolian, built a really nice search UI for Yarn:

As this implementation is using indexed packages from NPM, most of the job was already done: we just needed to display results where it made sense the most. Chatting by the steaming cup of coffee for 10 minutes, we figured out that we could use a package autocomplete inside a text editor to automatically require packages, the lazy way.

After moving the project to our desks, we choose to go with Atom because its simple JavaScript API layer allowed us to go very fast: from the concept to the first working prototype it took less than a couple hours (also thanks to Ray’s superhuman developer skills). The idea of also saving the dependency came the day after, in a pair-programming session on our lovely couch.

Since it was a fun hack project we didn’t do any promotion of it at the time. Until today, the only proof that we actually released it was this rather embarrassing tweet.

Lessons learned

Building something quick but useful that could also be useful to other developers feels great. I had a fun time building this project, and I also had an insight or two in the process:

  • Validate your ideas with the people around you as soon as possible. If the people around your are non-technical, try to see if you can explain the problem clearly without them fainting from exhaustion.
  • Re-use existing tools and existing knowledge as much as possible. This will help remove the noise and focus on the actual problem to solve.
  • As soon as you have defined the problem and have a rough idea how to solve it, don’t wait any longer, just do it!

So long and thanks for all the fish

If there’s enough interest around our Atom Plugin, we will consider porting it to other text editors (DEVisual Studio Code, Sublime Text and all the rest), and work a little bit more on cross-platform support (Windows, I’m looking at you).

If you have any feedback about this project or want to share something you built using Algolia feel free to leave a comment here, join us on Discourse or ping @algolia, @proudlygeek & @rayrutjes on Twitter.

About the author
Gianluca Bargelli

Software Developer & Pizza Lover 🍕

githublinkedintwitter

14-day free trial

Create a full-featured search experience in no time.

Get started
14-day free trial

Recommended Articles

Powered byAlgolia Algolia Recommend

10 great search productivity tools built by our developers
engineering

Peter Villani

Sr. Tech & Business Writer

Good API Documentation Is Not About Choosing the Right Tool
engineering

Maxime Locqueville

DX Engineering Manager

ManoMano's "make or buy" decision grid
customers

Pierre Fournier

Chief Product Officer @ ManoMano