MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / GetFactoryCreateSpecFromSpec

Function GetFactoryCreateSpecFromSpec

tok/tok.go:189–200  ·  view source on GitHub ↗
(spec *pb.VectorIndexSpec)

Source from the content-addressed store, hash-verified

187}
188
189func GetFactoryCreateSpecFromSpec(spec *pb.VectorIndexSpec) (*FactoryCreateSpec, error) {
190 factory, found := GetIndexFactoryFromSpec(spec)
191 if !found {
192 return &FactoryCreateSpec{}, errors.Errorf(
193 "cannot find index factory named '%s'", spec.Name)
194 }
195 opts, err := getOptsFromFactorySpec(factory, spec)
196 if err != nil {
197 return &FactoryCreateSpec{}, err
198 }
199 return &FactoryCreateSpec{factory: factory, opts: opts}, nil
200}
201
202func GetIndexFactoryFromSpec(spec *pb.VectorIndexSpec) (IndexFactory, bool) {
203 return GetIndexFactory(spec.Name)

Callers 5

getOrCreateIndexerMethod · 0.92
needsTokIndexRebuildMethod · 0.92
rebuildTokIndexFunction · 0.92
FactoryCreateSpecMethod · 0.92

Calls 3

GetIndexFactoryFromSpecFunction · 0.85
getOptsFromFactorySpecFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected