You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-07-31 05:44:24 +03:00
docs(search): update SchemaFieldTypes to SCHEMA_FIELD_TYPE for redis@5.x (#2992)
This commit is contained in:
@ -19,11 +19,11 @@ Before we can perform any searches, we need to tell RediSearch how to index our
|
||||
```javascript
|
||||
await client.ft.create('idx:animals', {
|
||||
name: {
|
||||
type: SchemaFieldTypes.TEXT,
|
||||
type: SCHEMA_FIELD_TYPE.TEXT,
|
||||
SORTABLE: true
|
||||
},
|
||||
species: SchemaFieldTypes.TAG,
|
||||
age: SchemaFieldTypes.NUMERIC
|
||||
species: SCHEMA_FIELD_TYPE.TAG,
|
||||
age: SCHEMA_FIELD_TYPE.NUMERIC
|
||||
}, {
|
||||
ON: 'HASH',
|
||||
PREFIX: 'noderedis:animals'
|
||||
@ -91,15 +91,15 @@ One way we might choose to index these documents is as follows:
|
||||
```javascript
|
||||
await client.ft.create('idx:users', {
|
||||
'$.name': {
|
||||
type: SchemaFieldTypes.TEXT,
|
||||
type: SCHEMA_FIELD_TYPE.TEXT,
|
||||
SORTABLE: 'UNF'
|
||||
},
|
||||
'$.age': {
|
||||
type: SchemaFieldTypes.NUMERIC,
|
||||
type: SCHEMA_FIELD_TYPE.NUMERIC,
|
||||
AS: 'age'
|
||||
},
|
||||
'$.coins': {
|
||||
type: SchemaFieldTypes.NUMERIC,
|
||||
type: SCHEMA_FIELD_TYPE.NUMERIC,
|
||||
AS: 'coins'
|
||||
}
|
||||
}, {
|
||||
|
Reference in New Issue
Block a user