milvus-io / pymilvus

Python SDK for Milvus.
Apache License 2.0
981 stars 312 forks source link

[Bug]: ParamError(message=f"`{param_name}` value {param_value} is illegal") #2186

Closed Aisuko closed 1 month ago

Aisuko commented 1 month ago

Is there an existing issue for this?

Describe the bug

Version:

Call search func

type(self.client)
<class 'pymilvus.milvus_client.milvus_client.MilvusClient'>

self.client.search(
                collection_name=collection_name,
                data=data,
                limit=1,
                search_params={'metric_type': 'COSINE', 'params': {}},
                output_fields=["title"],
            )

Prameters

The collection is https://huggingface.co/datasets/aisuko/squad01 and already loaded into db

The data was embedded by all-MiniLM-L6-v2-Q4_K_M-v2 with llamacpp

type(data)
<class 'list'>

len(data)
384

[-0.08030342310667038, 0.043709803372621536, 0.023311153054237366, 0.061636801809072495, -0.02462625876069069, -0.04230336472392082, 0.04433322697877884, 0.009124399162828922, -0.06706368178129196, -0.038405753672122955, -0.014389004558324814, 0.020845066756010056, -0.0023763924837112427, -0.04066140577197075, 0.06466610729694366, 0.05071906000375748, -0.0273754820227623, -0.07625275105237961, -0.11898423731327057, -0.03035646677017212, 0.012265350669622421, 0.02654247172176838, -0.025905827060341835, 0.022673850879073143, -0.027385687455534935, -0.057196713984012604, 0.03876828774809837, 0.10553334653377533, -0.030128363519906998, -0.029776321724057198, 0.07131573557853699, 0.03871007636189461, 0.03277910128235817, 0.0009250087896361947, 0.005922846030443907, 0.04431159421801567, -0.07096632570028305, -0.11299294978380203, 0.012124741449952126, 0.013718447647988796, -0.009844995103776455, -0.015965092927217484, 0.01811969466507435, 0.030900735408067703, 0.047109752893447876, -0.0348985455930233, 0.030376503244042397, 0.01595788076519966, 0.026883305981755257, 0.004655573517084122, -0.0832400918006897, -0.06804141402244568, 0.017455052584409714, -0.001856437767855823, 0.09835010766983032, 0.02270224317908287, -0.03547259047627449, -0.040822651237249374, 0.06441181153059006, -0.07350607216358185, -0.07795514166355133, 0.010738045908510685, -0.1477777659893036, 0.0011415620101615787, 0.0010065996320918202, 0.003329494735226035, -0.04642697051167488, -0.039426423609256744, -0.05151089280843735, -0.05540549382567406, -0.005903964396566153, -0.0018583161290735006, -0.023074671626091003, -0.04414256289601326, 0.014688513241708279, -0.04244423657655716, 0.03466881811618805, 0.05773846060037613, 0.05630461871623993, 0.03296094015240669, 0.030510200187563896, -0.03797301650047302, -0.01796729862689972, 0.0002520764246582985, -0.004307203460484743, -0.03182218223810196, 0.036405645310878754, -0.007304596249014139, -0.07108353823423386, 0.011704175733029842, -0.0986185297369957, 0.04723275825381279, 0.03283626586198807, -0.039868228137493134, -0.07017113268375397, -0.07374840974807739, 0.06561912596225739, -0.00996195524930954, -0.12473852932453156, 0.2818124294281006, 0.041987620294094086, 0.03925170749425888, 0.04790731519460678, 0.11177301406860352, -0.029351770877838135, 0.050804927945137024, -0.054384585469961166, 0.08193620294332504, -0.00829864852130413, 0.013915261253714561, 0.02988305501639843, -0.0041419509798288345, -0.011906835250556469, -0.027514507994055748, 0.05788016691803932, 0.0636240541934967, -0.003117858897894621, 0.005763033404946327, 2.0241061065462418e-05, -0.08710780739784241, -0.01690603792667389, -0.03699155151844025, 0.05164724215865135, -0.03847760334610939, -0.016070468351244926, -0.01181456446647644, 0.02080470137298107, -5.0548420729647845e-33, 0.062046539038419724, -0.02883637323975563, 0.0405459962785244, 0.08054015785455704, -0.0611826591193676, -0.040596749633550644, -0.01746477372944355, -0.05301770195364952, 0.007787523791193962, 0.01567230559885502, 0.012553893961012363, -0.009090384468436241, -0.032560717314481735, 0.009361554868519306, -0.028571635484695435, 0.020139161497354507, 0.03605109825730324, 0.06767576932907104, 0.044370099902153015, 0.03420327976346016, -0.07642324268817902, -0.02449253387749195, 0.02543734759092331, 0.05517708510160446, 0.03166259825229645, -0.031006881967186928, -0.00642265984788537, -0.13241633772850037, 0.05232410877943039, 0.05524706095457077, 0.03460387885570526, 0.008581229485571384, -0.001912567880935967, 0.022720716893672943, -0.009001939557492733, -0.00887983851134777, 0.02624710090458393, -0.029759060591459274, -0.05382341146469116, 0.03406405821442604, -0.028050264343619347, 0.02746213972568512, 0.07110422104597092, -0.03145115077495575, 0.016654087230563164, 0.039212558418512344, 0.016652509570121765, 0.027361487969756126, 0.021040016785264015, 0.027333658188581467, -0.04577265679836273, 0.007429758086800575, -0.14295515418052673, 0.005706381984055042, -0.011938096955418587, -0.030629802495241165, -0.005725921131670475, -0.07977204024791718, 0.09892041981220245, 0.03488742187619209, 0.03171917051076889, 0.07933807373046875, -0.04105313867330551, 0.03429485857486725, -0.1669328361749649, -0.020008634775877, 0.04941055178642273, -0.04316525161266327, 0.12447719275951385, -0.0015321268001571298, -0.04906245321035385, -0.01782805286347866, 0.03281320258975029, 0.047083016484975815, -0.027216080576181412, 0.05122257024049759, 0.05526893213391304, 0.019974179565906525, 0.02165450155735016, -0.019255662336945534, -0.008493354544043541, 0.02418082393705845, 0.00660307751968503, 0.014129983261227608, 0.052225735038518906, -0.0048081884160637856, -0.01780034601688385, -0.06994614750146866, -0.08806463330984116, -0.03546403348445892, -0.058274123817682266, 0.029267309233546257, 0.07794006168842316, -0.0332341194152832, 0.011125876568257809, 4.1898075351381714e-33, 0.09096572548151016, 0.07326284795999527, -0.054481152445077896, -0.025168748572468758, -0.04473791643977165, -0.021742668002843857, -0.026400085538625717, 0.1007331982254982, -0.08468447625637054, -0.020300287753343582, 0.06126052513718605, -0.04366593062877655, 0.06740699708461761, 0.003777198027819395, 0.045975279062986374, 0.017658531665802002, 0.08107316493988037, 0.03854062780737877, -0.0631619542837143, 0.010630518198013306, -0.028601963073015213, -0.026981119066476822, -0.10078942775726318, -0.05814353749155998, -0.006181909237056971, 0.0016664944123476744, 0.010822802782058716, 0.0688934251666069, -0.06896251440048218, -0.03055981546640396, 0.06263557076454163, -0.023622095584869385, 0.0015409678453579545, 0.05393623933196068, 0.003047709818929434, 0.10560861229896545, -0.00738071883097291, -0.08124661445617676, 0.021457411348819733, -0.09011523425579071, -0.04941912740468979, 0.018761593848466873, -0.04437488690018654, 0.08539202064275742, -0.011770457960665226, -0.022825533524155617, 0.012618494220077991, 0.04227345809340477, -0.07995878159999847, 0.00916395802050829, -0.08346056193113327, -0.03174120932817459, 0.029305320233106613, -0.013352415524423122, -0.05835771933197975, 0.051821764558553696, 0.009819326922297478, 0.03246293216943741, 0.02493753470480442, 0.004271079320460558, 0.014446265064179897, 0.04816770926117897, -0.0023329209070652723, 0.10409827530384064, 0.02817576192319393, 0.04067986086010933, -0.03169693797826767, -0.00023997999960556626, -0.0100809121504426, -0.05519092455506325, 0.03582356125116348, -0.012799992226064205, 0.041678283363580704, 0.010457134805619717, -0.005260821897536516, -0.01178808230906725, 0.0065449741668999195, 0.04993707686662674, 0.017542727291584015, 0.055302008986473083, 0.045401882380247116, 0.003009019885212183, -0.03395354747772217, 0.04466411471366882, 0.012508200481534004, 0.018195761367678642, 0.03634116053581238, 0.01611691154539585, -0.010413494892418385, -0.03416881710290909, 0.013624469749629498, 0.07530821114778519, 0.062749482691288, -0.03691162168979645, 0.021426433697342873, -1.461032628213843e-08, 0.020065469667315483, -0.023415641859173775, 0.05715366080403328, 0.07777094095945358, 0.040501996874809265, 0.05285703390836716, -0.016478199511766434, -0.00670474162325263, -0.025943366810679436, 0.026450278237462044, 0.053297095000743866, 0.030218468979001045, -0.03483549505472183, -0.06814511865377426, 0.051212579011917114, -0.01293485052883625, -0.04376370832324028, 0.035718511790037155, -0.06033807992935181, -0.12238940596580505, 0.04478050023317337, 0.024376917630434036, 0.007466403301805258, -0.04280626401305199, 8.560963033232838e-05, -0.060542814433574677, -0.04574130102992058, -0.013110274448990822, 0.016729846596717834, -0.0762593224644661, -0.01323107723146677, 0.18880154192447662, -0.0037483961787074804, -0.00634611165151, 0.030887002125382423, -0.014737100340425968, -0.0013719091657549143, -0.00751944025978446, 0.07017773389816284, -0.026281632483005524, -0.03886610269546509, -0.056419145315885544, -0.04946029558777809, -0.03637272119522095, -0.026380140334367752, 0.04938007518649101, -0.011852988973259926, -0.0473242849111557, 0.042116425931453705, -0.05753810331225395, -0.03845267370343208, -0.03450026363134384, 0.05102843418717384, 0.07308649271726608, 0.035300493240356445, 0.055444180965423584, 0.024308452382683754, 0.012100201100111008, 0.007396284956485033, -0.01969648152589798, 0.15586209297180176, 0.071518175303936, 0.0245918408036232, 0.02487180568277836]

