Menu
  • Home
  • Blog
  • Spotify
Projects
  • AItHey there! I'm AIt (acts like "alt" /ɔːlt/, but also pronounced as "eight" /eɪt/). It depends. 🤷‍♂️
mateonunez
HomeBlogOpen SourceSpotify

Source code here.

GitHubXLinkedInSpotify

© 2025 Mateo Nunez

  1. Home
  2. Home
  3. Blog
  4. Asterism, the best friend of Lyra
Asterism, the best friend of Lyra
November 26, 2022•Estimated reading time:2 min read
javascriptlyrasearch engineasterism
Create your Blog with Next.js and MDX

Today was released the first stable version of Asterism. Asterism provides a CLI to manage your Lyra instances and searches in a simple way.

What is Lyra?

Lyra is a search engine created by Michele Riva. Lyra makes thousands searches within a few microseconds (μs) (yes, ms / 1000).

The main idea of Lyra is to provide a search engine that can be used in all devices that JavaScript can run: web, mobile, desktop, TVs, etc. Everywhere!

Ok, but what is Asterism?

Asterism is a CLI tool that helps you to convert your database instances (MySQL and PostgreSQL) into Lyra instances and to create searches in a simple way.

How to install it?

You can install Asterism using npm|yarn|pnpm:

npm install -g @mateonunez/asterism

How to use it?

Asterism provides a simple CLI to manage your Lyra instances and searches.

Create a new Lyra instance

To create a new Lyra instance you can use the migrate command:

asterism migrate postgres -d postgres -t posts

This command will create a new Lyra instance from a PostgreSQL table. You can also use the mysql option to create a new Lyra instance from a MySQL table.

A new persistent Lyra instance will be created in the provided folder. (default is /out).

Make a search

To make a search you can use the search command:

asterism search "cool"

This command will search the provided string in all the Lyra instances and will return the results.

Example:

$ asterism search "cool" [2022-11-26 14:26:49.844] INFO: Resolving asterism. [2022-11-26 14:26:50.032] INFO: Searching on asterism. [2022-11-26 14:26:50.034] INFO: instance_one: { "count": 0, "elapsed": 225799, "hits": [] } instance_two: { "count": 1, "elapsed": 931864, "hits": [ { "id": 1, "title": "Cool title", "content": "Cool content" } ] }

Contribute

Asterism is an open source project and you can contribute to it. You can find the source code in GitHub.

You can also contribute to Lyra. You can find the source code in GitHub.

M

Written by

Mateo

Related Articles

Migrating your Next.js application to `appDir`

My personal experience migrating my Next.js application to the new `app` router.

How to consume Spotify APIs using Next.js and JavaScript

Hello stranger! In this article I will show you how I made my blog serverless with Next.js and MDX.

How I made my Blog with Next.js and MDX

Hello stranger! In this article I will show you how I made my blog serverless with Next.js and MDX.