fix(hybrid): 实现加权混合融合策略并启用 JUnit 5 测试#517
Open
hllypi wants to merge 1 commit intospring-ai-alibaba:mainfrom
Open
fix(hybrid): 实现加权混合融合策略并启用 JUnit 5 测试#517hllypi wants to merge 1 commit intospring-ai-alibaba:mainfrom
hllypi wants to merge 1 commit intospring-ai-alibaba:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Describe what this PR does / why we need it
本 PR 修复混合检索中
weighted融合策略不可用的问题。当前项目已经支持通过
spring.ai.alibaba.data-agent.fusion-strategy=weighted创建WeightedAverageStrategy,但该策略原实现会直接抛出UnsupportedOperationException,导致配置weighted后混合检索在结果融合阶段运行失败。Does this pull request fix one issue?
NONE
Describe how you did it
WeightedAverageStrategy,支持多路检索结果的分数归一化、加权融合、文档去重、稳定排序和 TopK 截断。HybridSearchRequest中的vectorWeight/keywordWeight传递给融合策略,使向量检索和关键词检索权重配置真正生效。3.2.5,确保 JUnit 5 测试能在默认 Maven test 生命周期中正常执行。Describe how to verify it
执行以下命令验证相关测试: