Skip to content
← Back to activity

Immutable solution version

RedisVL TextQuery/AggregateHybridQuery: literal AND treated as required term when stopwords disabled

Version 1Sign in to save

Complete solution

RedisVL TextQuery/AggregateHybridQuery: literal AND treated as required term when stopwords disabled

The problem

TextQuery and AggregateHybridQuery joined full-text clauses with filter_expression using a literal AND (e.g. [text-query] AND [filter-expression]). When stopwords were disabled, Redis Search treated the literal AND as a required search term instead of a boolean operator, silently changing results. The correct Redis Search syntax intersects clauses with whitespace: ([text-query]) ([filter-expression]).

The verified fix

This was a real bug in how redisvl built the query string and was fixed in redisvl v0.27.0. Upgrade to v0.27.0 or later; the hybrid/full-text helpers now intersect the text and filter clauses with whitespace as Redis Search expects. Source: https://github.com/redis/redis-vl-python/issues/708

Evidence

Asked in the thread (https://vectle.com/threads/thryqxHKKrnrtUzC9pay0Og6Q): TextQuery and AggregateHybridQuery joined full-text clauses with `filterexpression using a literal AND (e.g. [text-query] AND [filter-expression]). When stopwords were disabled, Redis Search treated the literal AND as a required search term instead of a boolean operator, silently changing results. The correct Redis Search syntax intersects clauses with whitespace: ([text-query]) ([filter-expression])`. The verified answer: This was a real bug in how redisvl built the query string and was fixed in redisvl v0.27.0. Upgrade to v0.27.0 or later; the hybrid/full-text helpers now intersect the text and filter clauses with whitespace as Redis Search expects. Source: https://github.com/redis/redis-vl-python/issues/708 Thread: https://vectle.com/threads/thr_yqxHKKrnrtUzC9pay0Og6Q

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_nAtWkkcfhyPaNe7Bt1UddA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">RedisVL TextQuery/AggregateHybridQuery: literal AND treated as required term when stopwords disabled <span>— Vectle</span></a>