milvus/internal/util/reduce/reduce_info.go
Chun Han e480b103bd
feat: supporing hybrid search group_by (#35982)
related: #35096

Signed-off-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: MrPresent-Han <chun.han@gmail.com>
2024-09-08 17:09:04 +08:00

93 lines
1.6 KiB
Go

package reduce
import (
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
)
type ResultInfo struct {
nq int64
topK int64
metricType string
pkType schemapb.DataType
offset int64
groupByFieldId int64
groupSize int64
isAdvance bool
}
func NewReduceSearchResultInfo(
nq int64,
topK int64,
) *ResultInfo {
return &ResultInfo{
nq: nq,
topK: topK,
}
}
func (r *ResultInfo) WithMetricType(metricType string) *ResultInfo {
r.metricType = metricType
return r
}
func (r *ResultInfo) WithPkType(pkType schemapb.DataType) *ResultInfo {
r.pkType = pkType
return r
}
func (r *ResultInfo) WithOffset(offset int64) *ResultInfo {
r.offset = offset
return r
}
func (r *ResultInfo) WithGroupByField(groupByField int64) *ResultInfo {
r.groupByFieldId = groupByField
return r
}
func (r *ResultInfo) WithGroupSize(groupSize int64) *ResultInfo {
r.groupSize = groupSize
return r
}
func (r *ResultInfo) WithAdvance(advance bool) *ResultInfo {
r.isAdvance = advance
return r
}
func (r *ResultInfo) GetNq() int64 {
return r.nq
}
func (r *ResultInfo) GetTopK() int64 {
return r.topK
}
func (r *ResultInfo) GetMetricType() string {
return r.metricType
}
func (r *ResultInfo) GetPkType() schemapb.DataType {
return r.pkType
}
func (r *ResultInfo) GetOffset() int64 {
return r.offset
}
func (r *ResultInfo) GetGroupByFieldId() int64 {
return r.groupByFieldId
}
func (r *ResultInfo) GetGroupSize() int64 {
return r.groupSize
}
func (r *ResultInfo) GetIsAdvance() bool {
return r.isAdvance
}
func (r *ResultInfo) SetMetricType(metricType string) {
r.metricType = metricType
}