github.com/milvus-io/milvus-sdk-go/v2@v2.4.1/entity/indexes_search_param_gen.go (about) 1 // Code generated by go generate; DO NOT EDIT 2 // This file is generated by go generate 3 4 package entity 5 6 import ( 7 "errors" 8 ) 9 10 11 var _ SearchParam = &IndexFlatSearchParam{} 12 13 // IndexFlatSearchParam search param struct for index type FLAT 14 type IndexFlatSearchParam struct { //auto generated fields 15 baseSearchParams 16 17 } 18 19 // NewIndexFlatSearchParam create index search param 20 func NewIndexFlatSearchParam() (*IndexFlatSearchParam, error) { 21 // auto generate parameters validation code, if any 22 sp := &IndexFlatSearchParam{ 23 baseSearchParams: newBaseSearchParams(), 24 } 25 26 //auto generated setting 27 28 return sp, nil 29 } 30 31 var _ SearchParam = &IndexBinFlatSearchParam{} 32 33 // IndexBinFlatSearchParam search param struct for index type BIN_FLAT 34 type IndexBinFlatSearchParam struct { //auto generated fields 35 baseSearchParams 36 37 nprobe int 38 } 39 40 // NewIndexBinFlatSearchParam create index search param 41 func NewIndexBinFlatSearchParam( 42 nprobe int, 43 ) (*IndexBinFlatSearchParam, error) { 44 // auto generate parameters validation code, if any 45 if nprobe < 1 { 46 return nil, errors.New("nprobe has to be in range [1, 65536]") 47 } 48 if nprobe > 65536 { 49 return nil, errors.New("nprobe has to be in range [1, 65536]") 50 } 51 52 sp := &IndexBinFlatSearchParam{ 53 baseSearchParams: newBaseSearchParams(), 54 } 55 56 //auto generated setting 57 sp.params["nprobe"] = nprobe 58 59 return sp, nil 60 } 61 62 var _ SearchParam = &IndexIvfFlatSearchParam{} 63 64 // IndexIvfFlatSearchParam search param struct for index type IVF_FLAT 65 type IndexIvfFlatSearchParam struct { //auto generated fields 66 baseSearchParams 67 68 nprobe int 69 } 70 71 // NewIndexIvfFlatSearchParam create index search param 72 func NewIndexIvfFlatSearchParam( 73 nprobe int, 74 ) (*IndexIvfFlatSearchParam, error) { 75 // auto generate parameters validation code, if any 76 if nprobe < 1 { 77 return nil, errors.New("nprobe has to be in range [1, 65536]") 78 } 79 if nprobe > 65536 { 80 return nil, errors.New("nprobe has to be in range [1, 65536]") 81 } 82 83 sp := &IndexIvfFlatSearchParam{ 84 baseSearchParams: newBaseSearchParams(), 85 } 86 87 //auto generated setting 88 sp.params["nprobe"] = nprobe 89 90 return sp, nil 91 } 92 93 var _ SearchParam = &IndexBinIvfFlatSearchParam{} 94 95 // IndexBinIvfFlatSearchParam search param struct for index type BIN_IVF_FLAT 96 type IndexBinIvfFlatSearchParam struct { //auto generated fields 97 baseSearchParams 98 99 nprobe int 100 } 101 102 // NewIndexBinIvfFlatSearchParam create index search param 103 func NewIndexBinIvfFlatSearchParam( 104 nprobe int, 105 ) (*IndexBinIvfFlatSearchParam, error) { 106 // auto generate parameters validation code, if any 107 if nprobe < 1 { 108 return nil, errors.New("nprobe has to be in range [1, 65536]") 109 } 110 if nprobe > 65536 { 111 return nil, errors.New("nprobe has to be in range [1, 65536]") 112 } 113 114 sp := &IndexBinIvfFlatSearchParam{ 115 baseSearchParams: newBaseSearchParams(), 116 } 117 118 //auto generated setting 119 sp.params["nprobe"] = nprobe 120 121 return sp, nil 122 } 123 124 var _ SearchParam = &IndexIvfSQ8SearchParam{} 125 126 // IndexIvfSQ8SearchParam search param struct for index type IVF_SQ8 127 type IndexIvfSQ8SearchParam struct { //auto generated fields 128 baseSearchParams 129 130 nprobe int 131 } 132 133 // NewIndexIvfSQ8SearchParam create index search param 134 func NewIndexIvfSQ8SearchParam( 135 nprobe int, 136 ) (*IndexIvfSQ8SearchParam, error) { 137 // auto generate parameters validation code, if any 138 if nprobe < 1 { 139 return nil, errors.New("nprobe has to be in range [1, 65536]") 140 } 141 if nprobe > 65536 { 142 return nil, errors.New("nprobe has to be in range [1, 65536]") 143 } 144 145 sp := &IndexIvfSQ8SearchParam{ 146 baseSearchParams: newBaseSearchParams(), 147 } 148 149 //auto generated setting 150 sp.params["nprobe"] = nprobe 151 152 return sp, nil 153 } 154 155 var _ SearchParam = &IndexIvfPQSearchParam{} 156 157 // IndexIvfPQSearchParam search param struct for index type IVF_PQ 158 type IndexIvfPQSearchParam struct { //auto generated fields 159 baseSearchParams 160 161 nprobe int 162 } 163 164 // NewIndexIvfPQSearchParam create index search param 165 func NewIndexIvfPQSearchParam( 166 nprobe int, 167 ) (*IndexIvfPQSearchParam, error) { 168 // auto generate parameters validation code, if any 169 if nprobe < 1 { 170 return nil, errors.New("nprobe has to be in range [1, 65536]") 171 } 172 if nprobe > 65536 { 173 return nil, errors.New("nprobe has to be in range [1, 65536]") 174 } 175 176 sp := &IndexIvfPQSearchParam{ 177 baseSearchParams: newBaseSearchParams(), 178 } 179 180 //auto generated setting 181 sp.params["nprobe"] = nprobe 182 183 return sp, nil 184 } 185 186 var _ SearchParam = &IndexHNSWSearchParam{} 187 188 // IndexHNSWSearchParam search param struct for index type HNSW 189 type IndexHNSWSearchParam struct { //auto generated fields 190 baseSearchParams 191 192 ef int 193 } 194 195 // NewIndexHNSWSearchParam create index search param 196 func NewIndexHNSWSearchParam( 197 ef int, 198 ) (*IndexHNSWSearchParam, error) { 199 // auto generate parameters validation code, if any 200 if ef < 1 { 201 return nil, errors.New("ef has to be in range [1, 32768]") 202 } 203 if ef > 32768 { 204 return nil, errors.New("ef has to be in range [1, 32768]") 205 } 206 207 sp := &IndexHNSWSearchParam{ 208 baseSearchParams: newBaseSearchParams(), 209 } 210 211 //auto generated setting 212 sp.params["ef"] = ef 213 214 return sp, nil 215 } 216 217 var _ SearchParam = &IndexIvfHNSWSearchParam{} 218 219 // IndexIvfHNSWSearchParam search param struct for index type IVF_HNSW 220 type IndexIvfHNSWSearchParam struct { //auto generated fields 221 baseSearchParams 222 223 nprobe int 224 ef int 225 } 226 227 // NewIndexIvfHNSWSearchParam create index search param 228 func NewIndexIvfHNSWSearchParam( 229 nprobe int, 230 231 ef int, 232 ) (*IndexIvfHNSWSearchParam, error) { 233 // auto generate parameters validation code, if any 234 if nprobe < 1 { 235 return nil, errors.New("nprobe has to be in range [1, 65536]") 236 } 237 if nprobe > 65536 { 238 return nil, errors.New("nprobe has to be in range [1, 65536]") 239 } 240 241 if ef < 1 { 242 return nil, errors.New("ef has to be in range [1, 32768]") 243 } 244 if ef > 32768 { 245 return nil, errors.New("ef has to be in range [1, 32768]") 246 } 247 248 sp := &IndexIvfHNSWSearchParam{ 249 baseSearchParams: newBaseSearchParams(), 250 } 251 252 //auto generated setting 253 sp.params["nprobe"] = nprobe 254 sp.params["ef"] = ef 255 256 return sp, nil 257 } 258 259 var _ SearchParam = &IndexDISKANNSearchParam{} 260 261 // IndexDISKANNSearchParam search param struct for index type DISKANN 262 type IndexDISKANNSearchParam struct { //auto generated fields 263 baseSearchParams 264 265 search_list int 266 } 267 268 // NewIndexDISKANNSearchParam create index search param 269 func NewIndexDISKANNSearchParam( 270 search_list int, 271 ) (*IndexDISKANNSearchParam, error) { 272 // auto generate parameters validation code, if any 273 if search_list < 1 { 274 return nil, errors.New("search_list has to be in range [1, 65535]") 275 } 276 if search_list > 65535 { 277 return nil, errors.New("search_list has to be in range [1, 65535]") 278 } 279 280 sp := &IndexDISKANNSearchParam{ 281 baseSearchParams: newBaseSearchParams(), 282 } 283 284 //auto generated setting 285 sp.params["search_list"] = search_list 286 287 return sp, nil 288 } 289 290 var _ SearchParam = &IndexAUTOINDEXSearchParam{} 291 292 // IndexAUTOINDEXSearchParam search param struct for index type AUTOINDEX 293 type IndexAUTOINDEXSearchParam struct { //auto generated fields 294 baseSearchParams 295 296 level int 297 } 298 299 // NewIndexAUTOINDEXSearchParam create index search param 300 func NewIndexAUTOINDEXSearchParam( 301 level int, 302 ) (*IndexAUTOINDEXSearchParam, error) { 303 // auto generate parameters validation code, if any 304 if level < 1 { 305 return nil, errors.New("level has to be in range [1, 9223372036854775807]") 306 } 307 if level > 9223372036854775807 { 308 return nil, errors.New("level has to be in range [1, 9223372036854775807]") 309 } 310 311 sp := &IndexAUTOINDEXSearchParam{ 312 baseSearchParams: newBaseSearchParams(), 313 } 314 315 //auto generated setting 316 sp.params["level"] = level 317 318 return sp, nil 319 } 320 321 var _ SearchParam = &IndexGPUIvfFlatSearchParam{} 322 323 // IndexGPUIvfFlatSearchParam search param struct for index type GPU_IVF_FLAT 324 type IndexGPUIvfFlatSearchParam struct { //auto generated fields 325 baseSearchParams 326 327 nprobe int 328 } 329 330 // NewIndexGPUIvfFlatSearchParam create index search param 331 func NewIndexGPUIvfFlatSearchParam( 332 nprobe int, 333 ) (*IndexGPUIvfFlatSearchParam, error) { 334 // auto generate parameters validation code, if any 335 if nprobe < 1 { 336 return nil, errors.New("nprobe has to be in range [1, 65536]") 337 } 338 if nprobe > 65536 { 339 return nil, errors.New("nprobe has to be in range [1, 65536]") 340 } 341 342 sp := &IndexGPUIvfFlatSearchParam{ 343 baseSearchParams: newBaseSearchParams(), 344 } 345 346 //auto generated setting 347 sp.params["nprobe"] = nprobe 348 349 return sp, nil 350 } 351 352 var _ SearchParam = &IndexGPUIvfPQSearchParam{} 353 354 // IndexGPUIvfPQSearchParam search param struct for index type GPU_IVF_PQ 355 type IndexGPUIvfPQSearchParam struct { //auto generated fields 356 baseSearchParams 357 358 nprobe int 359 } 360 361 // NewIndexGPUIvfPQSearchParam create index search param 362 func NewIndexGPUIvfPQSearchParam( 363 nprobe int, 364 ) (*IndexGPUIvfPQSearchParam, error) { 365 // auto generate parameters validation code, if any 366 if nprobe < 1 { 367 return nil, errors.New("nprobe has to be in range [1, 65536]") 368 } 369 if nprobe > 65536 { 370 return nil, errors.New("nprobe has to be in range [1, 65536]") 371 } 372 373 sp := &IndexGPUIvfPQSearchParam{ 374 baseSearchParams: newBaseSearchParams(), 375 } 376 377 //auto generated setting 378 sp.params["nprobe"] = nprobe 379 380 return sp, nil 381 } 382 383 var _ SearchParam = &IndexSCANNSearchParam{} 384 385 // IndexSCANNSearchParam search param struct for index type SCANN 386 type IndexSCANNSearchParam struct { //auto generated fields 387 baseSearchParams 388 389 nprobe int 390 reorder_k int 391 } 392 393 // NewIndexSCANNSearchParam create index search param 394 func NewIndexSCANNSearchParam( 395 nprobe int, 396 397 reorder_k int, 398 ) (*IndexSCANNSearchParam, error) { 399 // auto generate parameters validation code, if any 400 if nprobe < 1 { 401 return nil, errors.New("nprobe has to be in range [1, 65536]") 402 } 403 if nprobe > 65536 { 404 return nil, errors.New("nprobe has to be in range [1, 65536]") 405 } 406 407 if reorder_k < 1 { 408 return nil, errors.New("reorder_k has to be in range [1, 9223372036854775807]") 409 } 410 if reorder_k > 9223372036854775807 { 411 return nil, errors.New("reorder_k has to be in range [1, 9223372036854775807]") 412 } 413 414 sp := &IndexSCANNSearchParam{ 415 baseSearchParams: newBaseSearchParams(), 416 } 417 418 //auto generated setting 419 sp.params["nprobe"] = nprobe 420 sp.params["reorder_k"] = reorder_k 421 422 return sp, nil 423 } 424