Gathering detailed insights and metrics for @redis/search
Gathering detailed insights and metrics for @redis/search
Gathering detailed insights and metrics for @redis/search
Gathering detailed insights and metrics for @redis/search
npm install @redis/search
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.8
Supply Chain
100
Quality
92.9
Maintenance
100
Vulnerability
100
License
TypeScript (99.41%)
JavaScript (0.58%)
Dockerfile (0.01%)
Total Downloads
229,259,844
Last Day
171,262
Last Week
3,131,172
Last Month
13,241,629
Last Year
122,597,630
MIT License
17,210 Stars
2,150 Commits
1,908 Forks
294 Watchers
23 Branches
273 Contributors
Updated on Jun 17, 2025
Minified
Minified + Gzipped
Latest Version
5.5.6
Package Id
@redis/search@5.5.6
Unpacked Size
221.24 kB
Size
35.89 kB
File Count
150
NPM Version
10.9.2
Node Version
23.11.0
Published on
Jun 06, 2025
Cumulative downloads
Total Downloads
Last Day
0.4%
171,262
Compared to previous day
Last Week
-2.8%
3,131,172
Compared to previous week
Last Month
5.5%
13,241,629
Compared to previous month
Last Year
67.9%
122,597,630
Compared to previous year
1
1
This package provides support for the RediSearch module, which adds indexing and querying support for data stored in Redis Hashes or as JSON documents with the RedisJSON module.
Should be used with redis
/@redis/client
.
:warning: To use these extra commands, your Redis server must have the RediSearch module installed. To index and query JSON documents, you'll also need to add the RedisJSON module.
For complete examples, see search-hashes.js
and search-json.js
in the examples folder.
Before we can perform any searches, we need to tell RediSearch how to index our data, and which Redis keys to find that data in. The FT.CREATE command creates a RediSearch index. Here's how to use it to create an index we'll call idx:animals
where we want to index hashes containing name
, species
and age
fields, and whose key names in Redis begin with the prefix noderedis:animals
:
1await client.ft.create('idx:animals', { 2 name: { 3 type: SCHEMA_FIELD_TYPE.TEXT, 4 SORTABLE: true 5 }, 6 species: SCHEMA_FIELD_TYPE.TAG, 7 age: SCHEMA_FIELD_TYPE.NUMERIC 8}, { 9 ON: 'HASH', 10 PREFIX: 'noderedis:animals' 11});
See the FT.CREATE
documentation for information about the different field types and additional options.
Once we've created an index, and added some data to Redis hashes whose keys begin with the prefix noderedis:animals
, we can start writing some search queries. RediSearch supports a rich query syntax for full-text search, faceted search, aggregation and more. Check out the FT.SEARCH
documentation and the query syntax reference for more information.
Let's write a query to find all the animals where the species
field has the value dog
:
1const results = await client.ft.search('idx:animals', '@species:{dog}');
results
looks like this:
1{ 2 total: 2, 3 documents: [ 4 { 5 id: 'noderedis:animals:4', 6 value: { 7 name: 'Fido', 8 species: 'dog', 9 age: '7' 10 } 11 }, 12 { 13 id: 'noderedis:animals:3', 14 value: { 15 name: 'Rover', 16 species: 'dog', 17 age: '9' 18 } 19 } 20 ] 21}
RediSearch can also index and query JSON documents stored in Redis using the RedisJSON module. The approach is similar to that for indexing and searching data in hashes, but we can now use JSON Path like syntax and the data no longer has to be flat name/value pairs - it can contain nested objects and arrays.
As before, we create an index with the FT.CREATE
command, this time specifying we want to index JSON documents that look like this:
1{ 2 name: 'Alice', 3 age: 32, 4 coins: 100 5}
Each document represents a user in some system, and users have name, age and coins properties.
One way we might choose to index these documents is as follows:
1await client.ft.create('idx:users', { 2 '$.name': { 3 type: SCHEMA_FIELD_TYPE.TEXT, 4 SORTABLE: 'UNF' 5 }, 6 '$.age': { 7 type: SCHEMA_FIELD_TYPE.NUMERIC, 8 AS: 'age' 9 }, 10 '$.coins': { 11 type: SCHEMA_FIELD_TYPE.NUMERIC, 12 AS: 'coins' 13 } 14}, { 15 ON: 'JSON', 16 PREFIX: 'noderedis:users' 17});
Note that we're using JSON Path to specify where the fields to index are in our JSON documents, and the AS
clause to define a name/alias for each field. We'll use these when writing queries.
Now we have an index and some data stored as JSON documents in Redis (see the JSON package documentation for examples of how to store JSON), we can write some queries...
We'll use the RediSearch query language and FT.SEARCH
command. Here's a query to find users under the age of 30:
1await client.ft.search('idx:users', '@age:[0 30]');
No vulnerabilities found.
Reason
30 commit(s) and 15 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
SAST tool is run on all commits
Details
Reason
7 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
Found 5/30 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-06-09
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More@node-redis/search
This package provides support for the [RediSearch](https://redisearch.io) module, which adds indexing and querying support for data stored in Redis Hashes or as JSON documents with the RedisJSON module. It extends the [Node Redis client](https://github.c
reds
Redis search for node.js
redis-search
redis-search is a very light-weight search engine for node.js using redis. This module is an implementation of [n-gram method](http://en.wikipedia.org/wiki/N-gram). This is a light general purpose search library that could be integrated into a blog, a documentation server, etc.
verdaccio-redis-search-patch
The middleware overrides v1/search endpoint with a redis search based backend for verdaccio@5 and verdaccio-redis-storage