Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Opensearch: 2.19.1 (though the behaviour is same with lower versions as well.
Describe the issue:
I have 2 embeddings say image_embedding
and text_embedding
. I add image_embedding
to the index with below settings.
"name": "hnsw",
"engine": "lucene",
"space_type": "cosinesimil",
"parameters": {
"ef_construction": 128,
"m": 24
}
And use text_embedding
to query the index. The score returned by result is not matching with the cosine similarity score that I calculate using simple python functions.
Configuration:
image_embedding="[-0.31572455167770386,0.5104294419288635,0.006754893809556961,-0.24550390243530273,0.595181941986084,0.38748788833618164,0.2871544361114502,-0.2698746621608734,-0.3589943051338196,0.05019991099834442,0.13018077611923218,-0.030843347311019897,-0.3239020109176636,0.08142917603254318,-0.0758184939622879,-0.41183364391326904,-0.8800979256629944,0.0775550901889801,0.5133971571922302,-0.061104342341423035,-0.39165568351745605,0.680753231048584,-0.1711875945329666,-0.4546072483062744,-0.35359495878219604,0.12433131039142609,-0.04832296073436737,-0.5621072053909302,-0.16550973057746887,0.03048539161682129,0.21707752346992493,-0.2692118287086487,0.10969555377960205,0.24508324265480042,-0.07419301569461823,0.5141509175300598,-0.7707452774047852,0.19591625034809113,-0.14875847101211548,1.3429744243621826,0.517122209072113,0.5944799184799194,0.2128036618232727,-0.6784473061561584,0.09085030853748322,1.1677894592285156,0.04833565652370453,0.030163083225488663,-0.008107408881187439,0.1238313764333725,0.08582966029644012,0.41206029057502747,0.17129585146903992,0.10448800027370453,-0.016320426017045975,0.22831428050994873,1.0193455219268799,0.07534491270780563,0.4723324179649353,-0.16231727600097656,-0.23832613229751587,0.16294874250888824,-0.24147693812847137,-0.5721734762191772,0.30121007561683655,0.028574101626873016,0.6835973858833313,-0.1294204145669937,0.23346003890037537,-0.10486561059951782,-0.2488974630832672,-0.04737919569015503,0.08452311158180237,0.13038092851638794,0.26521724462509155,-0.12705107033252716,-0.002886444330215454,-0.025768041610717773,0.28330713510513306,-0.3191535174846649,0.0854182243347168,0.429971307516098,-0.15822330117225647,0.6812961101531982,0.11158815026283264,-0.16404303908348083,0.6481767296791077,-0.27396172285079956,-0.4114699363708496,-0.48945242166519165,0.8682940006256104,0.33123743534088135,-3.857787847518921,0.25271230936050415,-0.23306035995483398,-0.010539978742599487,0.1626552790403366,-0.026859596371650696,-0.362273633480072,-1.2867906093597412,0.001606963574886322,-0.02293916791677475,0.3234027624130249,0.1123068630695343,-0.24116437137126923,0.17107915878295898,-1.1888471841812134,-0.20971286296844482,0.0005334988236427307,-0.014743059873580933,-0.2001495063304901,-0.6170254945755005,-0.2884950339794159,0.049807995557785034,0.11281359940767288,0.4706820249557495,-1.1066397428512573,-0.1744115948677063,0.3820481300354004,-0.5214130878448486,0.12086044251918793,-0.5345867276191711,0.1432495415210724,0.3483103811740875,-0.26277780532836914,-0.3557470440864563,0.062002524733543396,-0.34114664793014526,0.2914375066757202,0.5448921322822571,-0.15790559351444244,0.12827399373054504,-0.18879440426826477,0.650256335735321,0.23441936075687408,0.4985894560813904,0.2642815411090851,-1.0407885313034058,0.01759824901819229,-0.07425649464130402,-0.11325880885124207,-0.24923227727413177,0.12708094716072083,-0.26811110973358154,0.006029576063156128,0.6456723213195801,-0.47193652391433716,0.42743241786956787,-0.021775513887405396,-0.001783996820449829,-0.14114433526992798,0.1720718890428543,-0.19364464282989502,-0.23809847235679626,-0.10882841050624847,-0.35384249687194824,-0.024160251021385193,-0.6901422142982483,0.29198694229125977,0.5095832347869873,-0.552914559841156,0.3719792366027832,-0.41435810923576355,0.2875910997390747,0.3445287048816681,-0.08611741662025452,0.3327862024307251,-0.04821547865867615,0.17317168414592743,0.20679041743278503,0.026893168687820435,0.36888471245765686,0.14623324573040009,-0.34612929821014404,0.13472527265548706,0.4149525761604309,-0.9504035115242004,0.13009624183177948,0.9527754187583923,-0.1538376808166504,0.05782450735569,-0.2941962480545044,-0.4168928861618042,-0.03386612981557846,0.0917452722787857,-0.05185580998659134,0.460371732711792,0.19518382847309113,-0.3285757005214691,0.1103624552488327,-0.11341463029384613,0.07415783405303955,0.23272450268268585,-0.21698424220085144,0.3688647449016571,-0.06977713108062744,0.4895155727863312,0.34354501962661743,0.05281633138656616,0.05673195421695709,0.21105551719665527,-0.37145519256591797,0.051642172038555145,0.05435866117477417,-0.10165977478027344,0.19279322028160095,-0.34888556599617004,-0.36986929178237915,0.1736646294593811,0.24639086425304413,0.31472164392471313,0.5919313430786133,0.07949474453926086,-0.046364180743694305,-0.39177006483078003,-0.042574912309646606,-0.320404976606369,0.19056043028831482,0.856213390827179,-0.1683720499277115,0.3631065785884857,-0.10236227512359619,0.2924046516418457,-0.4198198914527893,-0.2774553596973419,0.4130280017852783,0.18300513923168182,0.3672305941581726,0.08876262605190277,-0.3400697708129883,0.03947451710700989,-0.44185540080070496,-0.20710983872413635,0.15434947609901428,0.14639823138713837,-0.7391666173934937,-0.3825339078903198,-0.26924729347229004,-0.3509540557861328,-0.03978579491376877,0.055850036442279816,-0.3495272397994995,-0.12112642824649811,-0.0874379500746727,-0.5771434307098389,-0.07898426800966263,-0.12855860590934753,0.08209242671728134,0.38819193840026855,0.12695541977882385,-0.4563298225402832,0.07039648294448853,0.1833653599023819,-0.42806151509284973,0.4709513783454895,0.8925919532775879,-0.5020757913589478,-0.015420585870742798,-0.243446946144104,0.23862144351005554,0.05232720822095871,-0.020798534154891968,-0.09770292043685913,-1.5932533740997314,-0.040260378271341324,0.11720354855060577,-0.08165476471185684,-0.010174106806516647,-0.3364015817642212,-0.24512030184268951,0.38769328594207764,0.12527529895305634,0.09695795178413391,-0.6461954116821289,-0.2076764702796936,0.03403502702713013,-0.045624665915966034,0.06949250400066376,-0.6753796935081482,0.14006337523460388,-0.2534947395324707,0.10157005488872528,-0.3219186067581177,-0.6287124156951904,0.2857314944267273,-0.1167881190776825,-0.362068235874176,-0.600099503993988,0.02555958181619644,0.1763407289981842,-0.09031908214092255,0.06421952694654465,-0.628318190574646,0.028621047735214233,-0.17081603407859802,-0.19883477687835693,-0.33337247371673584,0.41648006439208984,-0.6151530146598816,0.25281020998954773,0.31351011991500854,0.11265574395656586,-0.16729441285133362,-0.25349247455596924,0.3697563409805298,0.8196752071380615,0.02376960963010788,0.18476733565330505,0.09896577149629593,0.23138993978500366,0.43795064091682434,0.07617615163326263,0.6487817168235779,-0.04178828001022339,-0.755899965763092,-0.15362299978733063,0.19080829620361328,-0.22063830494880676,-0.025533318519592285,0.043264299631118774,0.09449292719364166,-3.0500361919403076,0.050590068101882935,0.3537426292896271,0.21417036652565002,-0.3895432949066162,0.14475135505199432,-0.11563970148563385,-0.4902805984020233,-1.147812008857727,0.053577691316604614,-0.0627271980047226,0.004291770979762077,0.150505930185318,-0.23206499218940735,0.04014558345079422,0.38981446623802185,0.014297336339950562,-0.22983035445213318,0.9377115964889526,0.3416364789009094,-0.15435785055160522,-0.1818154752254486,0.5112096071243286,-0.4225464463233948,0.002147585153579712,0.20666393637657166,-0.39523646235466003,0.2968006730079651,-0.1400214433670044,-0.39029404520988464,0.15247264504432678,0.0670834630727768,-0.8098108768463135,0.5068070292472839,-0.28726714849472046,-0.12640148401260376,-1.1096889972686768,-0.27694404125213623,0.18800197541713715,-0.09435319900512695,-0.4950031042098999,0.14384108781814575,0.28179192543029785,-0.03302602097392082,0.3943016231060028,-0.2372433841228485,-0.3510945737361908,-0.3773936927318573,0.018829476088285446,0.4753938317298889,0.044173091650009155,0.05482029914855957,0.36671388149261475,-0.1732351928949356,-0.40281790494918823,0.6880247592926025,0.38338589668273926,-0.38538286089897156,-0.16706322133541107,0.21429499983787537,0.35133424401283264,-0.3575891852378845,-0.3160477876663208,-0.055420875549316406,0.10671538859605789,-0.3776075839996338,-0.16430865228176117,-0.07848437875509262,-1.4473786354064941,-0.14354711771011353,0.2558489441871643,-0.26797226071357727,0.1690208911895752,-0.7801024913787842,0.03524370491504669,0.1324833333492279,-0.18049107491970062,0.04367271438241005,-0.04945937544107437,-0.2718311548233032,0.6892375946044922,0.25092482566833496,-0.3737461566925049,-0.09217140078544617,0.031415365636348724,-0.22135254740715027,-0.05996813625097275,-0.28780174255371094,-0.10314907133579254,0.22932890057563782,0.5462988615036011,0.10194393992424011,-0.2310376763343811,-0.12652520835399628,0.3249996304512024,0.481126070022583,0.2860703468322754,-0.09933701157569885,0.42013049125671387,0.2774963974952698,-0.3501797318458557,-0.12335953861474991,0.7496801614761353,0.14262600243091583,0.10413989424705505,-0.4102616310119629,0.44166064262390137,-2.743626594543457,0.18026332557201385,-0.21470311284065247,0.2338740974664688,1.0821675062179565,0.2730310559272766,-0.4715074896812439,0.039942994713783264,-0.026335708796977997,0.2583443522453308,-0.1883849948644638,-0.20885546505451202,0.17286790907382965,0.25742340087890625,-0.16709576547145844,-0.19989264011383057,0.07846429944038391,0.030367232859134674,-0.0633254125714302,0.18440137803554535,-0.06554228067398071,0.23946607112884521,0.8918057680130005,-0.23992547392845154,0.12257537245750427,-0.14872348308563232,0.0330030620098114,0.01965230703353882,0.007440224289894104,-0.5872142910957336,0.41253384947776794,-0.39194074273109436,-0.38501712679862976,-0.44903939962387085,-0.02462460845708847,-0.010803312063217163,0.3441516160964966,0.1066787913441658,-0.3962733745574951,0.2916406989097595,0.02386532723903656,-0.07354972511529922,-0.028483368456363678,-0.02310839295387268,0.06038336455821991,-0.4042809307575226,-0.02955487370491028,0.37907740473747253,-0.10203403234481812,-0.035789310932159424,0.07667896151542664,-0.3178170621395111,0.01796853542327881,-0.1616164743900299,-0.24263937771320343,0.15792731940746307,0.5609112977981567,0.3393562436103821,0.15368881821632385,-0.6994473934173584,-0.5098222494125366,-0.66141277551651,-0.08447180688381195,-0.24037817120552063,0.09720839560031891,0.3413699269294739,-0.40267789363861084,0.033574797213077545,0.3334229290485382,0.34163331985473633,0.2432810366153717,0.26699796319007874,0.49668213725090027,-0.15100114047527313,-0.13040734827518463,0.043067969381809235,0.46544861793518066,0.19475781917572021,0.063774973154068,0.0342736691236496,0.07748793065547943,-0.3713308572769165,-0.18044891953468323,-0.47370192408561707]"
text_embedding="[-0.010835908353328705,0.39160969853401184,-0.20119640231132507,-0.19798079133033752,0.29263192415237427,0.5127962827682495,0.4635521173477173,-0.5236321687698364,-0.22802162170410156,0.05665463209152222,-0.06877683848142624,-0.22184166312217712,0.6785678863525391,-0.027651354670524597,0.000135764479637146,-0.10647755861282349,-0.9313617944717407,0.07443234324455261,0.2383628785610199,0.33575284481048584,0.27159905433654785,0.10316284745931625,0.05263993889093399,-0.24375775456428528,-0.34830325841903687,0.10043962299823761,0.08149734139442444,0.3794347941875458,0.039005257189273834,-0.189449742436409,0.21981440484523773,0.2914881408214569,0.06977139413356781,0.1051546037197113,0.19896037876605988,0.06228383630514145,-0.019143715500831604,-0.3135600984096527,-0.015432212501764297,0.04585094377398491,-0.18297451734542847,-0.044878795742988586,-0.15021847188472748,-0.0019268225878477097,0.299588143825531,0.40245503187179565,-0.1130347028374672,0.29504290223121643,0.18105530738830566,0.04026755690574646,-0.20934146642684937,0.05003298074007034,0.1527678668498993,-0.3468761444091797,-0.3319203853607178,-0.18561823666095734,-0.1559375524520874,0.47506430745124817,-0.027675002813339233,-0.08551539480686188,0.5698242783546448,-0.09143561124801636,0.20741242170333862,0.0932929515838623,0.13588181138038635,-0.18463991582393646,-0.16519126296043396,0.2280421257019043,0.22407230734825134,-0.07913453876972198,-0.3276224434375763,-0.23518434166908264,0.26211708784103394,0.05996567755937576,-0.0015426725149154663,0.2667524814605713,0.1574137657880783,0.6591581702232361,0.08743307739496231,-0.2986947000026703,-0.027947820723056793,-0.00027251243591308594,-0.03874890133738518,0.2016344666481018,0.03329622000455856,-0.1840500831604004,-0.2859265208244324,-0.09323956072330475,-0.16848570108413696,-0.07296004891395569,-0.09248534590005875,-0.16108396649360657,-1.1694552898406982,-0.03109859675168991,0.2361924946308136,-0.03756861388683319,0.10729744285345078,-0.030989021062850952,-0.003502003848552704,-0.15074050426483154,0.3085176944732666,0.2287718951702118,0.14054162800312042,0.003948424011468887,-0.10664619505405426,-0.1476069688796997,-0.274236798286438,0.19722731411457062,-0.11021500825881958,0.08947336673736572,-0.2927795350551605,-0.4417968988418579,-0.06557914614677429,0.26705852150917053,-0.30177754163742065,-0.1367626190185547,-0.198972687125206,0.6297387480735779,-0.4056095480918884,0.10474632680416107,0.40622252225875854,-1.205965518951416,-0.1453569233417511,-0.019588947296142578,0.060898616909980774,-0.2694559097290039,0.07794946432113647,-0.19245585799217224,-0.4580281972885132,0.7029432058334351,0.3067283630371094,-0.2033851146697998,-0.1440841108560562,4.612069606781006,0.013836398720741272,0.24755072593688965,0.015327982604503632,-0.4296844005584717,-0.040127962827682495,0.18469476699829102,-0.31502050161361694,-0.24600768089294434,-0.3081169128417969,0.1269599199295044,-0.24521180987358093,-0.12603312730789185,0.28625965118408203,0.015302315354347229,-0.30714109539985657,-0.4788338840007782,-0.16980695724487305,-0.22244220972061157,0.5680283904075623,-0.008518621325492859,0.2014581710100174,-0.002514556050300598,0.27268141508102417,-0.32466524839401245,-0.3783538341522217,-0.03475572168827057,-0.2575255036354065,0.3049575090408325,-0.17129164934158325,-0.22552137076854706,-0.17853811383247375,-0.08137039095163345,0.19351734220981598,-0.05046771466732025,0.14417119324207306,-0.006190881133079529,-0.1253928542137146,-0.08842181414365768,-0.4221486747264862,0.035239771008491516,-0.4534547030925751,-0.2576519250869751,-0.13794547319412231,-0.030821986496448517,0.9502205848693848,-0.08947978913784027,-0.1726587414741516,-0.09552545845508575,-0.14308768510818481,0.09251761436462402,-0.12148189544677734,-0.39450711011886597,-0.18577246367931366,-0.2526549696922302,-0.01224350556731224,-0.11590003222227097,0.39168137311935425,0.09872009605169296,0.2054809331893921,-0.2301456481218338,-0.05669771134853363,0.005220118910074234,0.20759913325309753,0.32658010721206665,0.08330023288726807,-0.1612115353345871,-0.02438957989215851,-0.43310704827308655,-0.1382909119129181,-0.1381513774394989,-0.14313462376594543,-0.21284550428390503,0.0309259332716465,-0.601535439491272,-0.25656166672706604,-0.0006052032113075256,0.5836638808250427,0.9616121053695679,0.024527929723262787,0.31419000029563904,-0.058628879487514496,-0.3410102427005768,0.1402129828929901,-0.011233668774366379,0.47203269600868225,-0.2793862819671631,0.5889997482299805,-0.23690129816532135,0.162763774394989,-0.02501177042722702,0.09732097387313843,0.188851460814476,0.044770944863557816,0.30296552181243896,-0.12158641219139099,-0.38059020042419434,0.10443268716335297,0.10594680905342102,0.16810685396194458,-0.03283606469631195,0.3092215061187744,-0.27560871839523315,-0.07904928922653198,-0.175703763961792,-0.2197381854057312,-0.15187425911426544,-0.11388364434242249,0.04030075669288635,-0.11446237564086914,-0.02584940195083618,-0.39517009258270264,0.07592012733221054,0.2945539653301239,0.42857229709625244,0.12181966006755829,-0.030105799436569214,0.29447141289711,-0.12937204539775848,-0.008502420037984848,0.22369299829006195,-0.3996453881263733,0.12175358831882477,0.09601545333862305,0.15477114915847778,-0.021901793777942657,0.14348915219306946,0.16046592593193054,-0.17306013405323029,0.165898859500885,-0.20806729793548584,-0.1423180252313614,0.22373810410499573,-0.04572378098964691,-0.3628579080104828,-0.1672883778810501,-0.03417159616947174,0.20888212323188782,0.4432799220085144,0.554750382900238,-0.02959933876991272,-0.010574698448181152,-0.43718624114990234,0.26790881156921387,0.10313352942466736,-0.15858185291290283,-0.061466820538043976,0.02007019892334938,0.10979057848453522,0.4354294240474701,-0.2856600880622864,0.05871039628982544,0.5760754346847534,-0.4612862467765808,-0.19887611269950867,0.03337699547410011,-0.4133312702178955,0.11769843101501465,0.34467455744743347,-0.06692677736282349,0.12214478850364685,0.231065571308136,-0.028705179691314697,0.030049648135900497,-0.1149451807141304,-0.3586927056312561,-0.19440145790576935,0.009549770504236221,-0.014717210084199905,0.05636104941368103,-0.1578235924243927,0.07283332198858261,-0.26070642471313477,0.3113725781440735,-0.03303323686122894,0.7623976469039917,0.34420835971832275,0.13492238521575928,0.13703684508800507,4.617010593414307,-0.10615938901901245,0.13027194142341614,0.10967828333377838,0.039620041847229004,-0.23685936629772186,-0.00871235504746437,0.3840430974960327,-0.2407471239566803,0.01472078263759613,-0.11499936878681183,0.039478600025177,-0.622611403465271,-0.2500808537006378,-0.029681168496608734,-0.012251108884811401,-0.2483680695295334,-1.063360333442688,0.26459911465644836,0.18478189408779144,0.23336157202720642,-0.02543637901544571,-0.027447447180747986,-0.35767877101898193,-0.3008516728878021,0.08938823640346527,-0.021239176392555237,-0.1112162172794342,-0.1986752450466156,-0.0627041757106781,-0.16415588557720184,0.1523757129907608,0.15745064616203308,-0.28987693786621094,0.12482672929763794,0.10206854343414307,0.06081991270184517,-0.1681089550256729,0.5468015670776367,-0.047567710280418396,-0.2872331738471985,0.3791552484035492,-0.09885972738265991,-0.3139139711856842,-0.07839535176753998,-0.018945416435599327,-0.1575506031513214,0.26483801007270813,0.3788159489631653,-0.15928013622760773,-0.053980857133865356,0.1547788679599762,-0.19569069147109985,-0.007403060793876648,-0.37174367904663086,-0.2565050721168518,0.4289897382259369,0.383298397064209,0.3415897488594055,0.19435803592205048,-0.08904047310352325,0.33159714937210083,0.05218800529837608,0.022918403148651123,0.29947561025619507,-0.1806630790233612,-0.43589022755622864,-0.16255371272563934,0.08211702853441238,-0.07839799672365189,-0.051545947790145874,-0.23573237657546997,-0.03162136673927307,0.18284189701080322,-0.2049717754125595,-0.3335096836090088,-0.023528844118118286,0.12712687253952026,-0.23569418489933014,-0.12138324975967407,-0.44888055324554443,0.07487285137176514,0.47973376512527466,-0.10881960391998291,0.21807649731636047,0.10995987802743912,-0.11373542994260788,0.07970020920038223,-0.1766190379858017,-0.30476680397987366,0.45966804027557373,-0.10179267823696136,-0.11074075102806091,-0.29336804151535034,0.0764029324054718,-0.1632649302482605,-0.31174367666244507,0.046879738569259644,-0.25780364871025085,-0.05580812692642212,0.10206448286771774,-0.03309158980846405,-0.07398508489131927,-0.26690298318862915,-0.20661300420761108,0.045869991183280945,-0.23026476800441742,-0.09375128149986267,0.0968630388379097,-0.15932971239089966,0.2698647379875183,0.6102930307388306,0.26971036195755005,0.02732924371957779,-0.058519721031188965,0.21339194476604462,0.1025877445936203,0.380307137966156,0.0075750648975372314,-0.22712932527065277,0.20695725083351135,-0.056880027055740356,-0.01588982529938221,0.25296178460121155,0.08243663609027863,-0.5287728905677795,0.4692001938819885,-0.16729393601417542,-0.11261914670467377,0.003759443759918213,0.2261964976787567,0.01414506882429123,0.22914570569992065,0.28201916813850403,-0.4616495370864868,-0.2361598014831543,0.11583729088306427,0.20148836076259613,0.36639630794525146,-0.17210248112678528,0.26401716470718384,0.04584537446498871,0.04536682367324829,0.09782148897647858,0.044646255671978,0.24049678444862366,0.013547137379646301,0.10327310860157013,0.08548548817634583,0.430164098739624,-0.14453208446502686,-0.3638812303543091,-0.03775694966316223,-0.2551848292350769,0.5479516983032227,-0.4273243546485901,0.13333158195018768,0.20217040181159973,-0.21321135759353638,0.07551752030849457,0.20818695425987244,-0.16325218975543976,0.14276573061943054,0.13899606466293335,0.006490662693977356,-0.10151714086532593,0.2991235554218292,0.3241194486618042,-0.13145902752876282,-0.2034832239151001,0.37712714076042175,0.18392181396484375,-0.5022472143173218,-0.18806865811347961,0.1169879138469696,-0.11705603450536728,0.16580557823181152,-0.20332664251327515,0.0092374999076128,-0.009985700249671936,0.12348344177007675,1.173384666442871,0.1440156251192093,-0.053205400705337524,0.16168895363807678,-0.21584226191043854,-0.17307431995868683,0.032942164689302444,0.8246908187866211,0.1464567631483078,0.28369829058647156,-0.015592731535434723,0.11598458886146545,-0.19877183437347412,0.14183929562568665,0.00027978233993053436,-0.24961817264556885,-0.32892167568206787,0.180289626121521,0.15150517225265503]"
# Index creation
curl -X PUT "https://localhost:9200/my_non_nested_hybrid_index_v2" -H 'Content-Type: application/json' -d '{
"settings": {
"index": {
"knn": true,
"knn.space_type": "cosinesimil"
}
},
"mappings": {
"properties": {
"vector_field": {
"type": "knn_vector",
"dimension": 512,
"method": {
"name": "hnsw",
"engine": "lucene",
"space_type": "cosinesimil",
"parameters": {
"ef_construction": 128,
"m": 24
}
}
}
}
}
}'
#data ingest
curl -X POST "https://localhost:9200/_bulk?refresh=true" -H "Content-Type: application/x-ndjson" \
-d '
{ "index": { "_index": "my_non_nested_hybrid_index_v2", "_id": "100" } }
{ "text": "Image of a women clapping", "vector_field": '"$image_embedding"' }
'
#Query
curl -X POST "https://localhost:9200/my_non_nested_hybrid_index_v2/_search" -H 'Content-Type: application/json' \
-d '{"from":0,"query":{"knn":{"vector_field":{"k":500,"vector":'"$text_embedding"'}}},"size":500,"_source":false,"fields":["_score", "text"]}' | jq .
Relevant Logs or Screenshots:
The actual cosine similarity between the aforementioned embeddings are 0.2277
. But the score returned by OS is 0.61382985
.
How to make sense out of it?