The whole error message

Failed to search collection: aisuko_squad01
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/.cache/pypoetry/virtualenvs/kirin-513bGCIV-py3.11/lib/python3.11/site-packages/pymilvus/milvus_client/milvus_client.py", line 319, in search
    raise ex from ex
  File "/root/.cache/pypoetry/virtualenvs/kirin-513bGCIV-py3.11/lib/python3.11/site-packages/pymilvus/milvus_client/milvus_client.py", line 305, in search
    res = conn.search(
          ^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/kirin-513bGCIV-py3.11/lib/python3.11/site-packages/pymilvus/decorators.py", line 140, in handler
    raise e from e
  File "/root/.cache/pypoetry/virtualenvs/kirin-513bGCIV-py3.11/lib/python3.11/site-packages/pymilvus/decorators.py", line 136, in handler
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/kirin-513bGCIV-py3.11/lib/python3.11/site-packages/pymilvus/decorators.py", line 175, in handler
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/kirin-513bGCIV-py3.11/lib/python3.11/site-packages/pymilvus/decorators.py", line 115, in handler
    raise e from e
  File "/root/.cache/pypoetry/virtualenvs/kirin-513bGCIV-py3.11/lib/python3.11/site-packages/pymilvus/decorators.py", line 86, in handler
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/root/.cache/pypoetry/virtualenvs/kirin-513bGCIV-py3.11/lib/python3.11/site-packages/pymilvus/client/grpc_handler.py", line 752, in search
    check_pass_param(
  File "/root/.cache/pypoetry/virtualenvs/kirin-513bGCIV-py3.11/lib/python3.11/site-packages/pymilvus/client/check.py", line 353, in check_pass_param
    checker.check(key, value)
  File "/root/.cache/pypoetry/virtualenvs/kirin-513bGCIV-py3.11/lib/python3.11/site-packages/pymilvus/client/check.py", line 339, in check
    _raise_param_error(key, value)
  File "/root/.cache/pypoetry/virtualenvs/kirin-513bGCIV-py3.11/lib/python3.11/site-packages/pymilvus/client/check.py", line 231, in _raise_param_error
    raise ParamError(message=f"`{param_name}` value {param_value} is illegal")
pymilvus.exceptions.ParamError: <ParamError: (code=1, message=`search_data` value [-0.08030342310667038, 0.043709803372621536, 0.023311153054237366, 0.061636801809072495, -0.02462625876069069, -0.04230336472392082, 0.04433322697877884, 0.009124399162828922, -0.06706368178129196, -0.038405753672122955, -0.014389004558324814, 0.020845066756010056, -0.0023763924837112427, -0.04066140577197075, 0.06466610729694366, 0.05071906000375748, -0.0273754820227623, -0.07625275105237961, -0.11898423731327057, -0.03035646677017212, 0.012265350669622421, 0.02654247172176838, -0.025905827060341835, 0.022673850879073143, -0.027385687455534935, -0.057196713984012604, 0.03876828774809837, 0.10553334653377533, -0.030128363519906998, -0.029776321724057198, 0.07131573557853699, 0.03871007636189461, 0.03277910128235817, 0.0009250087896361947, 0.005922846030443907, 0.04431159421801567, -0.07096632570028305, -0.11299294978380203, 0.012124741449952126, 0.013718447647988796, -0.009844995103776455, -0.015965092927217484, 0.01811969466507435, 0.030900735408067703, 0.047109752893447876, -0.0348985455930233, 0.030376503244042397, 0.01595788076519966, 0.026883305981755257, 0.004655573517084122, -0.0832400918006897, -0.06804141402244568, 0.017455052584409714, -0.001856437767855823, 0.09835010766983032, 0.02270224317908287, -0.03547259047627449, -0.040822651237249374, 0.06441181153059006, -0.07350607216358185, -0.07795514166355133, 0.010738045908510685, -0.1477777659893036, 0.0011415620101615787, 0.0010065996320918202, 0.003329494735226035, -0.04642697051167488, -0.039426423609256744, -0.05151089280843735, -0.05540549382567406, -0.005903964396566153, -0.0018583161290735006, -0.023074671626091003, -0.04414256289601326, 0.014688513241708279, -0.04244423657655716, 0.03466881811618805, 0.05773846060037613, 0.05630461871623993, 0.03296094015240669, 0.030510200187563896, -0.03797301650047302, -0.01796729862689972, 0.0002520764246582985, -0.004307203460484743, -0.03182218223810196, 0.036405645310878754, -0.007304596249014139, -0.07108353823423386, 0.011704175733029842, -0.0986185297369957, 0.04723275825381279, 0.03283626586198807, -0.039868228137493134, -0.07017113268375397, -0.07374840974807739, 0.06561912596225739, -0.00996195524930954, -0.12473852932453156, 0.2818124294281006, 0.041987620294094086, 0.03925170749425888, 0.04790731519460678, 0.11177301406860352, -0.029351770877838135, 0.050804927945137024, -0.054384585469961166, 0.08193620294332504, -0.00829864852130413, 0.013915261253714561, 0.02988305501639843, -0.0041419509798288345, -0.011906835250556469, -0.027514507994055748, 0.05788016691803932, 0.0636240541934967, -0.003117858897894621, 0.005763033404946327, 2.0241061065462418e-05, -0.08710780739784241, -0.01690603792667389, -0.03699155151844025, 0.05164724215865135, -0.03847760334610939, -0.016070468351244926, -0.01181456446647644, 0.02080470137298107, -5.0548420729647845e-33, 0.062046539038419724, -0.02883637323975563, 0.0405459962785244, 0.08054015785455704, -0.0611826591193676, -0.040596749633550644, -0.01746477372944355, -0.05301770195364952, 0.007787523791193962, 0.01567230559885502, 0.012553893961012363, -0.009090384468436241, -0.032560717314481735, 0.009361554868519306, -0.028571635484695435, 0.020139161497354507, 0.03605109825730324, 0.06767576932907104, 0.044370099902153015, 0.03420327976346016, -0.07642324268817902, -0.02449253387749195, 0.02543734759092331, 0.05517708510160446, 0.03166259825229645, -0.031006881967186928, -0.00642265984788537, -0.13241633772850037, 0.05232410877943039, 0.05524706095457077, 0.03460387885570526, 0.008581229485571384, -0.001912567880935967, 0.022720716893672943, -0.009001939557492733, -0.00887983851134777, 0.02624710090458393, -0.029759060591459274, -0.05382341146469116, 0.03406405821442604, -0.028050264343619347, 0.02746213972568512, 0.07110422104597092, -0.03145115077495575, 0.016654087230563164, 0.039212558418512344, 0.016652509570121765, 0.027361487969756126, 0.021040016785264015, 0.027333658188581467, -0.04577265679836273, 0.007429758086800575, -0.14295515418052673, 0.005706381984055042, -0.011938096955418587, -0.030629802495241165, -0.005725921131670475, -0.07977204024791718, 0.09892041981220245, 0.03488742187619209, 0.03171917051076889, 0.07933807373046875, -0.04105313867330551, 0.03429485857486725, -0.1669328361749649, -0.020008634775877, 0.04941055178642273, -0.04316525161266327, 0.12447719275951385, -0.0015321268001571298, -0.04906245321035385, -0.01782805286347866, 0.03281320258975029, 0.047083016484975815, -0.027216080576181412, 0.05122257024049759, 0.05526893213391304, 0.019974179565906525, 0.02165450155735016, -0.019255662336945534, -0.008493354544043541, 0.02418082393705845, 0.00660307751968503, 0.014129983261227608, 0.052225735038518906, -0.0048081884160637856, -0.01780034601688385, -0.06994614750146866, -0.08806463330984116, -0.03546403348445892, -0.058274123817682266, 0.029267309233546257, 0.07794006168842316, -0.0332341194152832, 0.011125876568257809, 4.1898075351381714e-33, 0.09096572548151016, 0.07326284795999527, -0.054481152445077896, -0.025168748572468758, -0.04473791643977165, -0.021742668002843857, -0.026400085538625717, 0.1007331982254982, -0.08468447625637054, -0.020300287753343582, 0.06126052513718605, -0.04366593062877655, 0.06740699708461761, 0.003777198027819395, 0.045975279062986374, 0.017658531665802002, 0.08107316493988037, 0.03854062780737877, -0.0631619542837143, 0.010630518198013306, -0.028601963073015213, -0.026981119066476822, -0.10078942775726318, -0.05814353749155998, -0.006181909237056971, 0.0016664944123476744, 0.010822802782058716, 0.0688934251666069, -0.06896251440048218, -0.03055981546640396, 0.06263557076454163, -0.023622095584869385, 0.0015409678453579545, 0.05393623933196068, 0.003047709818929434, 0.10560861229896545, -0.00738071883097291, -0.08124661445617676, 0.021457411348819733, -0.09011523425579071, -0.04941912740468979, 0.018761593848466873, -0.04437488690018654, 0.08539202064275742, -0.011770457960665226, -0.022825533524155617, 0.012618494220077991, 0.04227345809340477, -0.07995878159999847, 0.00916395802050829, -0.08346056193113327, -0.03174120932817459, 0.029305320233106613, -0.013352415524423122, -0.05835771933197975, 0.051821764558553696, 0.009819326922297478, 0.03246293216943741, 0.02493753470480442, 0.004271079320460558, 0.014446265064179897, 0.04816770926117897, -0.0023329209070652723, 0.10409827530384064, 0.02817576192319393, 0.04067986086010933, -0.03169693797826767, -0.00023997999960556626, -0.0100809121504426, -0.05519092455506325, 0.03582356125116348, -0.012799992226064205, 0.041678283363580704, 0.010457134805619717, -0.005260821897536516, -0.01178808230906725, 0.0065449741668999195, 0.04993707686662674, 0.017542727291584015, 0.055302008986473083, 0.045401882380247116, 0.003009019885212183, -0.03395354747772217, 0.04466411471366882, 0.012508200481534004, 0.018195761367678642, 0.03634116053581238, 0.01611691154539585, -0.010413494892418385, -0.03416881710290909, 0.013624469749629498, 0.07530821114778519, 0.062749482691288, -0.03691162168979645, 0.021426433697342873, -1.461032628213843e-08, 0.020065469667315483, -0.023415641859173775, 0.05715366080403328, 0.07777094095945358, 0.040501996874809265, 0.05285703390836716, -0.016478199511766434, -0.00670474162325263, -0.025943366810679436, 0.026450278237462044, 0.053297095000743866, 0.030218468979001045, -0.03483549505472183, -0.06814511865377426, 0.051212579011917114, -0.01293485052883625, -0.04376370832324028, 0.035718511790037155, -0.06033807992935181, -0.12238940596580505, 0.04478050023317337, 0.024376917630434036, 0.007466403301805258, -0.04280626401305199, 8.560963033232838e-05, -0.060542814433574677, -0.04574130102992058, -0.013110274448990822, 0.016729846596717834, -0.0762593224644661, -0.01323107723146677, 0.18880154192447662, -0.0037483961787074804, -0.00634611165151, 0.030887002125382423, -0.014737100340425968, -0.0013719091657549143, -0.00751944025978446, 0.07017773389816284, -0.026281632483005524, -0.03886610269546509, -0.056419145315885544, -0.04946029558777809, -0.03637272119522095, -0.026380140334367752, 0.04938007518649101, -0.011852988973259926, -0.0473242849111557, 0.042116425931453705, -0.05753810331225395, -0.03845267370343208, -0.03450026363134384, 0.05102843418717384, 0.07308649271726608, 0.035300493240356445, 0.055444180965423584, 0.024308452382683754, 0.012100201100111008, 0.007396284956485033, -0.01969648152589798, 0.15586209297180176, 0.071518175303936, 0.0245918408036232, 0.02487180568277836] is illegal)>

Expected Behavior

No response

Steps/Code To Reproduce behavior

No response

Environment details

- Hardware/Softward conditions (OS, CPU, GPU, Memory):

AWS Ubuntu22.04 8CPUs 16 memory no GPU

- Method of installation (Docker, or from source):

Client:
 Version:    24.0.7
 Context:    default
 Debug Mode: false
 Plugins:
  compose: Docker Compose (Docker Inc.)
    Version:  2.24.6+ds1-0ubuntu1~22.04.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 9
  Running: 9
  Paused: 0
  Stopped: 0
 Images: 14
 Server Version: 24.0.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 
 runc version: 
 init version: 
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.5.0-1022-aws
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.33GiB
 Name: ip-10-110-144-88
 ID: 50b9c27d-9359-4a82-abfd-e41bc5a8adc5
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
  standalone:
    container_name: milvus-standalone
    image: milvusdb/milvus:v2.3.12
    command: [ "milvus", "run", "standalone" ]
    environment:
      ETCD_ENDPOINTS: etcd:2379
      MINIO_ADDRESS: minio:9000
    volumes:
      - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus
    ports:
      - "19530:19530"
    depends_on:
      - "etcd"
      - "minio"

Default settings.



### Anything else?

_No response_
Micost commented 1 month ago

I experienced the same issue. In MilvusClient.search, type of param data is Union[Dict, List[Dict]], but it is List[List[float]] in the lower level .

So change data= data to data=[data] should have this issue fixed

MilvusClient.search

def search(
        self,
        collection_name: str,
        data: Union[List[list], list],
        filter: str = "",
        limit: int = 10,
        output_fields: Optional[List[str]] = None,
        search_params: Optional[dict] = None,
        timeout: Optional[float] = None,
        partition_names: Optional[List[str]] = None,
        anns_field: Optional[str] = None,
        **kwargs,
    ) -> List[List[dict]]:
        """Search for a query vector/vectors.

        In order for the search to process, a collection needs to have been either provided
        at init or data needs to have been inserted.

        Args:
            data (Union[List[list], list]): The vector/vectors to search.
            limit (int, optional): How many results to return per search. Defaults to 10.
            filter(str, optional): A filter to use for the search. Defaults to None.
            output_fields (List[str], optional): List of which field values to return. If None
                specified, only primary fields including distances will be returned.
            search_params (dict, optional): The search params to use for the search.
            timeout (float, optional): Timeout to use, overides the client level assigned at init.
                Defaults to None.

        Raises:
            ValueError: The collection being searched doesnt exist. Need to insert data first.

        Returns:
            List[List[dict]]: A nested list of dicts containing the result data. Embeddings are
                not included in the result data.
        """
        conn = self._get_connection()
        try:
            res = conn.search(
                collection_name,
                data,
                anns_field or "",
                search_params or {},
                expression=filter,
                limit=limit,
                output_fields=output_fields,
                partition_names=partition_names,
                timeout=timeout,
                **kwargs,
            )
        except Exception as ex:
            logger.error("Failed to search collection: %s", collection_name)
            raise ex from ex
    @retry_on_rpc_failure()
    def search(
        self,
        collection_name: str,
        data: List[List[float]],
        anns_field: str,
        param: Dict,
        limit: int,
        expression: Optional[str] = None,
        partition_names: Optional[List[str]] = None,
        output_fields: Optional[List[str]] = None,
        round_decimal: int = -1,
        timeout: Optional[float] = None,
        **kwargs,
    ):
        check_pass_param(
            limit=limit,
            round_decimal=round_decimal,
            anns_field=anns_field,
            search_data=data,
            partition_name_array=partition_names,
            output_fields=output_fields,
            guarantee_timestamp=kwargs.get("guarantee_timestamp", None),
            timeout=timeout,
        )
Aisuko commented 1 month ago

I tested with [data], this issue still occur.

XuanYang-cn commented 1 month ago

@Aisuko What's the dimension of the vector data? Is it 384?

Aisuko commented 1 month ago

Hi @XuanYang-cn

Yes, data is our input, it is a list type. See above Prameters section.

len(data)
384
XuanYang-cn commented 1 month ago

@Aisuko Got you. And what's the schema of your collection? PyMilvus uses schema to validate data, please print it out and let me know, THX.

Aisuko commented 1 month ago

Hi @XuanYang-cn I fixed the issue by replacing data to [data]

self.client.search(
                collection_name=collection_name,
                data=[data],
                limit=1,
                search_params={'metric_type': 'COSINE', 'params': {}},
                output_fields=["title"],
            )