creating an index in a db that is not 0 throws error

127.0.0.1:6379> SELECT 1
OK
127.0.0.1:6379[1]> FT.CREATE vmi NOOFFSETS NOFREQS SCHEMA id TAG e TAG p TAG y TAG
(error) Cannot create index on db != 0

Is this addressable? The use case is testing, I generate a dataset into a new DB (1) for isolation purposes. Otherwise, I 'd have to write code to start/stop arbitrary Redis instances, while this approach solves the problem very cleanly with minimal code.

Redisearch only supports DB 0, as the error message says. I’m sure adding support for other databases is already a feature request. In the meantime, you can either push your other usages to different DB numbers and reserve 0 for your Redisearch testing OR probably more advisable would be to just spin a new instance on a different port (e.g. 6378). It’s very easy to do and offers complete isolation for testing purposes. Here are some instructions that might prove helpful: http://sysops.km2gd.com/how-to-run-multiple-redis-instance-on-centos-7-it-supports-centos-6-6-5/ Redis actually performs better with different uses cases spread across multiple instances instead of cramming them into one instance with different databases/namespaces.