Quick start

Quick start guide

Quick Start Guide for RediSearch

Redis Cloud

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

Get started here

Running with Docker

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

Download and running binaries

First download the pre-compiled version from the Redis download center.

Next, run Redis with RediSearch:

$ redis-server --loadmodule /path/to/module/src/redisearch.so

Building and running from source

First, clone the git repo (make sure not to omit the --recursive option, to properly clone submodules):

git clone --recursive https://github.com/RediSearch/RediSearch.git
cd RediSearch

Next, install dependencies:

On macOS:

make setup

On Linux:

sudo make setup

Next, build:

make build

Finally, run Redis with RediSearch:

make run

For more elaborate build instructions, see the Development page.

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

Adding documents to the index> hset doc:1 title "hello world" body "lorem ipsum" url "http://redis.io" 
(integer) 3

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

Dropping the index> FT.DROPINDEX myIdx 

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