index.go 862 字节
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

F
FluorineDog 已提交
9 10
#include "segcore/collection_c.h"
#include "segcore/segment_c.h"
Z
zhenshan.cao 已提交
11 12 13 14

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

type IndexConfig struct{}

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

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

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