Finalize spec for index schema and fields #103
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Advanced search operations require the ability to define rules and configurations about what data should be indexed, how it should be indexed, and how the database should handle this data on read/write. Redis handles this in a declarative manner, allowing for the dev to explicitly control these components of the search patterns.
An
IndexSchema
is what RedisVL uses to simplify this approach for users. The goal is not to replace the core search API.. but rather to create an easier onramp for less redis-savy developers, i.e. AI-native developers.This PR applies a significant overhaul to the v0 implementation of schema in redisvl; with an additional goal of incorporating feedback from across the company/product/users for a better longterm approach in the ecosystem.
Below is a quick example from the class docstring:
IndexSchema
ComponentsIndex Info
Each index has a set of attributes like the index
name
, the chosen keyprefix
, and the underlyingstorage_type
. In RedisVL, we also introduce the setting forkey_separator
which allows you to customize what char is used to separate the prefix from the identifier in the Redis key.Index info can be parsed from a YAML or dict-like representation:
Fields
Fields are a list of.... field definitions that are to be included in the redis index (info as described above). A field has a
name
,type
,path
(optional, only for JSON index), andattrs
(optional settings per field):Fields can be listed in either a dictionary or YAML representation like the following:
Version
The schema will be locked in a
0.1.0
. The pydantic model forIndexSchema
prevents the user from fatfingering or using the incorrect version of the schema for this version of the library. It is a fixed variable.