Quick Start Guide for RediSearch
Running with Docker
To build using CMake:
cd RediSearch
cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make
redis-server --loadmodule ./redisearch.so
You can also simply type make
from the top level directory, this will take care of running with the appropriate arguments, and provide you with a redisearch.so
file in the src
directory:
Creating an index with fields and weights (default weight is 1.0)
127.0.0.1:6379> FT.CREATE myIdx SCHEMA title TEXT WEIGHT 5.0 body TEXT url TEXT
OK
Searching the index
127.0.0.1:6379> FT.SEARCH myIdx "hello world" LIMIT 0 10
1) (integer) 1
2) "doc1"
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.
Adding and getting Auto-complete suggestions
127.0.0.1:6379> FT.SUGADD autocomplete "hello world" 100
OK
127.0.0.1:6379> FT.SUGGET autocomplete "he"