@@ -88,11 +88,11 @@ func WithNamespace(namespace string) NamespaceOption {
8888
8989func UpsertBatch (collection string , keys []string , texts []string , labelsArr [][]string , opts ... NamespaceOption ) (* CollectionMutationResult , error ) {
9090 if collection == "" {
91- return nil , fmt .Errorf ("Collection name is required" )
91+ return nil , fmt .Errorf ("collection name is required" )
9292 }
9393
9494 if len (texts ) == 0 {
95- return nil , fmt .Errorf ("Texts is empty" )
95+ return nil , fmt .Errorf ("texts is empty" )
9696 }
9797
9898 nsOpts := & NamespaceOptions {
@@ -114,15 +114,15 @@ func UpsertBatch(collection string, keys []string, texts []string, labelsArr [][
114114 result := hostUpsert (& collection , & nsOpts .namespace , & keys , & texts , & labelsArr )
115115
116116 if result == nil {
117- return nil , fmt .Errorf ("Failed to upsert" )
117+ return nil , fmt .Errorf ("failed to upsert" )
118118 }
119119
120120 return result , nil
121121}
122122
123123func Upsert (collection string , key * string , text string , labels []string , opts ... NamespaceOption ) (* CollectionMutationResult , error ) {
124124 if collection == "" {
125- return nil , fmt .Errorf ("Collection name is required" )
125+ return nil , fmt .Errorf ("collection name is required" )
126126 }
127127
128128 keyArr := []string {}
@@ -138,7 +138,7 @@ func Upsert(collection string, key *string, text string, labels []string, opts .
138138 }
139139
140140 if text == "" {
141- return nil , fmt .Errorf ("Text is required" )
141+ return nil , fmt .Errorf ("text is required" )
142142 }
143143
144144 nsOpts := & NamespaceOptions {
@@ -152,19 +152,19 @@ func Upsert(collection string, key *string, text string, labels []string, opts .
152152 result := hostUpsert (& collection , & nsOpts .namespace , & keyArr , & []string {text }, & labelsArr )
153153
154154 if result == nil {
155- return nil , fmt .Errorf ("Failed to upsert" )
155+ return nil , fmt .Errorf ("failed to upsert" )
156156 }
157157
158158 return result , nil
159159}
160160
161161func Remove (collection , key string , opts ... NamespaceOption ) (* CollectionMutationResult , error ) {
162162 if collection == "" {
163- return nil , fmt .Errorf ("Collection name is required" )
163+ return nil , fmt .Errorf ("collection name is required" )
164164 }
165165
166166 if key == "" {
167- return nil , fmt .Errorf ("Key is required" )
167+ return nil , fmt .Errorf ("key is required" )
168168 }
169169
170170 nsOpts := & NamespaceOptions {
@@ -178,7 +178,7 @@ func Remove(collection, key string, opts ...NamespaceOption) (*CollectionMutatio
178178 result := hostDelete (& collection , & nsOpts .namespace , & key )
179179
180180 if result == nil {
181- return nil , fmt .Errorf ("Failed to delete" )
181+ return nil , fmt .Errorf ("failed to delete" )
182182 }
183183
184184 return result , nil
@@ -212,15 +212,15 @@ func WithReturnText(returnText bool) SearchOption {
212212
213213func Search (collection , searchMethod , text string , opts ... SearchOption ) (* CollectionSearchResult , error ) {
214214 if collection == "" {
215- return nil , fmt .Errorf ("Collection name is required" )
215+ return nil , fmt .Errorf ("collection name is required" )
216216 }
217217
218218 if searchMethod == "" {
219- return nil , fmt .Errorf ("Search method is required" )
219+ return nil , fmt .Errorf ("search method is required" )
220220 }
221221
222222 if text == "" {
223- return nil , fmt .Errorf ("Text is required" )
223+ return nil , fmt .Errorf ("text is required" )
224224 }
225225
226226 sOpts := & SearchOptions {
@@ -236,29 +236,29 @@ func Search(collection, searchMethod, text string, opts ...SearchOption) (*Colle
236236 result := hostSearch (& collection , & sOpts .namespaces , & searchMethod , & text , int32 (sOpts .limit ), sOpts .returnText )
237237
238238 if result == nil {
239- return nil , fmt .Errorf ("Failed to search" )
239+ return nil , fmt .Errorf ("failed to search" )
240240 }
241241
242242 return result , nil
243243}
244244
245245func SearchByVector (collection , searchMethod string , vector []float32 , opts ... SearchOption ) (* CollectionSearchResult , error ) {
246246 if collection == "" {
247- return nil , fmt .Errorf ("Collection name is required" )
247+ return nil , fmt .Errorf ("collection name is required" )
248248 }
249249
250250 if searchMethod == "" {
251- return nil , fmt .Errorf ("Search method is required" )
251+ return nil , fmt .Errorf ("search method is required" )
252252 }
253253
254254 if len (vector ) == 0 {
255255 return & CollectionSearchResult {
256256 Collection : collection ,
257257 Status : Error ,
258- Error : "Vector is required" ,
258+ Error : "vector is required" ,
259259 SearchMethod : "" ,
260260 Objects : nil ,
261- }, fmt .Errorf ("Vector is required" )
261+ }, fmt .Errorf ("vector is required" )
262262 }
263263
264264 sOpts := & SearchOptions {
@@ -274,23 +274,23 @@ func SearchByVector(collection, searchMethod string, vector []float32, opts ...S
274274 result := hostSearchByVector (& collection , & sOpts .namespaces , & searchMethod , & vector , int32 (sOpts .limit ), sOpts .returnText )
275275
276276 if result == nil {
277- return nil , fmt .Errorf ("Failed to search" )
277+ return nil , fmt .Errorf ("failed to search" )
278278 }
279279
280280 return result , nil
281281}
282282
283283func NnClassify (collection , searchMethod , text string , opts ... NamespaceOption ) (* CollectionClassificationResult , error ) {
284284 if collection == "" {
285- return nil , fmt .Errorf ("Collection name is required" )
285+ return nil , fmt .Errorf ("collection name is required" )
286286 }
287287
288288 if searchMethod == "" {
289- return nil , fmt .Errorf ("Search method is required" )
289+ return nil , fmt .Errorf ("search method is required" )
290290 }
291291
292292 if text == "" {
293- return nil , fmt .Errorf ("Text is required" )
293+ return nil , fmt .Errorf ("text is required" )
294294 }
295295
296296 nsOpts := & NamespaceOptions {
@@ -304,19 +304,19 @@ func NnClassify(collection, searchMethod, text string, opts ...NamespaceOption)
304304 result := hostClassifyText (& collection , & nsOpts .namespace , & searchMethod , & text )
305305
306306 if result == nil {
307- return nil , fmt .Errorf ("Failed to classify" )
307+ return nil , fmt .Errorf ("failed to classify" )
308308 }
309309
310310 return result , nil
311311}
312312
313313func RecomputeSearchMethod (collection , searchMethod string , opts ... NamespaceOption ) (* SearchMethodMutationResult , error ) {
314314 if collection == "" {
315- return nil , fmt .Errorf ("Collection name is required" )
315+ return nil , fmt .Errorf ("collection name is required" )
316316 }
317317
318318 if searchMethod == "" {
319- return nil , fmt .Errorf ("Search method is required" )
319+ return nil , fmt .Errorf ("search method is required" )
320320 }
321321
322322 nsOpts := & NamespaceOptions {
@@ -330,27 +330,27 @@ func RecomputeSearchMethod(collection, searchMethod string, opts ...NamespaceOpt
330330 result := hostRecomputeIndex (& collection , & nsOpts .namespace , & searchMethod )
331331
332332 if result == nil {
333- return nil , fmt .Errorf ("Failed to recompute" )
333+ return nil , fmt .Errorf ("failed to recompute" )
334334 }
335335
336336 return result , nil
337337}
338338
339339func ComputeDistance (collection , searchMethod , key1 , key2 string , opts ... NamespaceOption ) (* CollectionSearchResultObject , error ) {
340340 if collection == "" {
341- return nil , fmt .Errorf ("Collection name is required" )
341+ return nil , fmt .Errorf ("collection name is required" )
342342 }
343343
344344 if searchMethod == "" {
345- return nil , fmt .Errorf ("Search method is required" )
345+ return nil , fmt .Errorf ("search method is required" )
346346 }
347347
348348 if key1 == "" {
349- return nil , fmt .Errorf ("Key1 is required" )
349+ return nil , fmt .Errorf ("key1 is required" )
350350 }
351351
352352 if key2 == "" {
353- return nil , fmt .Errorf ("Key2 is required" )
353+ return nil , fmt .Errorf ("key2 is required" )
354354 }
355355
356356 nsOpts := & NamespaceOptions {
@@ -364,19 +364,19 @@ func ComputeDistance(collection, searchMethod, key1, key2 string, opts ...Namesp
364364 result := hostComputeDistance (& collection , & nsOpts .namespace , & searchMethod , & key1 , & key2 )
365365
366366 if result == nil {
367- return nil , fmt .Errorf ("Failed to compute distance" )
367+ return nil , fmt .Errorf ("failed to compute distance" )
368368 }
369369
370370 return result , nil
371371}
372372
373373func GetText (collection , key string , opts ... NamespaceOption ) (string , error ) {
374374 if collection == "" {
375- return "" , fmt .Errorf ("Collection name is required" )
375+ return "" , fmt .Errorf ("collection name is required" )
376376 }
377377
378378 if key == "" {
379- return "" , fmt .Errorf ("Key is required" )
379+ return "" , fmt .Errorf ("key is required" )
380380 }
381381
382382 nsOpts := & NamespaceOptions {
@@ -390,15 +390,15 @@ func GetText(collection, key string, opts ...NamespaceOption) (string, error) {
390390 result := hostGetText (& collection , & nsOpts .namespace , & key )
391391
392392 if result == nil {
393- return "" , fmt .Errorf ("Failed to get text for key" )
393+ return "" , fmt .Errorf ("failed to get text for key" )
394394 }
395395
396396 return * result , nil
397397}
398398
399399func GetTexts (collection string , opts ... NamespaceOption ) (map [string ]string , error ) {
400400 if collection == "" {
401- return nil , fmt .Errorf ("Collection name is required" )
401+ return nil , fmt .Errorf ("collection name is required" )
402402 }
403403
404404 nsOpts := & NamespaceOptions {
@@ -412,37 +412,37 @@ func GetTexts(collection string, opts ...NamespaceOption) (map[string]string, er
412412 result := hostDumpTexts (& collection , & nsOpts .namespace )
413413
414414 if result == nil {
415- return nil , fmt .Errorf ("Failed to get texts" )
415+ return nil , fmt .Errorf ("failed to get texts" )
416416 }
417417
418418 return * result , nil
419419}
420420
421421func GetNamespaces (collection string ) ([]string , error ) {
422422 if collection == "" {
423- return nil , fmt .Errorf ("Collection name is required" )
423+ return nil , fmt .Errorf ("collection name is required" )
424424 }
425425
426426 result := hostGetNamespaces (& collection )
427427
428428 if result == nil {
429- return nil , fmt .Errorf ("Failed to get namespaces" )
429+ return nil , fmt .Errorf ("failed to get namespaces" )
430430 }
431431
432432 return * result , nil
433433}
434434
435435func GetVector (collection , searchMethod , key string , opts ... NamespaceOption ) ([]float32 , error ) {
436436 if collection == "" {
437- return nil , fmt .Errorf ("Collection name is required" )
437+ return nil , fmt .Errorf ("collection name is required" )
438438 }
439439
440440 if searchMethod == "" {
441- return nil , fmt .Errorf ("Search method is required" )
441+ return nil , fmt .Errorf ("search method is required" )
442442 }
443443
444444 if key == "" {
445- return nil , fmt .Errorf ("Key is required" )
445+ return nil , fmt .Errorf ("key is required" )
446446 }
447447
448448 nsOpts := & NamespaceOptions {
@@ -456,19 +456,19 @@ func GetVector(collection, searchMethod, key string, opts ...NamespaceOption) ([
456456 result := hostGetVector (& collection , & nsOpts .namespace , & searchMethod , & key )
457457
458458 if result == nil {
459- return nil , fmt .Errorf ("Failed to get vector for key" )
459+ return nil , fmt .Errorf ("failed to get vector for key" )
460460 }
461461
462462 return * result , nil
463463}
464464
465465func GetLabels (collection , key string , opts ... NamespaceOption ) ([]string , error ) {
466466 if collection == "" {
467- return nil , fmt .Errorf ("Collection name is required" )
467+ return nil , fmt .Errorf ("collection name is required" )
468468 }
469469
470470 if key == "" {
471- return nil , fmt .Errorf ("Key is required" )
471+ return nil , fmt .Errorf ("key is required" )
472472 }
473473
474474 nsOpts := & NamespaceOptions {
0 commit comments