일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- high level client
- docker
- zip 파일 암호화
- 파이썬
- plugin
- Test
- aggs
- flask
- matplotlib
- analyzer test
- API
- Python
- token filter test
- aggregation
- Mac
- query
- 차트
- licence delete curl
- License
- 900gle
- Kafka
- springboot
- Elasticsearch
- MySQL
- license delete
- sort
- zip 암호화
- Java
- ELASTIC
- TensorFlow
Archives
- Today
- Total
개발잡부
[es] 검색쿼리를 만들어 보자 3 본문
반응형
must : 쿼리가 참인 도큐먼트들을 검색
must_not : 쿼리가 거짓인 도큐먼트들을 검색
should : 검색 결과 중 이 쿼리에 해당하는 도큐먼트의 점수를 높임
filter : 쿼리가 참인 도큐먼트를 검색하지만 스코어를 계산하지 않습니다. must 보다 검색 속도가 빠르고 캐싱이 가능합니다.
GET ann-index/_search
{
"query": {
"function_score": {
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "샤넬",
"fields": [
"name",
"category"
]
}
}
],
"should": [
{
"multi_match": {
"query": "샤넬",
"fields": [
"category1",
"category2",
"category3",
"category4",
"category5"
]
}
}
]
}
},
"functions": [
{
"filter": {
"match": {
"name": "샤넬"
}
},
"random_score": {},
"weight": 1
}
]
}
},
"knn": {
"field": "name_vector",
"query_vector": [-0.003568137064576149, 0.04914838448166847, -0.03969012573361397, -0.010156695730984211, -0.07306347787380219, -0.03381907194852829, -0.017944075167179108, -0.046239521354436874, 0.011156681925058365, -0.0332544781267643, -0.02421296015381813, 0.01974201388657093, -0.09116531908512115, 0.016796300187706947, 0.0318559929728508, -0.03298657014966011, 0.04030470922589302, 0.005500501487404108, -0.024518346413969994, 0.02373257838189602, 0.029673602432012558, 0.023639917373657227, 0.030103910714387894, 0.009680671617388725, -0.0037083204369992018, -0.0031333856750279665, -0.0009020264842547476, -0.011862877756357193, -0.02579820342361927, 0.0055330959148705006, 0.003562735393643379, 0.04430269077420235, -0.039679594337940216, -0.025085167959332466, 0.014027219265699387, 0.006250612437725067, -0.03083970956504345, 0.014632932841777802, -0.022750001400709152, -0.06370300054550171, -0.0009987809462472796, 0.05506956949830055, 0.0045217121951282024, 0.008893628604710102, 0.017777765169739723, -0.045810919255018234, -0.05082704499363899, 0.02911427430808544, -0.001982657238841057, 0.0012485068291425705, -0.03225357085466385, -0.021220773458480835, -0.0499119833111763, -0.11362972110509872, -0.016748879104852676, -0.007235934492200613, -0.046605974435806274, -0.08187112957239151, -0.031170733273029327, 0.05525753274559975, -0.0007110157166607678, -0.0768902525305748, -0.0284108966588974, -0.02495409920811653, -0.031833529472351074, -0.0062616425566375256, -0.07560711354017258, -0.012204079888761044, 0.0005527003668248653, -0.024308938533067703, 0.014342814683914185, 0.02411123365163803, 0.013966143131256104, 0.06689675897359848, -0.0034237110521644354, 0.07306127995252609, 0.05101405084133148, 0.064961276948452, -0.04187849164009094, 0.0419778898358345, 0.025104515254497528, -0.022804733365774155, -0.14600691199302673, 0.032248951494693756, 0.03379329666495323, 0.0054476941004395485, 0.04216083511710167, -0.008314717561006546, 0.0018335822969675064, 0.0046080597676336765, 0.017817603424191475, 0.07235150784254074, -0.14802511036396027, 0.0340922474861145, -0.052529893815517426, 0.1437349021434784, 0.007488324772566557, -0.06272484362125397, -0.07165108621120453, -0.051961883902549744, -0.013073279522359371, 0.02225501276552677, 0.028561977669596672, -0.025140682235360146, -0.021718669682741165, 0.001896897330880165, -0.04737072065472603, 0.04902728274464607, -0.02897149696946144, -0.03394102305173874, 0.013292874209582806, 0.11946853995323181, -0.016329186037182808, 0.06788076460361481, 0.06998049467802048, -0.035280413925647736, -0.07932479679584503, 0.005841307807713747, 0.013844040222465992, 0.025414464995265007, -0.0012215581955388188, -0.06762281805276871, 0.030266154557466507, -0.004214052110910416, 0.008396696299314499, 0.018299544230103493, -0.02267722226679325, -0.0012096328428015113, 0.013407421298325062, 0.007098118308931589, 0.06366658955812454, 0.03378668054938316, -0.01636122539639473, -0.013992195948958397, 0.0019913772121071815, 0.04512040317058563, -0.028224827721714973, -0.010431640781462193, -0.014142894186079502, 0.01854720711708069, 0.012815508060157299, -0.06782863289117813, -0.015005858615040779, -0.03258015960454941, -0.027318309992551804, 0.018497150391340256, 0.056034158915281296, 0.057233650237321854, -0.03738132491707802, 0.030545594170689583, 0.0041032759472727776, 0.04523889347910881, 0.018316438421607018, 0.0009596332092769444, -0.056233473122119904, 0.06739301234483719, 0.026137758046388626, 0.024345502257347107, 0.05971386283636093, 0.004539466463029385, 0.04873223602771759, -0.001551055465824902, 0.007240192499011755, 0.07282395660877228, -0.015995783731341362, -0.057228729128837585, 0.06890902668237686, -0.08182215690612793, 0.049401406198740005, 0.08766558766365051, -0.05055699497461319, 0.09664389491081238, -0.014726640656590462, 0.0032411643769592047, -0.005028256215155125, -0.00118073052726686, 0.01891707442700863, -0.042119067162275314, -0.05226929485797882, 0.011871972121298313, 0.01967492885887623, 0.01794181391596794, 0.023678334429860115, -0.016027580946683884, -0.02106569893658161, -0.006694321054965258, -0.023674145340919495, -0.05223601311445236, -0.005286999046802521, -0.09692060947418213, -0.021448509767651558, -0.03137169033288956, 0.07236222177743912, -0.04034510999917984, -0.0016346442280337214, -0.004737685434520245, -0.06724344193935394, -0.04494508355855942, -0.011575295589864254, 0.12320820987224579, -0.011251237243413925, -0.09671185910701752, 0.017731785774230957, -0.049142561852931976, 0.08123334497213364, 0.009353247471153736, -0.010799095965921879, -0.049540407955646515, 0.02116340398788452, -0.04900410398840904, -0.08543553948402405, -0.025717057287693024, 0.019923437386751175, 0.011105242185294628, 0.007769379764795303, 0.026127580553293228, -0.0098971426486969, 0.009400403127074242, 0.05128907784819603, -0.00977373868227005, 0.051961444318294525, 0.030608100816607475, -0.020800666883587837, -0.026845762506127357, 0.010881397873163223, 0.04259152710437775, 0.0007866802625358105, -0.0029224660247564316, 0.045174118131399155, 0.042238540947437286, 0.01531770545989275, 0.03862088546156883, -0.033893585205078125, -0.021173132583498955, -0.003668562276288867, -0.0021496228873729706, -0.0472167544066906, -0.04661310091614723, 0.043821219354867935, 0.013303595595061779, 0.013284259475767612, -0.0447869673371315, 0.017068084329366684, -0.058268338441848755, 0.05403352901339531, 0.04518022760748863, -0.016923533752560616, 0.05330788716673851, 0.012712903320789337, 0.07539111375808716, -0.06123651936650276, 4.5340795622905716e-05, 0.02356933429837227, -0.07484062016010284, 0.026977665722370148, -0.00784995872527361, -0.06756208091974258, 0.03968604654073715, -0.020336398854851723, 0.044849514961242676, -0.018355173990130424, 0.0275945495814085, 0.03326159715652466, 0.06852827221155167, 0.010446828790009022, 0.017924081534147263, -0.03244699165225029, -0.039068035781383514, -0.043659623712301254, -0.018433159217238426, -0.0409974567592144, -0.06202349439263344, -0.0336737334728241, 0.019991211593151093, 0.040924590080976486, -0.05637655779719353, 0.051225923001766205, 0.06377685070037842, -0.023212984204292297, -0.012542160227894783, -0.04168664291501045, -0.024279218167066574, 0.001391943427734077, -0.05564814433455467, 0.04299767315387726, -0.05977309122681618, -0.03839542716741562, -0.00923972763121128, 0.03413639962673187, -0.008051427081227303, 0.004144096281379461, -0.0015858648112043738, -0.043681539595127106, -0.056851595640182495, 0.02807469852268696, 0.0008130837813951075, 0.0291180107742548, -0.028533989563584328, -0.041242606937885284, -0.01972268894314766, -0.01008599903434515, 0.022754382342100143, -0.03358537703752518, 0.016816316172480583, 0.0319676548242569, 0.04602664336562157, 0.045256566256284714, -0.0020135105587542057, -0.040642332285642624, 0.06613278388977051, -0.020723264664411545, 0.011426631361246109, 0.0631554052233696, -0.09243078529834747, -0.0010763624450191855, -0.004739957395941019, -0.034048620611429214, -0.0028198014479130507, 0.014655672013759613, 0.08061258494853973, 0.04227975010871887, -0.06698530912399292, -0.018482111394405365, 0.03640022873878479, 0.023212339729070663, -0.03206203132867813, -0.052439019083976746, -0.07143621891736984, 0.0014974838122725487, -0.008324519731104374, -0.06781435012817383, 0.04902641847729683, -0.08183793723583221, -0.01290674414485693, 0.05828631669282913, 0.08566349744796753, -0.05466233193874359, 0.0024533416144549847, 0.007383591495454311, -0.05676288157701492, 0.009694431908428669, 0.011562500149011612, -0.05488204210996628, -0.020726403221488, 0.00817580334842205, 0.02733086794614792, -0.008409545756876469, -0.040347516536712646, -0.07339352369308472, 0.014804068952798843, -0.004755983594805002, 0.004982355050742626, -0.06161290779709816, 0.0032237558625638485, 0.0011449328158050776, -0.037710681557655334, -0.08013144135475159, 0.029288070276379585, -0.016736993566155434, -0.016875719651579857, -0.05569586902856827, -0.014230708591639996, 0.05643761157989502, -0.017214596271514893, 0.027973970398306847, 0.010630132630467415, -0.034855667501688004, 0.02716398797929287, -0.0025031447876244783, -0.003925950266420841, -0.022146927192807198, 0.04736299812793732, 0.003735428908839822, -0.0026446690317243338, -0.04689197987318039, -0.03754592686891556, 0.042693912982940674, 0.035008754581213, -0.06691133230924606, 0.005021527875214815, 0.011413117870688438, 0.003023922210559249, -0.013972075656056404, 0.08404595404863358, 0.07512307167053223, -0.0301946010440588, -0.008975916542112827, -0.0151269705966115, 0.04592670872807503, -0.0262338537722826, -0.02006700448691845, 0.04429788142442703, -0.04542937129735947, -0.03351198509335518, -0.025355607271194458, -0.012509358115494251, -0.0733194574713707, -0.058758869767189026, -0.025280240923166275, 0.01718774437904358, 0.02540481463074684, -0.0655149593949318, 0.08205360174179077, -0.054884422570466995, 0.03791183978319168, -0.06096528470516205, 0.009536518715322018, -0.012827268801629543, -0.010305730625987053, 0.10712616890668869, 0.11534728854894638, 0.04254752770066261, -0.013329476118087769, -0.025678902864456177, -0.048877932131290436, 0.05165770277380943, 0.05711374059319496, -0.06656114757061005, 0.041931431740522385, -0.034881189465522766, 0.03692270815372467, -0.024561427533626556, -0.011942683719098568, 0.06313646584749222, 0.03811480849981308, -0.01992095820605755, 0.046287406235933304, 0.013393942266702652, 0.0474427193403244, -0.03391405940055847, -0.033386509865522385, -0.01092966366559267, 0.03489942476153374, -0.0008828298887237906, 0.027011185884475708, -0.04230532795190811, 0.018299266695976257, -0.002907909918576479, -0.04400143772363663, -0.06342329829931259, 0.0323493555188179, -0.16481609642505646, 0.07898721843957901, 0.04027949273586273, -0.01571594923734665, 0.010872424580156803, -0.06690672785043716, 0.024336162954568863, 0.08312251418828964, 0.03308141604065895, -0.017849097028374672, 0.035912711173295975, -0.059829458594322205, -0.12928026914596558, -0.025190705433487892, -0.014621900394558907, -0.023735087364912033, -0.10012423247098923, 0.03771704435348511, -0.010989761911332607, -0.031099926680326462, 0.0037614749744534492, 0.07247623056173325, 0.021350350230932236, -0.062353748828172684, -0.08536544442176819, -0.017568795010447502, -0.0033605736680328846, -0.013860327191650867, -0.058550335466861725, 0.027405928820371628, -0.04165230318903923, -0.0026809265837073326, 0.06888294965028763, 0.001197927980683744, 0.07968290895223618, -0.03484129533171654, -0.057107217609882355, -0.06293575465679169, 0.050873469561338425, -0.042753249406814575, -0.030120201408863068, 0.07781165838241577, -0.029837237671017647, 0.030223140493035316, -0.04056397080421448, -0.06547151505947113, -0.009336140006780624, 0.03751390799880028, 0.0532931387424469, 0.07990679889917374, 0.04111478105187416, 0.044910501688718796, 0.03330417722463608, 0.011509004980325699, 0.07866562902927399, 0.0844363421201706, 0.05221651494503021, -0.03071129508316517, -0.060033682733774185, 0.03300975635647774, 0.06864802539348602, 0.009815541096031666, -0.016207348555326462, -0.08211500942707062, 0.0002460178511682898, -0.05922388285398483, -0.033406294882297516, 0.017452146857976913, 0.01295605767518282, 0.012598328292369843, -0.06216086447238922],
"k": 5,
"num_candidates": 50,
"boost": 0.1
},
"_source": {
"includes": [
"name",
"category"
],
"excludes": [
"feature_vector"
]
},
"size": 5
}
반응형
'ElasticStack > Elasticsearch' 카테고리의 다른 글
[es] 자동완성 3 (0) | 2022.02.06 |
---|---|
[es] 쿼리를 확인해보자 (0) | 2022.01.30 |
[es] 검색쿼리를 만들어 보자 2 (0) | 2022.01.29 |
[es] 검색결과 비교 - score (0) | 2022.01.28 |
[es] 검색결과를 검증해보자 (0) | 2022.01.21 |
Comments