Engineering

Github Awesome Autocomplete browser extension for Chrome and Firefox
facebooklinkedintwittermail

By working every day on building the best search engine, we’ve become obsessed with our own search experience on the websites and mobile applications we use.

We’re git addicts and love using GitHub to store every single idea or project we work on. We use it both for our private and public repositories (12 API clientsHN Search or various d e m o s). We use every day its search function and we decided to re-build it the way we thought it should be.  We’re proud to share it with the community via this Chrome extension. Our Github Awesome Autocomplete enables a seamless and fast access to GitHub resources via an as-you-type search functionality.

Install your Christmas Gift now!

Github Awesome Autocomplete Algolia Search

Features

The Chrome extension replaces GitHub’s search bar and add autocomplete capabilities on:
  • top public repositories
  • last active users
  • your own private repositories (this one is done locally in JavaScript without Algolia: the list of private repositories remains locally in your browser)

How does it work?

We continuously retrieve the most watched repositories and the last active users using GitHub Archive dataset. Users and repositories are stored in 2 Algolia indices: users and repositories. The queries are performed using our JavaScript API client and the autocomplete menu is based on Twitter’s typeahead.js library.
The underlying Algolia account is replicated in 6 regions using our DSN feature, answering every query in 50-100ms wherever you are (network latency included!). Regions include US West, US East, Europe, Singapore, Australia & India.

Exporting the records from GitHub Archive

We used GitHub’s Archive dataset to export top repositories and last active users using Google’s BigQuery:

;; export repositories
SELECT
  a.repository_name as name,
  a.repository_owner as owner,
  a.repository_description as description,
  a.repository_organization as organization,
  a.repository_watchers AS watchers,
  a.repository_forks AS forks,
  a.repository_language as language
FROM [githubarchive:github.timeline] a
JOIN EACH
  (
     SELECT MAX(created_at) as max_created, repository_url
     FROM [githubarchive:github.timeline]
     GROUP EACH BY repository_url
  ) b
  ON 
  b.max_created = a.created_at and
  b.repository_url = a.repository_url


;; export users
SELECT
  a.actor_attributes_login as login,
  a.actor_attributes_name as name,
  a.actor_attributes_company as company,
  a.actor_attributes_location as location,
  a.actor_attributes_blog AS blog,
  a.actor_attributes_email AS email
FROM [githubarchive:github.timeline] a
JOIN EACH
  (
     SELECT MAX(created_at) as max_created, actor_attributes_login
     FROM [githubarchive:github.timeline]
     GROUP EACH BY actor_attributes_login
  ) b
  ON 
  b.max_created = a.created_at and
  b.actor_attributes_login = a.actor_attributes_login

 

Configuring Algolia indices

Here are the 2 index configurations we used to build the search:

Repositories

Users

Want to contribute?

It’s open-source and we’ll be happy to get your feedback! Just use GitHub’s issues to report any idea you have in mind. We also love pull-requests 🙂

Or just want to add an instant search in your website / application?

Feel free to create a 14-days FREE trial at https://www.algolia.com and follow one of our step by step tutorials at https://www.algolia.com/doc/tutorials
About the authorSylvain Utard

Sylvain Utard

VP of Engineering

Recommended Articles

Powered by Algolia AI Recommendations

Indexing Markdown content with Algolia
Engineering

Indexing Markdown content with Algolia

Michael King

Michael King

Developer Advocate
Soma Osvay

Soma Osvay

Full Stack Engineer, Starschema
New experimental version of Hacker News Search built with Algolia
Product

New experimental version of Hacker News Search built with Algolia

kevin

kevin

Building a composable front-end search with autocomplete and instant search results
Product

Building a composable front-end search with autocomplete and instant search results

John Stewart

John Stewart

VP Corporate Marketing