redis-om
- AbstractSearch
- ArrayHashInput
- Circle
- Client
- Field
- FieldNotInSchema
- InvalidHashInput
- InvalidHashValue
- InvalidInput
- InvalidJsonInput
- InvalidJsonValue
- InvalidSchema
- InvalidValue
- NestedHashInput
- NullJsonInput
- NullJsonValue
- PointOutOfRange
- RawSearch
- RedisOmError
- Repository
- Schema
- Search
- SearchError
- SemanticSearchError
- Where
- WhereField
- AllFieldDefinition
- BooleanFieldDefinition
- CircleFunction
- CommonFieldDefinition
- DataStructure
- DateFieldDefinition
- Entity
- EntityData
- EntityDataValue
- EntityInternal
- EntityKeys
- FieldDefinition
- FieldType
- IdStrategy
- InferSchema
- NumberArrayFieldDefinition
- NumberFieldDefinition
- Point
- PointFieldDefinition
- RedisClientConnection
- RedisClusterConnection
- RedisConnection
- SchemaDefinition
- SchemaOptions
- StopWordOptions
- StringArrayFieldDefinition
- StringFieldDefinition
- SubSearchFunction
- TextFieldDefinition
Ƭ AllFieldDefinition: Object
All configuration properties that any field might have, regardless of type.
Name | Type | Description |
---|---|---|
alias? |
string |
The default field name in Redis is the property name defined in the SchemaDefinition. Overrides the field name for a Hash to this value or in the case of JSON documents, sets the JSONPath to this value preceded by $. . Overridden by field and/or path settings. Deprecated |
caseSensitive? |
boolean |
Is the original case of this field indexed with Redis OM. Defaults to false. |
field? |
string |
The field name used to store this in a Redis Hash. Defaults to the name used in the SchemaDefinition or the alias property. |
indexed? |
boolean |
Is this field indexed and thus searchable with Redis OM. Defaults to true. |
matcher? |
"dm:en" | "dm:fr" | "dm:pt" | "dm:es" |
Enables setting the phonetic matcher to use, supported matchers are: dm:en - Double Metaphone for English dm:fr - Double Metaphone for French dm:pt - Double Metaphone for Portuguese dm:es - Double Metaphone for Spanish |
normalized? |
boolean |
Is this (sortable) field normalized when indexed. Defaults to true. |
path? |
string |
The JSONPath expression this field references. Used only by search and only for JSON documents. Defaults to the name used in the SchemaDefinition or the alias property prefixed with $. . |
separator? |
string |
Due to how RediSearch works, strings and arrays are sometimes stored the same in Redis, as a simple string. This is the separator used to split those strings when it is an array. If your StringField contains this separator, this can cause problems. You can change it here to avoid those problems. Defaults to | . |
sortable? |
boolean |
Enables sorting by this field. |
stemming? |
boolean |
Is word stemming applied to this field with Redis OM. Defaults to true. |
type |
FieldType |
The type of the field (i.e. string, number, boolean, etc.) |
weight? |
number |
Enables setting the weight to apply to a text field |
Ƭ BooleanFieldDefinition: { type
: "boolean"
} & CommonFieldDefinition
& Pick
<AllFieldDefinition
, "sortable"
>
A field representing a boolean.
Ƭ CircleFunction: (circle
: Circle
) => Circle
▸ (circle
): Circle
A function that defines a circle for .inCircle
searches.
Name | Type |
---|---|
circle |
Circle |
Ƭ CommonFieldDefinition: Pick
<AllFieldDefinition
, "type"
| "alias"
| "indexed"
| "field"
| "path"
>
The configuration properties that all fields have in common.
Ƭ DataStructure: "HASH"
| "JSON"
The type of data structure in Redis to map objects to.
Ƭ DateFieldDefinition: { type
: "date"
} & CommonFieldDefinition
& Pick
<AllFieldDefinition
, "sortable"
>
A field representing a date/time.
Ƭ Entity: EntityData
& EntityInternal
Defines the objects returned from calls to repositories.
Ƭ EntityData: Object
The free-form data associated with an Entity.
▪ [key: string
]: EntityDataValue
| EntityData
| (EntityDataValue
| EntityData
)[]
Ƭ EntityDataValue: string
| number
| boolean
| Date
| Point
| null
| undefined
| (EntityDataValue
| EntityData
)[]
Valid types for values in an Entity.
Ƭ EntityInternal: Object
Name | Type | Description |
---|---|---|
[EntityId]? |
string |
The unique ID of the Entity. Access using the EntityId Symbol. |
[EntityKeyName]? |
string |
The key the Entity is stored under inside of Redis. Access using the EntityKeyName Symbol. |
Ƭ EntityKeys<T
>: Exclude
<keyof T
, keyof EntityInternal
>
Name | Type |
---|---|
T |
extends Entity |
Ƭ FieldDefinition: BooleanFieldDefinition
| DateFieldDefinition
| NumberFieldDefinition
| NumberArrayFieldDefinition
| PointFieldDefinition
| StringFieldDefinition
| StringArrayFieldDefinition
| TextFieldDefinition
Contains instructions telling how to map a property on an Entity to Redis.
Ƭ FieldType: "boolean"
| "date"
| "number"
| "number[]"
| "point"
| "string"
| "string[]"
| "text"
Valid field types for a FieldDefinition.
Ƭ IdStrategy: () => Promise
<string
>
▸ (): Promise
<string
>
A function that generates random entityIds.
Promise
<string
>
Ƭ InferSchema<T
>: T
extends Schema
<infer R> ? R
: never
Name |
---|
T |
Ƭ NumberArrayFieldDefinition: { type
: "number[]"
} & CommonFieldDefinition
& Pick
<AllFieldDefinition
, "sortable"
>
A field representing an array of numbers.
Ƭ NumberFieldDefinition: { type
: "number"
} & CommonFieldDefinition
& Pick
<AllFieldDefinition
, "sortable"
>
A field representing a number.
Ƭ Point: Object
Defines a point on the globe using longitude and latitude.
Name | Type | Description |
---|---|---|
latitude |
number |
The latitude of the point. |
longitude |
number |
The longitude of the point. |
Ƭ PointFieldDefinition: { type
: "point"
} & CommonFieldDefinition
A field representing a point on the globe.
Ƭ RedisClientConnection: ReturnType
<typeof createClient
>
A conventional Redis connection.
Ƭ RedisClusterConnection: ReturnType
<typeof createCluster
>
A clustered Redis connection.
Ƭ RedisConnection: RedisClientConnection
| RedisClusterConnection
A Redis connection, clustered or conventional.
Ƭ SchemaDefinition<T
>: Record
<EntityKeys
<T
>, FieldDefinition
>
Group of FieldDefinitions that define the schema for an Entity.
Name | Type |
---|---|
T |
extends Entity = Record <string , any > |
Ƭ SchemaOptions: Object
Configuration options for a Schema.
Name | Type | Description |
---|---|---|
dataStructure? |
DataStructure |
The data structure used to store the Entity in Redis. Can be set to either JSON or HASH . Defaults to JSON. |
idStrategy? |
IdStrategy |
A function that generates a random entityId. Defaults to a function that generates ULIDs. Combined with prefix to generate a Redis key. If prefix is Foo and idStratgey returns 12345 then the generated key would be Foo:12345 . |
indexHashName? |
string |
The name used by Redis OM to store the hash of the index for this Schema. Defaults to prefix followed by :index:hash . So, for a prefix of Foo , it would use Foo:index:hash . |
indexName? |
string |
The name used by RediSearch to store the index for this Schema. Defaults to prefix followed by :index . So, for a prefix of Foo , it would use Foo:index . |
stopWords? |
string [] |
Stop words to be used by this schema. If useStopWords is anything other than CUSTOM , this option is ignored. |
useStopWords? |
StopWordOptions |
Configures the usage of stop words. Valid values are OFF , DEFAULT , and CUSTOM . Setting this to OFF disables all stop words. Setting this to DEFAULT uses the stop words intrinsic to RediSearch. Setting this to CUSTOM tells RediSearch to use the stop words in stopWords . |
Ƭ StopWordOptions: "OFF"
| "DEFAULT"
| "CUSTOM"
Valid values for how to use stop words for a given Schema.
Ƭ StringArrayFieldDefinition: { type
: "string[]"
} & CommonFieldDefinition
& Pick
<AllFieldDefinition
, "sortable"
| "caseSensitive"
| "normalized"
| "separator"
>
A field representing an array of strings.
Ƭ StringFieldDefinition: { type
: "string"
} & CommonFieldDefinition
& Pick
<AllFieldDefinition
, "sortable"
| "caseSensitive"
| "normalized"
| "separator"
>
A field representing a whole string.
Ƭ SubSearchFunction<T
>: (search
: Search
<T
>) => Search
<T
>
Name | Type |
---|---|
T |
extends Entity |
▸ (search
): Search
<T
>
A function that takes a Search and returns a Search. Used in nested queries.
Name | Type |
---|---|
search |
Search <T > |
Search
<T
>
Ƭ TextFieldDefinition: { type
: "text"
} & CommonFieldDefinition
& Pick
<AllFieldDefinition
, "sortable"
| "normalized"
| "matcher"
| "stemming"
| "weight"
>
A field representing searchable text.
• Const
EntityId: typeof EntityId
The Symbol used to access the entity ID of an Entity.
• Const
EntityKeyName: typeof EntityKeyName
The Symbol used to access the keyname of an Entity.