Quick Start Guide for RediSearch

Redis Cloud

RediSearch is available on all Redis Cloud managed services. Redis Cloud Essentials offers a completely free managed databbases up to 30MB.

Get started here

Running with Docker

docker run -p 6379:6379 redislabs/redisearch:latest

Building and running from source

RediSearch uses CMake as its build system. CMake is available for almost every available platform. You can obtain cmake through your operating system's package manager. RediSearch requires CMake version 3 or greater. If your package repository does not contain CMake3, you can download a precompiled binary from CMake downloads .

To build using CMake:

git clone https://github.com/RedisLabsModules/RediSearch.git
cd RediSearch
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo

redis-server --loadmodule ./redisearch.so

The resulting module will be in the current directory.

You can also simply type make from the top level directory, this will take care of running cmake with the appropriate arguments, and provide you with a redisearch.so file in the src directory:

git clone https://github.com/RedisLabsModules/RediSearch.git
cd RediSearch
redis-server --loadmodule ./src/redisearch.so

Creating an index with fields and weights (default weight is 1.0)> FT.CREATE myIdx SCHEMA title TEXT WEIGHT 5.0 body TEXT url TEXT

Adding documents to the index> FT.ADD myIdx doc1 1.0 FIELDS title "hello world" body "lorem ipsum" url "http://redis.io" 

Searching the index> FT.SEARCH myIdx "hello world" LIMIT 0 10
1) (integer) 1
2) "doc1"
3) 1) "title"
   2) "hello world"
   3) "body"
   4) "lorem ipsum"
   5) "url"
   6) "http://redis.io"


Input is expected to be valid utf-8 or ASCII. The engine cannot handle wide character unicode at the moment.

Dropping the index> FT.DROP myIdx

Adding and getting Auto-complete suggestions> FT.SUGADD autocomplete "hello world" 100
OK> FT.SUGGET autocomplete "he"
1) "hello world"