Skip to content

Commit

Permalink
supporing hybrid search group_by(#35982)
Browse files Browse the repository at this point in the history
Signed-off-by: MrPresent-Han <chun.han@gmail.com>
  • Loading branch information
MrPresent-Han committed Sep 6, 2024
1 parent 5247631 commit 4b86fe6
Show file tree
Hide file tree
Showing 20 changed files with 982 additions and 331 deletions.
4 changes: 3 additions & 1 deletion internal/core/src/query/SearchOnSealed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ SearchOnSealedIndex(const Schema& schema,
auto field_indexing = record.get_field_indexing(field_id);
AssertInfo(field_indexing->metric_type_ == search_info.metric_type_,
"Metric type of field index isn't the same with search info,"
"field index: {}, search info: {}", field_indexing->metric_type_, search_info.metric_type_);
"field index: {}, search info: {}",
field_indexing->metric_type_,
search_info.metric_type_);

auto dataset = knowhere::GenDataSet(num_queries, dim, query_data);
dataset->SetIsSparse(is_sparse);
Expand Down
4 changes: 2 additions & 2 deletions internal/datacoord/index_meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ func TestMeta_ScalarAutoIndex(t *testing.T) {
{
Key: common.IndexTypeKey,
Value: "HYBRID",
}},
},
},
Timestamp: 0,
IsAutoIndex: true,
UserIndexParams: userIndexParams,
Expand Down Expand Up @@ -205,7 +206,6 @@ func TestMeta_ScalarAutoIndex(t *testing.T) {
assert.Equal(t, newIndexParams[0].Key, common.IndexTypeKey)
assert.Equal(t, newIndexParams[0].Value, "INVERTED")
})

}

func TestMeta_CanCreateIndex(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/datacoord/task_scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ func (s *taskSchedulerSuite) scheduler(handler Handler) {
return nil
})
catalog.EXPECT().AlterSegmentIndexes(mock.Anything, mock.Anything).Return(nil)
//catalog.EXPECT().SaveStatsTask(mock.Anything, mock.Anything).Return(nil)
// catalog.EXPECT().SaveStatsTask(mock.Anything, mock.Anything).Return(nil)

in := mocks.NewMockIndexNodeClient(s.T())
in.EXPECT().CreateJobV2(mock.Anything, mock.Anything).Return(merr.Success(), nil)
Expand Down
2 changes: 1 addition & 1 deletion internal/datanode/compaction/merge_sort.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func mergeSortMultipleSegments(ctx context.Context,
return nil, err
}

//SegmentDeserializeReaderTest(binlogPaths, t.binlogIO, writer.GetPkID())
// SegmentDeserializeReaderTest(binlogPaths, t.binlogIO, writer.GetPkID())
segmentReaders := make([]*SegmentDeserializeReader, len(binlogs))
for i, s := range binlogs {
var binlogBatchCount int
Expand Down
1 change: 0 additions & 1 deletion internal/datanode/compaction/priority_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func (s *PriorityQueueSuite) PriorityQueueMergeSort() {
heap.Push(&pq, next)
}
}

}

func TestNewPriorityQueueSuite(t *testing.T) {
Expand Down
10 changes: 4 additions & 6 deletions internal/proto/internal.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,8 @@ message SubSearchRequest {
int64 topk = 7;
int64 offset = 8;
string metricType = 9;
}

message ExtraSearchParam {
int64 group_by_field_id = 1;
int64 group_size = 2;
int64 group_by_field_id = 10;
int64 group_size = 11;
}

message SearchRequest {
Expand All @@ -125,7 +122,8 @@ message SearchRequest {
bool is_advanced = 20;
int64 offset = 21;
common.ConsistencyLevel consistency_level = 22;
ExtraSearchParam extra_search_param = 23;
int64 group_by_field_id = 23;
int64 group_size = 24;
}

message SubSearchResults {
Expand Down
Loading

0 comments on commit 4b86fe6

Please sign in to comment.