Documentation ¶
Index ¶
- Constants
- Variables
- func Auth(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func Cost(name string, t time.Time)
- func DocToContent(dh []*vearchpb.ResultItem, head *vearchpb.RequestHead, space *entity.Space) ([]byte, error)
- func ExportDocumentHandler(httpServer *netutil.Server, client *client.Client)
- func ExportRpcHandler(rpcServer *grpc.Server, client *client.Client)
- func FlushToContent(shards *vearchpb.SearchStatus) ([]byte, error)
- func ForceMergeToContent(shards *vearchpb.SearchStatus) ([]byte, error)
- func GetVectorFieldValue(doc *vearchpb.Document, space *entity.Space) (floatFeatureMap map[string][]float32, binaryFeatureMap map[string][]int32, ...)
- func MakeQueryFeature(floatFeatureMap map[string][]float32, binaryFeatureMap map[string][]int32) ([]byte, error)
- func MapDocument(source []byte, retrievalType string, proMap map[string]*entity.SpaceProperties) ([]*vearchpb.Field, error)
- func NewMasterService(client *client.Client) (*masterService, error)
- func SearchNullToContent(searchStatus vearchpb.SearchStatus, took time.Duration) ([]byte, error)
- func ToContent(sr *vearchpb.SearchResult, head *vearchpb.RequestHead, took time.Duration, ...) ([]byte, error)
- func ToContentIds(srs []*vearchpb.SearchResult, space *entity.Space) ([]byte, error)
- func ToContentMapBinaryFeature(space *entity.Space, items []*vearchpb.Item) map[string][]int32
- func ToContentMapFloatFeature(space *entity.Space, items []*vearchpb.Item) map[string][]float32
- func ToContents(srs []*vearchpb.SearchResult, head *vearchpb.RequestHead, took time.Duration, ...) ([]byte, error)
- type DocumentHandler
- type MasterClusterAPI
- func (mApi *MasterClusterAPI) Auth(ctx context.Context, w http.ResponseWriter, r *http.Request, ...) (context.Context, bool)
- func (mApi *MasterClusterAPI) ChangeMember(ctx context.Context, w http.ResponseWriter, r *http.Request, ...) (context.Context, bool)
- func (mApi *MasterClusterAPI) ChangeReplicas(ctx context.Context, w http.ResponseWriter, r *http.Request, ...) (context.Context, bool)
- func (mApi *MasterClusterAPI) FailServerClear(ctx context.Context, w http.ResponseWriter, r *http.Request, ...) (context.Context, bool)
- func (mApi *MasterClusterAPI) FailServerList(ctx context.Context, w http.ResponseWriter, r *http.Request, ...) (context.Context, bool)
- func (mApi *MasterClusterAPI) RecoverFailServer(ctx context.Context, w http.ResponseWriter, r *http.Request, ...) (context.Context, bool)
- func (mApi *MasterClusterAPI) RemoveServerMeta(ctx context.Context, w http.ResponseWriter, r *http.Request, ...) (context.Context, bool)
- type MasterMonitorAPI
- type Request
- type RpcHandler
- func (handler *RpcHandler) Add(ctx context.Context, req *vearchpb.AddRequest) (reply *vearchpb.AddResponse, err error)
- func (handler *RpcHandler) Bulk(ctx context.Context, req *vearchpb.BulkRequest) (reply *vearchpb.BulkResponse, err error)
- func (handler *RpcHandler) Delete(ctx context.Context, req *vearchpb.DeleteRequest) (reply *vearchpb.DeleteResponse, err error)
- func (handler *RpcHandler) Get(ctx context.Context, req *vearchpb.GetRequest) (reply *vearchpb.GetResponse, err error)
- func (handler *RpcHandler) MSearch(ctx context.Context, req *vearchpb.MSearchRequest) (reply *vearchpb.SearchResponse, err error)
- func (handler *RpcHandler) Search(ctx context.Context, req *vearchpb.SearchRequest) (reply *vearchpb.SearchResponse, err error)
- func (handler *RpcHandler) SearchByID(ctx context.Context, req *vearchpb.SearchRequest) (reply *vearchpb.SearchResponse, err error)
- func (handler *RpcHandler) Space(ctx context.Context, req *vearchpb.RequestHead) (reply *vearchpb.Table, err error)
- func (handler *RpcHandler) Update(ctx context.Context, req *vearchpb.UpdateRequest) (reply *vearchpb.UpdateResponse, err error)
- type VectorQuery
Constants ¶
View Source
const ( URLParamDbName = "db_name" URLParamSpaceName = "space_name" URLParamID = "_id" URLParams = "url_params" ReqsBody = "req_body" SpaceEntity = "space_entity" IDType = "id_type" IDIsLong = "IDIsLong" QueryIsOnlyID = "QueryIsOnlyID" URLQueryTimeout = "timeout" )
View Source
const ( // key index field IndexField = "_index" UIDField = "_uid" TypeField = "_type" IDField = "_id" SourceField = "_source" SizeField = "_size" AllField = "_all" FieldNamesField = "_field_names" IgnoredField = "_ignored" RoutingField = "_routing" MetaField = "_meta" )
View Source
const ( URLQueryFrom = "from" URLQuerySize = "size" UrlQueryRouting = "routing" UrlQueryTypedKey = "typed_keys" UrlQueryVersion = "version" UrlQueryRetryOnConflict = "retry_on_conflict" UrlQueryOpType = "op_type" UrlQueryRefresh = "refresh" UrlQueryURISort = "sort" UrlQueryTimeout = "timeout" ClientTypeValue = "client_type" DefaultSzie = 50 URLQueryRefresh = "refresh" )
View Source
const ( DB = "db" NodeID = "node_id" )
Variables ¶
View Source
var FieldsIndex = map[string]int{ IndexField: 1, UIDField: 2, TypeField: 3, IDField: 4, SourceField: 5, SizeField: 6, AllField: 7, FieldNamesField: 8, IgnoredField: 9, RoutingField: 10, MetaField: 11, }
fields index map
Functions ¶
func DocToContent ¶
func DocToContent(dh []*vearchpb.ResultItem, head *vearchpb.RequestHead, space *entity.Space) ([]byte, error)
func ExportDocumentHandler ¶
func FlushToContent ¶
func FlushToContent(shards *vearchpb.SearchStatus) ([]byte, error)
func ForceMergeToContent ¶
func ForceMergeToContent(shards *vearchpb.SearchStatus) ([]byte, error)
func GetVectorFieldValue ¶
func MakeQueryFeature ¶
func MapDocument ¶
func MapDocument(source []byte, retrievalType string, proMap map[string]*entity.SpaceProperties) ([]*vearchpb.Field, error)
parse doc
func NewMasterService ¶
func SearchNullToContent ¶
func ToContent ¶
func ToContent(sr *vearchpb.SearchResult, head *vearchpb.RequestHead, took time.Duration, space *entity.Space) ([]byte, error)
func ToContentIds ¶
func ToContents ¶
func ToContents(srs []*vearchpb.SearchResult, head *vearchpb.RequestHead, took time.Duration, space *entity.Space) ([]byte, error)
Types ¶
type DocumentHandler ¶
type DocumentHandler struct {
// contains filtered or unexported fields
}
func (*DocumentHandler) ExportToServer ¶
func (handler *DocumentHandler) ExportToServer() error
func (*DocumentHandler) GorillaExport ¶
func (handler *DocumentHandler) GorillaExport(masterService *masterService) error
func (*DocumentHandler) GorillaExportMonitor ¶
func (handler *DocumentHandler) GorillaExportMonitor(monitorService *monitorService) error
export monitor API by gorilla
type MasterClusterAPI ¶
type MasterClusterAPI struct { Dh *vearchhttp.BaseHandler // contains filtered or unexported fields }
func (*MasterClusterAPI) ChangeMember ¶
func (*MasterClusterAPI) ChangeReplicas ¶
func (mApi *MasterClusterAPI) ChangeReplicas(ctx context.Context, w http.ResponseWriter, r *http.Request, params netutil.UriParams) (context.Context, bool)
change replicas by dbname and spaceName
func (*MasterClusterAPI) FailServerClear ¶
func (mApi *MasterClusterAPI) FailServerClear(ctx context.Context, w http.ResponseWriter, r *http.Request, params netutil.UriParams) (context.Context, bool)
FailServerClear : clear fail server by nodeID
func (*MasterClusterAPI) FailServerList ¶
func (mApi *MasterClusterAPI) FailServerList(ctx context.Context, w http.ResponseWriter, r *http.Request, params netutil.UriParams) (context.Context, bool)
FailServerList : list fail servers
func (*MasterClusterAPI) RecoverFailServer ¶
func (mApi *MasterClusterAPI) RecoverFailServer(ctx context.Context, w http.ResponseWriter, r *http.Request, params netutil.UriParams) (context.Context, bool)
recover the failserver by a newserver
func (*MasterClusterAPI) RemoveServerMeta ¶
func (mApi *MasterClusterAPI) RemoveServerMeta(ctx context.Context, w http.ResponseWriter, r *http.Request, params netutil.UriParams) (context.Context, bool)
RemoveServerMeta : remove etcd meta about the nodeID
type MasterMonitorAPI ¶
type MasterMonitorAPI struct {
// contains filtered or unexported fields
}
export monitor
type Request ¶
type Request interface {
GetHead() *vearchpb.RequestHead
}
type RpcHandler ¶
type RpcHandler struct {
// contains filtered or unexported fields
}
func (*RpcHandler) Add ¶
func (handler *RpcHandler) Add(ctx context.Context, req *vearchpb.AddRequest) (reply *vearchpb.AddResponse, err error)
func (*RpcHandler) Bulk ¶
func (handler *RpcHandler) Bulk(ctx context.Context, req *vearchpb.BulkRequest) (reply *vearchpb.BulkResponse, err error)
func (*RpcHandler) Delete ¶
func (handler *RpcHandler) Delete(ctx context.Context, req *vearchpb.DeleteRequest) (reply *vearchpb.DeleteResponse, err error)
func (*RpcHandler) Get ¶
func (handler *RpcHandler) Get(ctx context.Context, req *vearchpb.GetRequest) (reply *vearchpb.GetResponse, err error)
func (*RpcHandler) MSearch ¶
func (handler *RpcHandler) MSearch(ctx context.Context, req *vearchpb.MSearchRequest) (reply *vearchpb.SearchResponse, err error)
func (*RpcHandler) Search ¶
func (handler *RpcHandler) Search(ctx context.Context, req *vearchpb.SearchRequest) (reply *vearchpb.SearchResponse, err error)
func (*RpcHandler) SearchByID ¶
func (handler *RpcHandler) SearchByID(ctx context.Context, req *vearchpb.SearchRequest) (reply *vearchpb.SearchResponse, err error)
func (*RpcHandler) Space ¶
func (handler *RpcHandler) Space(ctx context.Context, req *vearchpb.RequestHead) (reply *vearchpb.Table, err error)
func (*RpcHandler) Update ¶
func (handler *RpcHandler) Update(ctx context.Context, req *vearchpb.UpdateRequest) (reply *vearchpb.UpdateResponse, err error)
type VectorQuery ¶
type VectorQuery struct { Field string `json:"field"` FeatureData json.RawMessage `json:"feature"` Feature []float32 `json:"-"` FeatureUint8 []uint8 `json:"-"` Symbol string `json:"symbol"` Value *float64 `json:"value"` Boost *float64 `json:"boost"` Format *string `json:"format,omitempty"` MinScore *float64 `json:"min_score,omitempty"` MaxScore *float64 `json:"max_score,omitempty"` RetrievalType string `json:"retrieval_type"` }
func (*VectorQuery) ToC ¶
func (query *VectorQuery) ToC(retrievalType string) (*vearchpb.VectorQuery, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.