Typesense

Typesense is a fast, typo-tolerant search engine for building delightful search experiences.

Typesense Demo

Menu

Features

  • Typo tolerant: Handles typographical errors elegantly.
  • Simple and delightful: Simple to set-up and manage.
  • Tunable ranking: Easy to tailor your search results to perfection.
  • Fast: Meticulously designed and optimized for speed.

Install

You can download the binary packages that we publish for Linux (x86-64) and Mac.

You can also run Typesense from our official Docker image:

docker run -p 8108:8108 -v/tmp/data:/data typesense/typesense:0.8.0 --data-dir /data --api-key=Hu52dwsas2AdxdE

Quick Start

Here's a quick example showcasing how you can create a collection, index a document and search it on Typesense.

Let's initialize the client and create a companies collection:

import typesense

typesense.master_node = typesense.Node(
    host='localhost', 
    port=8108, 
    protocol='http', 
    api_key='<YOUR_API_KEY>'
)

typesense.Collections.create({
  "name": "companies",
  "fields": [
    {"name": "company_name", "type": "string" },
    {"name": "num_employees", "type": "int32" },
    {"name": "country", "type": "string", "facet": true }
  ],
  "token_ranking_field": "num_employees"
})

Now, let's add a document to the collection we just created:

document = {
 "id": "124",
 "company_name": "Stark Industries",
 "num_employees": 5215,
 "country": "USA"
}

typesense.Documents.create('companies', document)

Finally, let's search for the document we just indexed:

search_parameters = {
  'q'         : 'stork',
  'query_by'  : 'company_name',
  'filter_by' : 'num_employees:>100',
  'sort_by'   : 'num_employees:desc'
}

typesense.Documents.search('companies', search_parameters)

Did you notice the typo in the query text? No big deal. Typesense handles typographic errors out-of-the-box!

Detailed Guide

A detailed guide is available on Typesense website.

Build from source

Building with Docker

The docker build script takes care of all required dependencies, so it's the easiest way to build Typesense:

$ TYPESENSE_IMG_VERSION=nightly ./docker-build.sh --build-deploy-image [--clean] [--depclean]

Building on your machine

Typesense requires the following dependencies:

  • Snappy
  • zlib
  • OpenSSL (>=1.0.2)
  • curl
  • Recent, C++11 compatible compiler (GCC >= 4.9.0, Apple Clang >= 8.0, Clang >= 3.9.0)
$ ./build.sh [--clean] [--depclean]

The first build will take some time since other third-party libraries are pulled and built as part of the build process.

Help

If you've any questions or run into any problems, please create a Github issue and we'll try our best to help.

© 2016-2018 Wreally Studios Inc.

Description
Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch 🔍 Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences
Readme 20 MiB
Languages
C++ 88.7%
C 8.2%
TypeScript 1.8%
CMake 0.5%
Starlark 0.3%
Other 0.5%