Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
291 changes: 249 additions & 42 deletions README.md

Large diffs are not rendered by default.

15 changes: 1 addition & 14 deletions docs/api/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,7 @@ SemanticCache

.. _semantic_cache_api:

.. currentmodule:: redisvl.llmcache.semantic

.. autosummary::

SemanticCache.__init__
SemanticCache.check
SemanticCache.store
SemanticCache.clear
SemanticCache.delete
SemanticCache.distance_threshold
SemanticCache.set_threshold
SemanticCache.ttl
SemanticCache.set_ttl

.. currentmodule:: redisvl.extensions.llmcache

.. autoclass:: SemanticCache
:show-inheritance:
Expand Down
52 changes: 6 additions & 46 deletions docs/api/filter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,10 @@ Tag

.. currentmodule:: redisvl.query.filter

.. autosummary::

Tag.__init__
Tag.__eq__
Tag.__ne__
Tag.__str__


.. autoclass:: Tag
:show-inheritance:
:members:
:special-members:
:inherited-members:

:exclude-members: __hash__


Text
Expand All @@ -38,19 +28,11 @@ Text

.. currentmodule:: redisvl.query.filter

.. autosummary::

Text.__init__
Text.__eq__
Text.__ne__
Text.__mod__
Text.__str__


.. autoclass:: Text
:show-inheritance:
:members:
:special-members:
:exclude-members: __hash__


Num
Expand All @@ -59,52 +41,30 @@ Num

.. currentmodule:: redisvl.query.filter

.. autosummary::

Num.__init__
Num.__eq__
Num.__ne__
Num.__lt__
Num.__le__
Num.__gt__
Num.__ge__
Num.__str__


.. autoclass:: Num
:show-inheritance:
:members:
:special-members:
:exclude-members: __hash__


Geo
===

.. currentmodule:: redisvl.query.filter

.. autosummary::

Geo.__init__
Geo.__eq__
Geo.__ne__
Geo.__str__

.. autoclass:: Geo
:show-inheritance:
:members:
:special-members:
:exclude-members: __hash__


GeoRadius
=========

.. currentmodule:: redisvl.query.filter

.. autosummary::

GeoRadius.__init__

.. autoclass:: GeoRadius
:show-inheritance:
:members:
:special-members:
:special-members:
:exclude-members: __hash__
36 changes: 0 additions & 36 deletions docs/api/query.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,8 @@ VectorQuery

.. currentmodule:: redisvl.query

.. autosummary::

VectorQuery.__init__
VectorQuery.set_filter
VectorQuery.get_filter
VectorQuery.query
VectorQuery.params


.. autoclass:: VectorQuery
:show-inheritance:
:members:
:inherited-members:

Expand All @@ -31,17 +22,8 @@ RangeQuery

.. currentmodule:: redisvl.query

.. autosummary::

RangeQuery.__init__
RangeQuery.set_filter
RangeQuery.get_filter
RangeQuery.query
RangeQuery.params


.. autoclass:: RangeQuery
:show-inheritance:
:members:
:inherited-members:

Expand All @@ -52,17 +34,8 @@ FilterQuery

.. currentmodule:: redisvl.query

.. autosummary::

FilterQuery.__init__
FilterQuery.set_filter
FilterQuery.get_filter
FilterQuery.query
FilterQuery.params


.. autoclass:: FilterQuery
:show-inheritance:
:members:
:inherited-members:

Expand All @@ -73,16 +46,7 @@ CountQuery

.. currentmodule:: redisvl.query

.. autosummary::

CountQuery.__init__
CountQuery.set_filter
CountQuery.get_filter
CountQuery.query
CountQuery.params


.. autoclass:: CountQuery
:show-inheritance:
:members:
:inherited-members:
114 changes: 83 additions & 31 deletions docs/api/schema.rst
Original file line number Diff line number Diff line change
@@ -1,50 +1,102 @@

***********
Schema
***********

Schema in RedisVL provides a structured format to define index settings and
field configurations using the following three components:

.. list-table::
:widths: 20 80
:header-rows: 1

* - Component
- Description
* - `version`
- The version of the schema spec. Current supported version is `0.1.0`.
* - `index`
- Index specific settings like name, key prefix, key separator, and storage type.
* - `fields`
- Subset of fields within your data to include in the index and any custom settings.


IndexSchema
===========

.. _searchindex_api:
.. _indexschema_api:

.. currentmodule:: redisvl.schema

.. autosummary::

IndexSchema.index
IndexSchema.fields
IndexSchema.version
IndexSchema.field_names
IndexSchema.redis_fields
IndexSchema.add_field
IndexSchema.add_fields
IndexSchema.remove_field
IndexSchema.from_yaml
IndexSchema.to_yaml
IndexSchema.from_dict
IndexSchema.to_dict

.. autoclass:: IndexSchema
:show-inheritance:
:inherited-members:
:members:
:exclude-members: generate_fields,validate_and_create_fields,redis_fields


IndexInfo
=========
Defining Fields
===============

.. currentmodule:: redisvl.schema
Fields in the schema can be defined in YAML format or as a Python dictionary, specifying a name, type, an optional path, and attributes for customization.

.. autosummary::
**YAML Example**:

IndexInfo.name
IndexInfo.prefix
IndexInfo.key_separator
IndexInfo.storage_type
.. code-block:: yaml

- name: title
type: text
path: $.document.title
attrs:
weight: 1.0
no_stem: false
withsuffixtrie: true

.. autoclass:: IndexInfo
:show-inheritance:
:inherited-members:
:members:
**Python Dictionary Example**:

.. code-block:: python

{
"name": "location",
"type": "geo",
"attrs": {
"sortable": true
}
}

Supported Field Types and Attributes
====================================

Each field type supports specific attributes that customize its behavior. Below are the field types and their available attributes:

**Text Field Attributes**:

- `weight`: Importance of the field in result calculation.
- `no_stem`: Disables stemming during indexing.
- `withsuffixtrie`: Optimizes queries by maintaining a suffix trie.
- `phonetic_matcher`: Enables phonetic matching.
- `sortable`: Allows sorting on this field.

**Tag Field Attributes**:

- `separator`: Character for splitting text into individual tags.
- `case_sensitive`: Case sensitivity in tag matching.
- `withsuffixtrie`: Suffix trie optimization for queries.
- `sortable`: Enables sorting based on the tag field.

**Numeric and Geo Field Attributes**:

- Both numeric and geo fields support the `sortable` attribute, enabling sorting on these fields.

**Common Vector Field Attributes**:

- `dims`: Dimensionality of the vector.
- `algorithm`: Indexing algorithm (`flat` or `hnsw`).
- `datatype`: Float datatype of the vector (`float32` or `float64`).
- `distance_metric`: Metric for measuring query relevance (`COSINE`, `L2`, `IP`).

**HNSW Vector Field Specific Attributes**:

- `m`: Max outgoing edges per node in each layer.
- `ef_construction`: Max edge candidates during build time.
- `ef_runtime`: Max top candidates during search.
- `epsilon`: Range search boundary factor.

Note:
See fully documented Redis-supported fields and options here: https://redis.io/commands/ft.create/
2 changes: 0 additions & 2 deletions docs/api/searchindex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ SearchIndex
.. currentmodule:: redisvl.index

.. autoclass:: SearchIndex
:show-inheritance:
:inherited-members:
:members:

Expand All @@ -33,6 +32,5 @@ AsyncSearchIndex
.. currentmodule:: redisvl.index

.. autoclass:: AsyncSearchIndex
:show-inheritance:
:inherited-members:
:members:
Loading