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
10 changes: 10 additions & 0 deletions docs/api/query.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ HybridQuery
:show-inheritance:
:exclude-members: add_filter,get_args,highlight,return_field,summarize

.. note::
The ``stopwords`` parameter in :class:`HybridQuery` (and :class:`AggregateHybridQuery`) controls query-time stopword filtering (client-side).
For index-level stopwords configuration (server-side), see :class:`redisvl.schema.IndexInfo.stopwords`.
Using query-time stopwords with index-level ``STOPWORDS 0`` is counterproductive.


TextQuery
================
Expand All @@ -61,6 +66,11 @@ TextQuery
:show-inheritance:
:exclude-members: add_filter,get_args,highlight,return_field,summarize

.. note::
The ``stopwords`` parameter in :class:`TextQuery` controls query-time stopword filtering (client-side).
For index-level stopwords configuration (server-side), see :class:`redisvl.schema.IndexInfo.stopwords`.
Using query-time stopwords with index-level ``STOPWORDS 0`` is counterproductive.


FilterQuery
===========
Expand Down
41 changes: 41 additions & 0 deletions docs/api/schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,47 @@ IndexSchema
:exclude-members: generate_fields,validate_and_create_fields,redis_fields


Index-Level Stopwords Configuration
====================================

The :class:`IndexInfo` class supports index-level stopwords configuration through
the ``stopwords`` field. This controls which words are filtered during indexing
(server-side), as opposed to query-time filtering (client-side).

**Configuration Options:**

- ``None`` (default): Use Redis default stopwords (~300 common words)
- ``[]`` (empty list): Disable stopwords completely (``STOPWORDS 0``)
- Custom list: Specify your own stopwords (e.g., ``["the", "a", "an"]``)

**Example:**

.. code-block:: python

from redisvl.schema import IndexSchema

# Disable stopwords to search for phrases like "Bank of Glasberliner"
schema = IndexSchema.from_dict({
"index": {
"name": "company-idx",
"prefix": "company",
"stopwords": [] # STOPWORDS 0
},
"fields": [
{"name": "name", "type": "text"}
]
})

**Important Notes:**

- Index-level stopwords affect what gets indexed (server-side)
- Query-time stopwords (in :class:`TextQuery` and :class:`AggregateHybridQuery`) affect what gets searched (client-side)
- Using query-time stopwords with index-level ``STOPWORDS 0`` is counterproductive

For detailed information about stopwords configuration and best practices, see the
Advanced Queries user guide (``docs/user_guide/11_advanced_queries.ipynb``).


Defining Fields
===============

Expand Down
Loading