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 5, 2024
1 parent 6eb8b3f commit 3249e4d
Show file tree
Hide file tree
Showing 20 changed files with 929 additions and 312 deletions.
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
4 changes: 2 additions & 2 deletions internal/datanode/compaction/priority_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"container/heap"
"testing"

"github.com/milvus-io/milvus/internal/storage"
"github.com/stretchr/testify/suite"

"github.com/milvus-io/milvus/internal/storage"
)

type PriorityQueueSuite struct {
Expand Down Expand Up @@ -118,7 +119,6 @@ func (s *PriorityQueueSuite) PriorityQueueMergeSort() {
heap.Push(&pq, next)
}
}

}

func TestNewPriorityQueueSuite(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/datanode/compaction/segment_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"context"
"math"

"github.com/samber/lo"
"go.uber.org/atomic"
"go.uber.org/zap"

Expand All @@ -21,7 +22,6 @@ import (
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/util/paramtable"
"github.com/milvus-io/milvus/pkg/util/typeutil"
"github.com/samber/lo"
)

// Not concurrent safe.
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 3249e4d

Please sign in to comment.