fix: preserve search aggregation group-by metadata (#50176)

issue: #49840

## Summary
- Preserve plural group-by field IDs when shallow-copying search
requests for query nodes.
- Add regression coverage for SearchRequest shallow-copy metadata
propagation.
- Re-enable the growing-segment search aggregation E2E case.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chun Han
2026-06-01 19:40:15 +08:00
committed by GitHub
co-authored by MrPresent-Han Claude Opus 4.7
parent 4fa49058c1
commit 99cf5e8d48
3 changed files with 3 additions and 4 deletions
+1
View File
@@ -45,6 +45,7 @@ func ShallowCopySearchRequest(src *internalpb.SearchRequest, targetID int64) *in
EntityTtlPhysicalTime: src.EntityTtlPhysicalTime,
PkFilter: src.PkFilter,
SearchType: src.SearchType,
GroupByFieldIds: src.GroupByFieldIds,
}
}
@@ -34,6 +34,7 @@ func TestShallowCopySearchRequest(t *testing.T) {
IsAdvanced: true,
Offset: 5,
GroupByFieldId: 7,
GroupByFieldIds: []int64{7, 9},
GroupSize: 3,
FieldId: 8,
IsTopkReduce: true,
@@ -64,6 +65,7 @@ func TestShallowCopySearchRequest(t *testing.T) {
assert.Equal(t, src.PartitionIDs, dst.PartitionIDs)
assert.Equal(t, src.PlaceholderGroup, dst.PlaceholderGroup)
assert.Equal(t, src.SerializedExprPlan, dst.SerializedExprPlan)
assert.Equal(t, src.GroupByFieldIds, dst.GroupByFieldIds)
})
}
@@ -1333,10 +1333,6 @@ class TestSearchAggregationIndependent(TestMilvusClientV2Base):
)
@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.xfail(
reason="Milvus issue #49840: search_aggregation fails on growing segment",
strict=True,
)
def test_search_aggregation_on_growing_segment(self):
"""
target: verify search_aggregation works on growing segment results.