Skip to content

Use of SCHEMA_FIELD_TYPE and SchemaFieldTypes in redisearch #2985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
23navi opened this issue Jun 3, 2025 · 3 comments · Fixed by #2992
Closed

Use of SCHEMA_FIELD_TYPE and SchemaFieldTypes in redisearch #2985

23navi opened this issue Jun 3, 2025 · 3 comments · Fixed by #2992
Assignees

Comments

@23navi
Copy link
Contributor

23navi commented Jun 3, 2025

Description

The documentation for redisearch packages/search uses the SchemaFieldTypes which is coming from import {SchemaFieldTypes} from "redis" but in the same document we have an example link which takes to
examples/search-hashes.js and here I see

import { createClient, SCHEMA_FIELD_TYPE } from 'redis';
...
type: SCHEMA_FIELD_TYPE.TEXT

While testing locally with "redis": "^4.0.3"
When trying import { SCHEMA_FIELD_TYPE } from "redis"
I am getting the error: '"redis"' has no exported member named 'SCHEMA_FIELD_TYPE'. Did you mean 'SchemaFieldTypes'?

@nkaradzhov nkaradzhov self-assigned this Jun 3, 2025
@nkaradzhov
Copy link
Collaborator

@23navi thanks for flagging this.

There is a breaking change in redis@5xx:

SchemaFieldTypes -> SCHEMA_FIELD_TYPE [^enum-to-constants]

So,

  • for redis@4xx, you need to use SchemaFieldTypes
  • for redis@5xx, you need to use SCHEMA_FIELD_TYPE

That said, the documentation in packages/search is stale and misleading. I will fix it.

@23navi
Copy link
Contributor Author

23navi commented Jun 3, 2025

Hello, thank you for update.
Can I pick this fix? @nkaradzhov

@nkaradzhov
Copy link
Collaborator

Absolutely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants