1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

docs(search): update SchemaFieldTypes to SCHEMA_FIELD_TYPE for redis@5.x (#2992)

This commit is contained in:
Navi sureka
2025-06-06 12:00:07 +05:30
committed by GitHub
parent 2bb515e489
commit 21d8f0e957

View File

@@ -19,11 +19,11 @@ Before we can perform any searches, we need to tell RediSearch how to index our
```javascript ```javascript
await client.ft.create('idx:animals', { await client.ft.create('idx:animals', {
name: { name: {
type: SchemaFieldTypes.TEXT, type: SCHEMA_FIELD_TYPE.TEXT,
SORTABLE: true SORTABLE: true
}, },
species: SchemaFieldTypes.TAG, species: SCHEMA_FIELD_TYPE.TAG,
age: SchemaFieldTypes.NUMERIC age: SCHEMA_FIELD_TYPE.NUMERIC
}, { }, {
ON: 'HASH', ON: 'HASH',
PREFIX: 'noderedis:animals' PREFIX: 'noderedis:animals'
@@ -91,15 +91,15 @@ One way we might choose to index these documents is as follows:
```javascript ```javascript
await client.ft.create('idx:users', { await client.ft.create('idx:users', {
'$.name': { '$.name': {
type: SchemaFieldTypes.TEXT, type: SCHEMA_FIELD_TYPE.TEXT,
SORTABLE: 'UNF' SORTABLE: 'UNF'
}, },
'$.age': { '$.age': {
type: SchemaFieldTypes.NUMERIC, type: SCHEMA_FIELD_TYPE.NUMERIC,
AS: 'age' AS: 'age'
}, },
'$.coins': { '$.coins': {
type: SchemaFieldTypes.NUMERIC, type: SCHEMA_FIELD_TYPE.NUMERIC,
AS: 'coins' AS: 'coins'
} }
}, { }, {