Skip to content

Quick Start Guide for RediSearch

Running with Docker

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

Building and running from source

git clone
cd RediSearch/src
make all

# Assuming you have a Redis build from the unstable branch:
/path/to/redis-server --loadmodule ./

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 "" 

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) ""


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"