Skip to content
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

Add support for ON JSON index type in RediSearch #23

Open
gkorland opened this issue Jun 3, 2021 · 2 comments
Open

Add support for ON JSON index type in RediSearch #23

gkorland opened this issue Jun 3, 2021 · 2 comments

Comments

@gkorland
Copy link
Contributor

gkorland commented Jun 3, 2021

No description provided.

@mgravell
Copy link
Collaborator

mgravell commented Jun 3, 2021

any chance of an API reference here, or a "prior art" example of what this means?

@AvitalFineRedis
Copy link
Contributor

Hi @mgravell
This means you will be able to create a JSON doc which RediSearch will index.

Currently, RediSearch have:

FT.CREATE {index} [ON {structure}] … SCHEMA {field} …

Where:
structure accepts only HASH,
field is the name of the field in the HASH.

The syntax is modified as:

FT.CREATE {index} [ON {structure}] … SCHEMA {identifier} [AS {attribute}] …

Where:
structure can be HASH or JSON.
identifier is either:
ON HASH: The field name of the HASH
ON JSON: a JSONPath.
attribute is the mapped name in RediSearch's index.

E.g.:

FT.CREATE idx ON JSON SCHEMA $.product.label AS label TEXT

By replacing the {field} part of the schema by {identifier} [AS {attribute}], a mapping logic is introduced, where a JSONPath is associated with an attribute name.

gkorland referenced this issue in gkorland/StackExchange.Redis Jun 17, 2021
@NickCraver NickCraver transferred this issue from StackExchange/StackExchange.Redis Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants