Skip to content

Conversation

@justin-cechmanek
Copy link
Collaborator

This PR adds the ability to individually increase or decrease the score contribution of specific words when performing a scored text matching query.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the ability to assign individual importance weights to specific words in text queries for both TextQuery and HybridQuery classes. This allows users to increase or decrease the score contribution of particular words during scored text matching.

  • Adds text_weights parameter to TextQuery and HybridQuery constructors
  • Implements set_text_weights() method and text_weights property for both query types
  • Adds validation to ensure weights are positive numbers and applied to individual words only

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/test_query_types.py Adds unit tests for text weight validation and query string generation in TextQuery, removes duplicate stopwords test code
tests/unit/test_aggregation_types.py Adds unit tests for text weight validation and query string generation in HybridQuery
tests/integration/test_query.py Adds integration tests verifying text weights affect scoring and result ordering for TextQuery
tests/integration/test_aggregation.py Adds integration tests verifying text weights affect scoring and result ordering for HybridQuery
redisvl/query/query.py Implements text weights feature in TextQuery including parameter, validation, and query string generation
redisvl/query/aggregate.py Implements text weights feature in HybridQuery including parameter, validation, and query string generation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@justin-cechmanek justin-cechmanek requested review from hanchoong-redis and nkanu17 and removed request for Copilot October 22, 2025 22:19
Copy link
Collaborator

@bsbodden bsbodden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, the only minor thing is the duplication of _parse_text_weights()

@justin-cechmanek justin-cechmanek merged commit c72460c into main Oct 27, 2025
63 of 64 checks passed
@justin-cechmanek justin-cechmanek deleted the feat/RAAE-1082/text-weights branch October 27, 2025 21:43
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

Successfully merging this pull request may close these issues.

3 participants