Lightning fast, typo-tolerant search

Implementing fast, typo-tolerant search is super easy with Relevance AI. All you have to do is create a dataset and insert your data... it just works.

You will be able to filter, facet and sort without any further indexing. With 100K free requests every month, Relevance AI search is a no brainer for your application.

Inserting your data

Everything starts with a dataset. These are like MongoDB collections or SQL tables. You upload your data to a dataset, and you search a dataset. Create a dataset in our dashboard.

Then upload a JSON or CSV file into your dataset from the dashboard. Alternatively, you can use our SDK to super easily bulk insert data:

// import client from SDK
import { DiscoveryClient } from "@relevanceai/sdk";

// initialize client
const client = new DiscoveryClient({
  project: process.env.RELEVANCE_PROJECT,
  api_key: process.env.RELEVANCE_API_KEY,
});

const dataset = client.dataset("my-dataset");

// insert an array containing JSON objects
await dataset.insertDocuments([...myData]);

Searching your data

Once your dataset is set up, you can instantly search it using our SDK's simple QueryBuilder:

// import client and query builder
import { DiscoveryClient, QueryBuilder } from "@relevanceai/sdk";

// initialize client
const client = new DiscoveryClient({
  project: process.env.RELEVANCE_PROJECT,
  api_key: process.env.RELEVANCE_API_KEY,
});

const dataset = client.dataset("my-dataset");

// search "short_description" and "title" text fields
const query = QueryBuilder().query("hello world").text("short_description").text("title");
const results = await dataset.search(query);

// search "product_name", filtering for high "likes"
const query = QueryBuilder().query("earbuds").text("product_name").range("likes", { greaterThan: 50 });
const results = await dataset.search(query);

Easy aggregation (facets)

Very often you want to help users filter through search results by aggregating fields in your results. These are often called "facets".

Doing this with our SDK is easy:

// import client and query builder
import { DiscoveryClient, QueryBuilder } from "@relevanceai/sdk";

// initialize client
const client = new DiscoveryClient({
  project: process.env.RELEVANCE_PROJECT,
  api_key: process.env.RELEVANCE_API_KEY,
});

const dataset = client.dataset("my-dataset");

// search "product_name", and return facets for "product_type" and "price"
const query = QueryBuilder().query("earbuds").text("product_name").aggregate("product_type").aggregateStats("price",10);
const results = await dataset.search(query);