index.go 871 字节
Newer Older
Z
zhenshan.cao 已提交
1 2 3 4
package reader

/*

5
#cgo CFLAGS: -I../core/output/include
Z
zhenshan.cao 已提交
6

G
GuoRentong 已提交
7
#cgo LDFLAGS: -L../core/output/lib -lmilvus_segcore -Wl,-rpath=../core/output/lib
Z
zhenshan.cao 已提交
8 9 10 11 12 13 14 15

#include "collection_c.h"
#include "partition_c.h"
#include "segment_c.h"

*/
import "C"
import (
16
	"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
Z
zhenshan.cao 已提交
17 18 19 20
)

type IndexConfig struct{}

F
FluorineDog 已提交
21
func (s *Segment) buildIndex(collection *Collection) commonpb.Status {
B
bigsheeper 已提交
22
	/*
F
FluorineDog 已提交
23 24
		int
		BuildIndex(CCollection c_collection, CSegmentBase c_segment);
Z
zhenshan.cao 已提交
25
	*/
B
bigsheeper 已提交
26
	var status = C.BuildIndex(collection.CollectionPtr, s.SegmentPtr)
Z
zhenshan.cao 已提交
27
	if status != 0 {
28
		return commonpb.Status{ErrorCode: commonpb.ErrorCode_BUILD_INDEX_ERROR}
Z
zhenshan.cao 已提交
29
	}
30
	return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}
Z
zhenshan.cao 已提交
31 32
}

33
func (s *Segment) dropIndex(fieldName string) commonpb.Status {
Z
zhenshan.cao 已提交
34 35
	// WARN: Not support yet

36
	return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}
Z
zhenshan.cao 已提交
37
}