Registry / search / redisearch

redisearch

JSON →
library2.0.1jsnpmunverified

A Node.js plugin for indexing and searching data in Redis, inspired by reds. Version 2.0.1 supports querying on extra fields beyond the default 'content' field, allowing filtering by additional properties. The package is minimal and simple, but has not seen recent updates (latest release is old, requires Node >=0.10). It uses a basic term-based indexing approach and provides methods to index, search, and remove documents. No TypeScript definitions or ESM support.

npm install redisearch
INSTALL
IMPORT
SIG · REDISEARCH
R
redisearch
searchjavascriptv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

redisSearch
const redisSearch = require('redisSearch');
const redisSearch = require('redis-search');
The package name on npm is 'redis-search', but the required module is 'redisSearch' (camelCase).
createSearch
redisSearch.createSearch('indexName', [redisClient]);
The second argument is an optional array containing a Redis client instance.
index
postSearch.index(data, id, callback);
postSearch.index(id, data, callback);
Arguments order: data object (must include 'content' field), id, callback.

Creates a search index, indexes a document with 'content' and extra fields, and performs a search with filtering on extra fields.

const redisSearch = require('redisSearch'); const redis = require('redis'); const client = redis.createClient(); const postSearch = redisSearch.createSearch('posts', [client]); // Index a document postSearch.index({ content: 'orange apple', uid: 5, cid: 2 }, 1, (err) => { if (err) console.error(err); else console.log('Indexed'); }); // Search postSearch.query({ query: { content: 'orange', uid: 5, cid: 2 } }, (err, ids) => { if (err) console.error(err); else console.log('IDs:', ids); });
Debug
Known issues
gotchaThe required module name is 'redisSearch' (capital 'S'), not the kebab-case package name.
fix
Use const redisSearch = require('redisSearch');
affects: >=0.0.1
gotchaThe 'content' field is mandatory in the data object; missing it will cause unexpected behavior.
fix
Always include a 'content' string field when indexing.
affects: >=0.0.1
breakingNode.js version requirement is >=0.10; modern Node versions may not be supported due to use of deprecated APIs.
fix
Use an older Node version or consider an alternative like RediSearch.
affects: >=2.0.0
deprecatedThe package has not been updated since 2015; no support for Redis cluster, SSL, or modern Redis features.
fix
Migrate to redis-modules-sdk or node-redis with RediSearch module.
affects: all
Errors
Common errors & fixes
Cannot find module 'redisSearch'
Incorrect require module name or package not installed.
fix
Install the package: npm install redis-search; and require 'redisSearch' (camelCase).
TypeError: redisSearch.createSearch is not a function
The require may have returned a different module due to incorrect casing or missing dependency.
fix
Ensure you are using const redisSearch = require('redisSearch'); and that the redis package is installed.
Error: The content field is required
The data object passed to index() does not have a 'content' property.
fix
Add a 'content' string property to the data object.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
redisrequiredRequired to interact with Redis server
Agent activity
45 hits · last 30 days
node
40
OpenAI (training)
1
Resources
redisearch — npm install redisearch · libregistry