content
large_stringlengths
3
20.5k
url
large_stringlengths
54
193
branch
large_stringclasses
4 values
source
large_stringclasses
42 values
embeddings
listlengths
384
384
score
float64
-0.21
0.65
[[general-recommendations]] == General recommendations [float] [[large-size]] === Don't return large result sets Elasticsearch is designed as a search engine, which makes it very good at getting back the top documents that match a query. However, it is not as good for workloads that fall into the database domain, such as retrieving all documents that match a particular query. If you need to do this, make sure to use the <> API. [float] [[maximum-document-size]] === Avoid large documents Given that the default <> is set to 100MB, Elasticsearch will refuse to index any document that is larger than that. You might decide to increase that particular setting, but Lucene still has a limit of about 2GB. Even without considering hard limits, large documents are usually not practical. Large documents put more stress on network, memory usage and disk, even for search requests that do not request the `\_source` since Elasticsearch needs to fetch the `\_id` of the document in all cases, and the cost of getting this field is bigger for large documents due to how the filesystem cache works. Indexing this document can use an amount of memory that is a multiplier of the original size of the document. Proximity search (phrase queries for instance) and <> also become more expensive since their cost directly depends on the size of the original document. It is sometimes useful to reconsider what the unit of information should be. For instance, the fact you want to make books searchable doesn't necesarily mean that a document should consist of a whole book. It might be a better idea to use chapters or even paragraphs as documents, and then have a property in these documents that identifies which book they belong to. This does not only avoid the issues with large documents, it also makes the search experience better. For instance if a user searches for two words `foo` and `bar`, a match across different chapters is probably very poor, while a match within the same paragraph is likely good.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/how-to/general.asciidoc
6.2
elasticsearch-6-2
[ 0.006255867891013622, 0.05780363827943802, 0.019930660724639893, 0.06444568186998367, 0.04520764946937561, 0.0074944267980754375, -0.05411925166845322, 0.0959373190999031, 0.004292823374271393, 0.06302609294652939, -0.07439855486154556, 0.00820862129330635, 0.027900777757167816, 0.006877918727695942, -0.06567873060703278, 0.006211966276168823, -0.008943728171288967, -0.07403535395860672, -0.026572974398732185, 0.03463416546583176, 0.1083892211318016, 0.03673969581723213, 0.02371296100318432, -0.06413354724645615, -0.07702544331550598, 0.003001568838953972, -0.06950758397579193, -0.04542666673660278, 0.010734902694821358, 0.02294689230620861, -0.027319930493831635, 0.023206137120723724, -0.0020505497232079506, 0.024578357115387917, -0.09872015565633774, -0.0032730363309383392, -0.05496683344244957, -0.08651134371757507, -0.010823452845215797, 0.014142082072794437, -0.006721614859998226, 0.05364767089486122, -0.04218568280339241, -0.05005495622754097, 0.020853325724601746, -0.0411718524992466, 0.07527454197406769, -0.07199207693338394, 0.020195119082927704, 0.08234599232673645, -0.08994021266698837, 0.03605303168296814, -0.014461752027273178, 0.03461390733718872, 0.0024372029583901167, 0.023471014574170113, -0.0641063004732132, -0.01224041823297739, -0.05603736639022827, -0.053201232105493546, 0.05615123733878136, -0.051201872527599335, -0.007921536453068256, -0.07261321693658829, 0.014859109185636044, -0.04661257192492485, 0.05140677094459534, -0.04117392748594284, 0.02820848673582077, 0.015008059330284595, 0.04058828577399254, 0.02602572552859783, -0.04050775617361069, 0.05119337514042854, 0.10080190747976303, 0.0018225942039862275, 0.00583514291793108, -0.017134888097643852, 0.04536329209804535, 0.08071570843458176, -0.0448174774646759, -0.06327110528945923, 0.00022854795679450035, -0.01786608248949051, -0.011758283711969852, -0.1428603231906891, 0.030878856778144836, -0.09634838998317719, 0.06682019680738449, 0.0009421911672689021, 0.04760424420237541, -0.10070694983005524, -0.006760296877473593, -0.011984769254922867, 0.07126833498477936, 0.09460601955652237, -0.07723704725503922, 0.022059695795178413, 0.014044971205294132, -0.037743791937828064, 0.04907268285751343, -0.03298360854387283, 0.0511646643280983, 0.0043051340617239475, -0.024613332003355026, -0.0530189611017704, 0.033589717000722885, 0.07844875752925873, 0.013846120797097683, -0.060352765023708344, 0.05176495760679245, 0.03275621682405472, -0.012364393100142479, 0.030525119975209236, 0.00697943614795804, 0.1201125979423523, -0.0019541229121387005, -0.06460461020469666, 0.04038845747709274, 0.1231977790594101, 0.05458621680736542, 0.05244700238108635, 0.048826444894075394, -0.06580395251512527, 0.036625705659389496, 0.11933519691228867, -0.030238352715969086, 6.363687074338245e-33, 0.044690750539302826, 0.05857396125793457, -0.006801089271903038, -0.07761978358030319, -0.0854453593492508, 0.07762154191732407, 0.005511946976184845, 0.09658363461494446, -0.06587320566177368, -0.03700427711009979, -0.07294626533985138, 0.12109243869781494, -0.0021636602468788624, 0.05191398411989212, 0.06875467300415039, 0.01171176042407751, 0.08487631380558014, 0.03449152410030365, -0.01335328258574009, -0.06853024661540985, 0.04194261133670807, -0.07294119149446487, -0.02999618649482727, -0.04322175681591034, -0.02897758223116398, -0.06925275921821594, -0.02675011195242405, -0.03298879414796829, -0.02749837189912796, 0.0012715822085738182, -0.07727430760860443, -0.027426647022366524, 0.039258141070604324, -0.03737102076411247, 0.02934224344789982, 0.047316957265138626, -0.08116116374731064, 0.046626005321741104, 0.007369459606707096, -0.018105126917362213, 0.00612710090354085, 0.05173947662115097, 0.04639986529946327, -0.021007325500249863, 0.001961957197636366, 0.019440343603491783, -0.05351954698562622, 0.010358048602938652, 0.014024375006556511, 0.02058599703013897, 0.048136159777641296, -0.011233165860176086, 0.022525275126099586, 0.10090483725070953, 0.07359485328197479, 0.06533621996641159, 0.036569226533174515, 0.09593553841114044, -0.011112002655863762, -0.019596826285123825, 0.009430291131138802, -0.10929857939481735, 0.10255252569913864, 0.0643458440899849, 0.013763976283371449, 0.049994442611932755, 0.04935026168823242, 0.0681023821234703, -0.004071170464158058, 0.0028975545428693295, 0.007818704470992088, 0.04769165441393852, 0.09640590101480484, -0.031029799953103065, -0.01896314136683941, -0.03831791132688522, 0.0412912555038929, -0.0617101825773716, -0.06184016540646553, -0.03270573914051056, -0.08013233542442322, 0.0021856087259948254, 0.023827463388442993, -0.04356161132454872, -0.05614843964576721, 0.027221854776144028, 0.016507035121321678, 0.027493909001350403, -0.017279334366321564, -0.08246134966611862, 0.0027278948109596968, 0.08605809509754181, -0.0772811695933342, -0.04824075102806091, -0.021904997527599335, -6.352945260023637e-33, -0.008758658543229103, -0.08656344562768936, 0.014106286689639091, 0.022038348019123077, 0.0416993610560894, -0.034908875823020935, -0.010128583759069443, -0.02352978102862835, -0.0281895212829113, -0.06624193489551544, 0.019809450954198837, -0.06769983470439911, 0.025082265958189964, -0.05770258232951164, -0.06641779839992523, -0.001271648914553225, -0.009809236042201519, -0.05677751079201698, 0.03546582907438278, -0.02580508403480053, -0.07194442301988602, -0.0631803423166275, -0.008443443104624748, 0.09332090616226196, -0.022387593984603882, -0.058979008346796036, -0.023776035755872726, -0.031632255762815475, -0.057660963386297226, -0.02546544373035431, -0.06787779182195663, -0.04783695936203003, 0.03648883476853371, -0.019973741844296455, -0.016335071995854378, 0.024502338841557503, 0.038011498749256134, 0.01471063680946827, 0.0074623688124120235, 0.06189459562301636, 0.035576462745666504, 0.05160873010754585, 0.02240273542702198, -0.010321574285626411, -0.0012296764180064201, -0.05503733456134796, -0.057387977838516235, 0.017502186819911003, 0.07397164404392242, -0.06592706590890884, 0.01587316393852234, -0.036040209233760834, 0.01345068123191595, 0.00791933387517929, -0.03466065600514412, -0.015100750140845776, -0.09734012931585312, 0.07634266465902328, -0.03999527171254158, 0.016410933807492256, -0.03632675111293793, 0.08194337040185928, -0.0630088597536087, 0.0409126952290535, -0.03314756229519844, -0.0210218857973814, -0.09000028669834137, -0.0356401763856411, -0.0828421339392662, 0.0032692095264792442, -0.06138555705547333, -0.07617144286632538, 0.06619145721197128, 0.08693787455558777, -0.041866932064294815, 0.04604189470410347, 0.059841666370630264, 0.004483083263039589, 0.08099277317523956, -0.00851423293352127, 0.026960980147123337, 0.11355261504650116, -0.021079644560813904, 0.00582080939784646, -0.016907304525375366, 0.07414181530475616, -0.008838807232677937, 0.03398213908076286, -0.11203248798847198, 0.041984740644693375, -0.019921913743019104, -0.08815928548574448, -0.034677740186452866, -0.05587388575077057, -0.0009931732201948762, -5.8991638240968314e-8, 0.038360800594091415, 0.03110853210091591, 0.0032531386241316795, 0.06819843500852585, 0.0016408824594691396, 0.024685006588697433, 0.01891166716814041, 0.10889612883329391, -0.03326099365949631, 0.02604781650006771, 0.01850787177681923, -0.06204625591635704, -0.09625504165887833, 0.023900490254163742, 0.028986731544137, -0.04182881489396095, 0.026631368324160576, -0.05304481089115143, -0.06418260931968689, -0.017620990052819252, -0.0725344568490982, -0.032864395529031754, 0.007250512950122356, 0.0069641959853470325, 0.12210241705179214, 0.03617750108242035, 0.039661455899477005, 0.04532535746693611, 0.02709236554801464, -0.03431493416428566, -0.035724375396966934, -0.025568805634975433, 0.0163484588265419, 0.028491873294115067, 0.029984131455421448, 0.001420287531800568, -0.07085352391004562, 0.00952664390206337, -0.06786026805639267, 0.07365741580724716, 0.025813279673457146, 0.009355710819363594, 0.03682408854365349, -0.05528513714671135, 0.02287597395479679, -0.027826042845845222, 0.031766489148139954, 0.05137249827384949, 0.05234159901738167, 0.01644502580165863, 0.010545114055275917, -0.09408912807703018, -0.02194839157164097, 0.09167258441448212, 0.00905977375805378, 0.03282976150512695, -0.035042960196733475, 0.03406224399805069, 0.022750845178961754, 0.024662772193551064, 0.05261595919728279, -0.06581319868564606, -0.08083546161651611, 0.05141446739435196 ]
0.048166
[[mixing-exact-search-with-stemming]] === Mixing exact search with stemming When building a search application, stemming is often a must as it is desirable for a query on `skiing` to match documents that contain `ski` or `skis`. But what if a user wants to search for `skiing` specifically? The typical way to do this would be to use a <> in order to have the same content indexed in two different ways: [source,js] -------------------------------------------------- PUT index { "settings": { "analysis": { "analyzer": { "english\_exact": { "tokenizer": "standard", "filter": [ "lowercase" ] } } } }, "mappings": { "\_doc": { "properties": { "body": { "type": "text", "analyzer": "english", "fields": { "exact": { "type": "text", "analyzer": "english\_exact" } } } } } } } PUT index/\_doc/1 { "body": "Ski resort" } PUT index/\_doc/2 { "body": "A pair of skis" } POST index/\_refresh -------------------------------------------------- // CONSOLE With such a setup, searching for `ski` on `body` would return both documents: [source,js] -------------------------------------------------- GET index/\_search { "query": { "simple\_query\_string": { "fields": [ "body" ], "query": "ski" } } } -------------------------------------------------- // CONSOLE // TEST[continued] [source,js] -------------------------------------------------- { "took": 2, "timed\_out": false, "\_shards": { "total": 5, "successful": 5, "skipped" : 0, "failed": 0 }, "hits": { "total": 2, "max\_score": 0.2876821, "hits": [ { "\_index": "index", "\_type": "\_doc", "\_id": "2", "\_score": 0.2876821, "\_source": { "body": "A pair of skis" } }, { "\_index": "index", "\_type": "\_doc", "\_id": "1", "\_score": 0.2876821, "\_source": { "body": "Ski resort" } } ] } } -------------------------------------------------- // TESTRESPONSE[s/"took": 2,/"took": "$body.took",/] On the other hand, searching for `ski` on `body.exact` would only return document `1` since the analysis chain of `body.exact` does not perform stemming. [source,js] -------------------------------------------------- GET index/\_search { "query": { "simple\_query\_string": { "fields": [ "body.exact" ], "query": "ski" } } } -------------------------------------------------- // CONSOLE // TEST[continued] [source,js] -------------------------------------------------- { "took": 1, "timed\_out": false, "\_shards": { "total": 5, "successful": 5, "skipped" : 0, "failed": 0 }, "hits": { "total": 1, "max\_score": 0.2876821, "hits": [ { "\_index": "index", "\_type": "\_doc", "\_id": "1", "\_score": 0.2876821, "\_source": { "body": "Ski resort" } } ] } } -------------------------------------------------- // TESTRESPONSE[s/"took": 1,/"took": "$body.took",/] This is not something that is easy to expose to end users, as we would need to have a way to figure out whether they are looking for an exact match or not and redirect to the appropriate field accordingly. Also what to do if only parts of the query need to be matched exactly while other parts should still take stemming into account? Fortunately, the `query\_string` and `simple\_query\_string` queries have a feature that solve this exact problem: `quote\_field\_suffix`. This tell Elasticsearch that the words that appear in between quotes are to be redirected to a different field, see below: [source,js] -------------------------------------------------- GET index/\_search { "query": { "simple\_query\_string": { "fields": [ "body" ], "quote\_field\_suffix": ".exact", "query": "\"ski\"" } } } -------------------------------------------------- // CONSOLE // TEST[continued] [source,js] -------------------------------------------------- { "took": 2, "timed\_out": false, "\_shards": { "total": 5, "successful": 5, "skipped" : 0, "failed": 0 }, "hits": { "total": 1, "max\_score": 0.2876821, "hits": [ { "\_index": "index", "\_type": "\_doc", "\_id": "1", "\_score": 0.2876821, "\_source": { "body": "Ski resort" } } ] } } -------------------------------------------------- // TESTRESPONSE[s/"took": 2,/"took": "$body.took",/] In the above case, since `ski` was in-between quotes, it was searched on the `body.exact` field due to the `quote\_field\_suffix` parameter, so only document `1` matched. This allows users to mix exact search with stemmed search as they like.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/how-to/recipes/stemming.asciidoc
6.2
elasticsearch-6-2
[ -0.043282657861709595, 0.09137891978025436, 0.07932683080434799, 0.027593404054641724, 0.022760897874832153, 0.029766716063022614, -0.009034196846187115, -0.02931915409862995, 0.05349596589803696, -0.04107312485575676, -0.024220339953899384, 0.0027625663205981255, 0.035282015800476074, 0.04431648552417755, 0.02273988351225853, 0.0720709040760994, -0.06680745631456375, 0.08952334523200989, -0.0499831885099411, -0.059023041278123856, 0.12745623290538788, 0.05394016206264496, 0.007134344894438982, -0.04586372524499893, -0.05744351074099541, 0.039902571588754654, -0.059778843075037, -0.015531842596828938, 0.07395710796117783, 0.07522546499967575, 0.024582980200648308, 0.08669883757829666, -0.03844362497329712, 0.08927866071462631, -0.10161340981721878, 0.024125389754772186, -0.06253573298454285, -0.02878163941204548, 0.0449388362467289, 0.041997745633125305, 0.04808313399553299, 0.037459470331668854, -0.00937133003026247, -0.04535125568509102, 0.001923348754644394, -0.022591451182961464, -0.03400704264640808, 0.006269050762057304, 0.005138938780874014, 0.01647205278277397, -0.09094616025686264, -0.06784538924694061, -0.032808274030685425, 0.006876898929476738, 0.020981932058930397, 0.03668885678052902, -0.10269781947135925, 0.012325776740908623, 0.012071490287780762, -0.037181440740823746, 0.02439330518245697, -0.06219705939292908, -0.018178792670369148, -0.003979233559221029, 0.024387432262301445, -0.03847659379243851, 0.0052896058186888695, 0.032222796231508255, 0.03237072750926018, 0.04092049598693848, 0.041138194501399994, 0.0035855118185281754, 0.023032646626234055, -0.010071557946503162, 0.020604697987437248, 0.04312297701835632, 0.019375856965780258, -0.05186666175723076, -0.003069806843996048, 0.02667471580207348, -0.10179606080055237, -0.13856101036071777, 0.04461987316608429, -0.03681829571723938, 0.028809266164898872, -0.04189649969339371, 0.0026367229875177145, -0.18016505241394043, 0.07902265340089798, 0.0010470497654750943, -0.09841561317443848, -0.14526617527008057, 0.07618305087089539, -0.0280486848205328, 0.0335480235517025, 0.07984048873186111, 0.024409933015704155, 0.02542933262884617, 0.050672512501478195, 0.021910203620791435, -0.0035550068132579327, -0.05760166794061661, 0.025127768516540527, -0.03474581986665726, -0.032096728682518005, -0.03396251052618027, -0.054443664848804474, 0.026133565232157707, -0.009024650789797306, -0.028769107535481453, 0.004447280429303646, 0.05683545023202896, 0.04263341799378395, -0.027069255709648132, -0.08977880328893661, 0.036233749240636826, 0.053339120000600815, -0.02097124606370926, 0.0659235417842865, 0.09308739751577377, 0.010979929007589817, 0.007291356101632118, 0.0010755772236734629, -0.061146192252635956, 0.020816132426261902, -0.00047022916260175407, -0.00501364516094327, -2.711334658179224e-33, 0.04041355475783348, -0.0098627470433712, -0.05771787092089653, -0.05179978534579277, -0.03510088473558426, 0.012241524644196033, -0.014520294964313507, 0.05039643868803978, -0.06496479362249374, 0.02674141898751259, -0.039740972220897675, 0.13363803923130035, -0.07651709765195847, -0.020802175626158714, -0.02391163818538189, -0.03607303649187088, 0.03535729646682739, 0.021585483103990555, -0.08706848323345184, -0.005696200765669346, -0.0037073849234730005, -0.01058967038989067, 0.003211028641089797, -0.015107939019799232, -0.05324940010905266, -0.04163701459765434, 0.013492098078131676, -0.09601374715566635, -0.03764767199754715, -0.0032204079907387495, -0.020776180550456047, -0.03506520017981529, -0.0009595911833457649, 0.02421882562339306, 0.05770468711853027, 0.06400702893733978, -0.03986036032438278, 0.05326519161462784, -0.004258507862687111, -0.010717963799834251, 0.01544933207333088, 0.0004866589733865112, 0.04467177763581276, -0.13240301609039307, -0.005886288825422525, 0.01686817966401577, -0.02939208224415779, -0.003477957798168063, 0.041160471737384796, 0.03324192389845848, 0.033522434532642365, 0.10963735729455948, -0.029355013743042946, 0.05275408923625946, 0.09510976076126099, 0.06196025013923645, 0.0316111296415329, 0.06213342770934105, 0.022545482963323593, -0.007705541793256998, -0.016199816018342972, -0.007458690088242292, 0.056888699531555176, 0.015450529754161835, 0.030613349750638008, -0.0005741086206398904, 0.06534287333488464, 0.06582098454236984, -0.024347485974431038, -0.011368375271558762, 0.0454486683011055, 0.012736810371279716, -0.035183828324079514, -0.000488959311041981, -0.009847329929471016, -0.07028558850288391, -0.0376199409365654, 0.01525532640516758, 0.006710559595376253, -0.011975584551692009, -0.039977312088012695, -0.03401188179850578, -0.033870890736579895, 0.0221260879188776, -0.10418900847434998, 0.09981636703014374, -0.023358754813671112, -0.06342855095863342, 0.01431362982839346, -0.08476024121046066, 0.013005024753510952, 0.07619596272706985, -0.10026399791240692, -0.10878213495016098, 0.07244186848402023, -4.667249351239525e-34, 0.04107379913330078, -0.11011268943548203, 0.0221924539655447, 0.04583830013871193, -0.0060849543660879135, -0.06709607690572739, 0.12901178002357483, -0.035787682980298996, 0.0704907700419426, 0.017572196200489998, 0.025029553100466728, -0.02342706359922886, -0.021631566807627678, -0.10887876152992249, -0.054598886519670486, 0.03718246892094612, -0.012092423625290394, 0.03004847839474678, 0.009708266705274582, 0.035020116716623306, -0.04294256120920181, 0.048224788159132004, -0.09121395647525787, 0.08171790838241577, 0.01377145852893591, -0.06585212051868439, 0.04671750217676163, 0.043814413249492645, -0.07877933979034424, 0.00579157704487443, -0.0008530044578947127, -0.053857363760471344, -0.057803429663181305, -0.039368901401758194, -0.10781039297580719, -0.022264953702688217, 0.008529878221452236, 0.009831542149186134, -0.025161201134324074, 0.05403180047869682, 0.030486557632684708, 0.041325174272060394, -0.023823946714401245, 0.07411113381385803, 0.03181532397866249, -0.030414745211601257, -0.023706980049610138, 0.044590819627046585, 0.018536502495408058, -0.03990911692380905, 0.013798250816762447, 0.04132048040628433, -0.05838042125105858, 0.006704865023493767, -0.031056832522153854, -0.11727448552846909, -0.039772845804691315, -0.03170427307486534, -0.11754824966192245, 0.011011101305484772, -0.0002483772987034172, -0.00356645998544991, -0.04366908594965935, -0.006356262136250734, 0.00238278741016984, -0.03455986827611923, -0.0804629996418953, -0.056937504559755325, 0.0024952993262559175, -0.06434964388608932, 0.03180738165974617, -0.095789834856987, 0.05361932888627052, -0.021723924204707146, 0.033121831715106964, -0.020134052261710167, 0.10817573964595795, 0.03810594603419304, 0.061110980808734894, -0.06681694090366364, -0.04195374622941017, 0.0011135017266497016, 0.018732350319623947, 0.08478452265262604, -0.002560555934906006, 0.04831061512231827, -0.10759169608354568, 0.041806768625974655, -0.05686372518539429, -0.01709446683526039, -0.003589926054701209, -0.0584711991250515, -0.04104386642575264, -0.0034920016769319773, -0.01157336588948965, -4.895829164297538e-8, -0.08162479847669601, 0.03126733377575874, -0.08068589866161346, 0.02086659148335457, -0.0523371696472168, 0.030588334426283836, -0.004303507506847382, 0.037302933633327484, -0.04586121439933777, -0.03044513799250126, 0.035246580839157104, 0.08760541677474976, -0.04055759683251381, 0.03395897522568703, -0.0013700162526220083, -0.03956212103366852, -0.008625714108347893, 0.09477150440216064, -0.08245639503002167, 0.029053527861833572, -0.001339548034593463, 0.05251824110746384, 0.001454787328839302, 0.04852394759654999, 0.06314229965209961, 0.049494192004203796, -0.02805734984576702, -0.011851356364786625, 0.04114873334765434, 0.020149772986769676, -0.04589182510972023, 0.06199609860777855, -0.028563251718878746, 0.005165367852896452, 0.010494683869183064, -0.012476680800318718, 0.024057231843471527, 0.019299330189824104, -0.04890110343694687, 0.11208047717809677, 0.0779942125082016, 0.007592788897454739, -0.04302068427205086, 0.028584754094481468, -0.030025195330381393, -0.005517848301678896, 0.03176203742623329, -0.06247352063655853, 0.10305821895599365, 0.028837911784648895, 0.03965016454458237, -0.05895191803574562, -0.016215138137340546, 0.03019142895936966, 0.0017683464102447033, -0.04357349872589111, 0.05413307622075081, 0.0004921919316984713, -0.037976983934640884, 0.03981436789035797, 0.10024847835302353, -0.04843328893184662, 0.05105656757950783, 0.0033438014797866344 ]
0.023132
exact search with stemmed search as they like.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/how-to/recipes/stemming.asciidoc
6.2
elasticsearch-6-2
[ -0.048933859914541245, 0.05313974246382713, 0.0027789431624114513, -0.021781284362077713, 0.003286700462922454, -0.02119012363255024, -0.054365124553442, -0.000972761947195977, -0.02684570662677288, -0.010437441989779472, 0.020025962963700294, 0.02008114941418171, 0.02971033751964569, 0.03538960963487625, -0.031854260712862015, 0.041978202760219574, -0.03336619585752487, 0.09589872509241104, 0.026127008721232414, -0.059937529265880585, -0.027006113901734352, 0.048158347606658936, 0.029893917962908745, -0.06291057914495468, -0.013888402841985226, 0.016407692804932594, -0.03969714418053627, -0.019727233797311783, 0.07381944358348846, -0.023983778432011604, 0.040657564997673035, 0.11228786408901215, 0.0770425945520401, 0.05524304881691933, -0.04101886227726936, -0.049926359206438065, -0.10039477050304413, 0.05301932990550995, -0.007632432971149683, -0.02704702690243721, -0.03776855021715164, 0.0564793162047863, 0.06245175004005432, 0.01728273741900921, -0.001835897914133966, -0.042045991867780685, -0.05409040302038193, 0.003412977559491992, 0.07080266624689102, -0.06226392835378647, -0.07513277977705002, -0.0955481082201004, -0.04620907083153725, 0.04320141300559044, -0.028869615867733955, 0.04563409835100174, 0.010617566294968128, -0.024746883660554886, 0.062161874026060104, 0.054084207862615585, 0.1275341659784317, -0.03283112868666649, -0.07713036984205246, -0.029677851125597954, -0.007794030476361513, 0.030281363055109978, 0.03958788886666298, -0.02406892366707325, 0.055136751383543015, -0.0460163839161396, 0.024322181940078735, 0.00827398058027029, -0.026436379179358482, 0.04550818353891373, -0.015401232056319714, 0.0720856711268425, 0.03667576238512993, -0.07386798411607742, -0.043886374682188034, 0.06047192960977554, -0.14650575816631317, -0.0220249705016613, -0.016720550134778023, 0.017846951261162758, 0.03205696493387222, -0.004893911071121693, -0.06925058364868164, -0.033908240497112274, 0.008696192875504494, -0.032587286084890366, -0.007130321580916643, -0.047737911343574524, -0.0678001418709755, -0.09350518882274628, -0.06321892142295837, 0.040225785225629807, 0.06183113530278206, -0.023781251162290573, 0.07794026285409927, 0.012127019464969635, 0.0004820472386199981, -0.024175535887479782, 0.01306617259979248, -0.04299979656934738, -0.05715148523449898, 0.03230847045779228, -0.05711846053600311, 0.05412673577666283, 0.10142523795366287, -0.05185536667704582, -0.054947640746831894, -0.058076247572898865, 0.011645857244729996, 0.009316288866102695, -0.030219506472349167, -0.022824930027127266, -0.011438678950071335, -0.047006599605083466, 0.034430600702762604, 0.032477956265211105, -0.0336434543132782, -0.007137891836464405, -0.044914159923791885, -0.01977815292775631, -0.0011027940781787038, 0.030170174315571785, -0.09617647528648376, -1.8729094094466408e-34, 0.05792023614048958, 0.03861800581216812, 0.021675560623407364, -0.03277737274765968, 0.03561611473560333, -0.024502387270331383, -0.02111281454563141, 0.050918709486722946, -0.033180344849824905, 0.07047943770885468, -0.09856763482093811, 0.0740092396736145, -0.05623920261859894, -0.04477495700120926, 0.047712381929159164, -0.14205200970172882, -0.03334682434797287, 0.09224581718444824, -0.14960499107837677, -0.035158731043338776, -0.054500505328178406, -0.05202169716358185, 0.033715806901454926, -0.0714900940656662, 0.07527073472738266, -0.04293070733547211, 0.017813637852668762, -0.08464542776346207, 0.0797906368970871, -0.00915988627821207, -0.0906764343380928, 0.018164291977882385, -0.022698555141687393, 0.051099732518196106, 0.0463138222694397, 0.0327257364988327, -0.08451590687036514, 0.01628733240067959, 0.002654261188581586, -0.017519742250442505, -0.006589457392692566, 0.02842390350997448, 0.07769721001386642, -0.030536703765392303, 0.028479114174842834, 0.003571348963305354, -0.08538562804460526, 0.052042245864868164, 0.013466386124491692, 0.04504198580980301, 0.05632424354553223, 0.12660416960716248, -0.06776195764541626, 0.05679049342870712, 0.0561741478741169, 0.09273900836706161, 0.052641917020082474, 0.09154169261455536, 0.018955636769533157, 0.05693233013153076, 0.009373604319989681, -0.022949397563934326, 0.010710657574236393, -0.002859884174540639, -0.039485327899456024, -0.02344643324613571, -0.023016460239887238, -0.00645477557554841, 0.005548989865928888, 0.09542937576770782, 0.0377228744328022, 0.012242252938449383, 0.06609761714935303, 0.010571184568107128, -0.0032831456046551466, -0.03308632969856262, 0.006814470048993826, 0.029706638306379318, 0.006171887740492821, -0.08985166251659393, -0.013326700776815414, -0.04470008611679077, -0.02657540887594223, -0.0044542704708874226, 0.04618401452898979, -0.06578225642442703, -0.005183592904359102, -0.1445799022912979, -0.015513123013079166, -0.08289072662591934, -0.03527947887778282, 0.05652682110667229, -0.07352399080991745, -0.05899794399738312, 0.022552240639925003, -3.1578808552388696e-34, 0.004239548929035664, -0.09551049023866653, 0.054042939096689224, -0.0014508496969938278, 0.04815182462334633, 0.010346261784434319, 0.044041261076927185, -0.07303024083375931, 0.03487225994467735, -0.003874990390613675, 0.00021273452148307115, 0.09363918751478195, 0.0248536579310894, -0.016622202470898628, -0.08638950437307358, 0.07281409204006195, 0.07608788460493088, 0.007670628372579813, -0.00021471083164215088, 0.04188859462738037, -0.010446518659591675, 0.062094222754240036, -0.13474060595035553, 0.026707641780376434, -0.024289030581712723, -0.018974171951413155, 0.02122516743838787, 0.014534507878124714, -0.07258211821317673, 0.06076128035783768, -0.05632489547133446, -0.05254018306732178, -0.08231201767921448, -0.03786327317357063, -0.07083439081907272, -0.008479711599647999, 0.04298711568117142, 0.023347072303295135, -0.03076331503689289, 0.04676796868443489, -0.011647194623947144, 0.020711176097393036, 0.020961401984095573, 0.04380423203110695, -0.05112989991903305, -0.034092146903276443, -0.06695523113012314, 0.09826833009719849, 0.023666100576519966, 0.030054781585931778, 0.0057464181445539, 0.0496927946805954, 0.0000377236028725747, -0.02329469844698906, -0.02264583669602871, -0.07665050029754639, 0.005972228944301605, 0.02763921208679676, -0.03462176397442818, -0.014069593511521816, -0.05113523453474045, 0.0029654591344296932, -0.0430564321577549, 0.04705342650413513, -0.004395649768412113, -0.01833786815404892, 0.011365622282028198, -0.040269117802381516, -0.1068335473537445, 0.007527098059654236, 0.02316237986087799, -0.022857174277305603, 0.05808283016085625, 0.0069316234439611435, -0.003485346445813775, 0.019056452438235283, 0.01919221505522728, 0.02997729182243347, 0.010961591266095638, 0.015370065346360207, 0.018158314749598503, 0.04032035917043686, 0.07345113158226013, 0.058910027146339417, 0.034609172493219376, 0.024015456438064575, -0.06244466453790665, 0.044095780700445175, 0.02211076207458973, -0.0014626955380663276, -0.045163266360759735, -0.020755132660269737, -0.029507135972380638, -0.011943635530769825, 0.06086715683341026, -1.6018507409398808e-8, -0.06136360764503479, 0.035846371203660965, -0.025379536673426628, 0.015316876582801342, 0.12178290635347366, 0.03280920535326004, 0.04472409561276436, 0.09605666249990463, -0.06171776354312897, -0.0841917172074318, 0.01311312522739172, -0.0039255958981812, -0.044726401567459106, 0.10277128219604492, 0.06565215438604355, -0.030522063374519348, 0.03477625548839569, -0.03413700312376022, -0.05204249545931816, -0.001879396615549922, -0.05393891781568527, 0.09505899995565414, 0.07524439692497253, 0.0607084222137928, -0.044420890510082245, 0.054432258009910583, -0.08566375076770782, 0.02736462652683258, 0.0705437958240509, 0.08048039674758911, 0.053669482469558716, 0.07701265811920166, -0.005383776966482401, -0.021508654579520226, 0.0605996735394001, 0.03680119290947914, -0.06217653304338455, 0.013360128737986088, -0.14530009031295776, 0.01736689731478691, 0.06805678457021713, 0.011651230044662952, -0.04179703816771507, 0.0065379091538488865, 0.020261447876691818, 0.05774747207760811, 0.1021769568324089, -0.014760740101337433, 0.05836101248860359, 0.010815273970365524, 0.0409071259200573, -0.05140892043709755, -0.03246237710118294, -0.023059969767928123, 0.0014014504849910736, 0.007487783674150705, 0.027186905965209007, -0.03382496163249016, 0.0016546986298635602, 0.007578568998724222, 0.013814850710332394, -0.014017531648278236, 0.04148394241929054, 0.055507369339466095 ]
0.070526
[[consistent-scoring]] === Getting consistent scoring The fact that Elasticsearch operates with shards and replicas adds challenges when it comes to having good scoring. [float] ==== Scores are not reproducible Say the same user runs the same request twice in a row and documents do not come back in the same order both times, this is a pretty bad experience isn't it? Unfortunately this is something that can happen if you have replicas (`index.number\_of\_replicas` is greater than 0). The reason is that Elasticsearch selects the shards that the query should go to in a round-robin fashion, so it is quite likely if you run the same query twice in a row that it will go to different copies of the same shard. Now why is it a problem? Index statistics are an important part of the score. And these index statistics may be different across copies of the same shard due to deleted documents. As you may know when documents are deleted or updated, the old document is not immediately removed from the index, it is just marked as deleted and it will only be removed from disk on the next time that the segment this old document belongs to is merged. However for practical reasons, those deleted documents are taken into account for index statistics. So imagine that the primary shard just finished a large merge that removed lots of deleted documents, then it might have index statistics that are sufficiently different from the replica (which still have plenty of deleted documents) so that scores are different too. The recommended way to work around this issue is to use a string that identifies the user that is logged is (a user id or session id for instance) as a <>. This ensures that all queries of a given user are always going to hit the same shards, so scores remain more consistent across queries. This work around has another benefit: when two documents have the same score, they will be sorted by their internal Lucene doc id (which is unrelated to the `\_id` or `\_uid`) by default. However these doc ids could be different across copies of the same shard. So by always hitting the same shard, we would get more consistent ordering of documents that have the same scores. [float] ==== Relevancy looks wrong If you notice that two documents with the same content get different scores or that an exact match is not ranked first, then the issue might be related to sharding. By default, Elasticsearch makes each shard responsible for producing its own scores. However since index statistics are an important contributor to the scores, this only works well if shards have similar index statistics. The assumption is that since documents are routed evenly to shards by default, then index statistics should be very similar and scoring would work as expected. However in the event that you either: - use routing at index time, - query multiple \_indices\_, - or have too little data in your index then there are good chances that all shards that are involved in the search request do not have similar index statistics and relevancy could be bad. If you have a small dataset, the easiest way to work around this issue is to index everything into an index that has a single shard (`index.number\_of\_shards: 1`). Then index statistics will be the same for all documents and scores will be consistent. Otherwise the recommended way to work around this issue is to use the <> search type. This will make Elasticsearch perform an inital round trip to all involved shards, asking them
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/how-to/recipes/scoring.asciidoc
6.2
elasticsearch-6-2
[ 0.022341012954711914, 0.004920675419270992, 0.07222875207662582, 0.05520416796207428, 0.008375418372452259, -0.021098235622048378, -0.06057951971888542, -0.056323401629924774, 0.13195295631885529, 0.015604469925165176, -0.05712883174419403, 0.06089593842625618, 0.08542405813932419, 0.0029165269806981087, -0.08464725315570831, -0.06774457544088364, -0.06465357542037964, -0.062413811683654785, -0.04947322607040405, 0.04432162269949913, 0.02843558043241501, -0.007892683148384094, -0.0025893342681229115, -0.015246201306581497, 0.00721758371219039, -0.0073257675394415855, -0.07687797397375107, -0.01746937446296215, 0.041737060993909836, -0.03144202008843422, 0.0003972803824581206, -0.02341119386255741, -0.04214399307966232, 0.025736140087246895, -0.07441896200180054, -0.014107299968600273, -0.04038310423493385, -0.1021033450961113, -0.06808885931968689, 0.028498882427811623, 0.01663040928542614, -0.022314075380563736, -0.06439482420682907, -0.08808226883411407, -0.04879450798034668, -0.013807854615151882, -0.0293438620865345, 0.008650004863739014, -0.0084361732006073, 0.03685861825942993, -0.07392022013664246, -0.04987870901823044, 0.024943483993411064, 0.006492366548627615, -0.002372053684666753, 0.07524896413087845, -0.025497954338788986, 0.043095663189888, -0.011179233901202679, -0.08535771071910858, 0.10937319695949554, -0.04236796125769615, -0.01553636509925127, -0.021781904622912407, 0.10128762573003769, -0.03666252642869949, 0.11330162733793259, -0.01682167872786522, 0.057297609746456146, 0.05403047055006027, 0.07587172091007233, 0.026318512856960297, 0.009502090513706207, 0.04008954018354416, 0.08039143681526184, 0.06663195043802261, -0.06502524018287659, -0.05310536548495293, 0.011954926885664463, 0.09030036628246307, -0.09226759523153305, -0.11078179627656937, -0.00844607874751091, -0.004642494022846222, 0.018870718777179718, -0.14343243837356567, 0.055020056664943695, -0.08432865887880325, 0.038027215749025345, -0.02778375893831253, 0.02731083333492279, 0.033631909638643265, 0.050243575125932693, -0.02069316804409027, 0.08305013924837112, 0.056922491639852524, 0.0054334006272256374, 0.13677214086055756, 0.05722055584192276, 0.008399443700909615, -0.018897734582424164, 0.036342985928058624, -0.006031527649611235, -0.0038220477290451527, 0.05890921503305435, -0.05754663422703743, -0.0707857608795166, 0.04204505309462547, -0.014366158284246922, -0.021915310993790627, 0.0666365772485733, -0.00211626966483891, 0.053972385823726654, 0.10671620815992355, 0.009396594017744064, 0.10752857476472855, 0.03568044677376747, -0.03990999236702919, -0.05061236768960953, 0.06418237835168839, 0.021087374538183212, -0.004479191266000271, 0.0847940668463707, -0.036942001432180405, -0.006430980283766985, 0.07873496413230896, -0.008805250748991966, 5.074218260628167e-33, 0.05374591425061226, -0.0007544690161012113, 0.012885908596217632, -0.054441988468170166, -0.017589488998055458, 0.023554496467113495, -0.03421768173575401, 0.08388661593198776, -0.08334046602249146, -0.07153508812189102, -0.085093654692173, 0.11002514511346817, 0.03749896213412285, -0.0036339941434562206, -0.009873375296592712, -0.04295923188328743, 0.04781150072813034, 0.06160194054245949, -0.036788418889045715, 0.0065186587162315845, 0.1020180881023407, -0.05451254919171333, 0.004476302769035101, -0.04101329669356346, -0.01322545763105154, -0.004962299484759569, -0.025001391768455505, -0.05982428789138794, -0.05292226001620293, -0.0029058216605335474, -0.04129888862371445, -0.016064956784248352, 0.022276613861322403, 0.008924062363803387, 0.007548689842224121, 0.004991759080439806, 0.052608225494623184, 0.026315229013562202, -0.016615821048617363, -0.07047005742788315, 0.026337197050452232, 0.016120964661240578, 0.055267803370952606, -0.051122650504112244, -0.05460566654801369, -0.00040540131158195436, -0.04886896163225174, 0.03262324631214142, -0.01250139158219099, 0.011112574487924576, 0.0009225144749507308, 0.04239508882164955, 0.06671421974897385, 0.01193710695952177, 0.000047855421144049615, -0.023400792852044106, -0.009962163865566254, -0.011878370307385921, -0.046331338584423065, 0.025886492803692818, 0.09794461727142334, -0.04053042456507683, 0.02023240737617016, 0.04771151766180992, 0.029589645564556122, 0.04507964849472046, 0.05407596006989479, 0.07955841720104218, 0.03202164173126221, 0.08019496500492096, 0.03692934289574623, 0.02637914940714836, -0.047167543321847916, -0.10134033113718033, 0.017829591408371925, -0.08575965464115143, -0.012478148564696312, -0.04041564464569092, -0.05427215248346329, -0.011194157414138317, -0.08322509378194809, -0.03870939463376999, -0.05807662755250931, -0.06638549268245697, -0.11266528815031052, 0.08340046554803848, 0.05266797915101051, -0.029693499207496643, -0.030470499768853188, -0.05398622155189514, 0.0780743882060051, -0.009274951182305813, -0.024666262790560722, -0.028028668835759163, 0.010339954867959023, -4.91806448903898e-33, -0.020060377195477486, -0.08422228693962097, 0.0032699955627322197, 0.03268687427043915, 0.10774988681077957, 0.005766919814050198, -0.009935739450156689, -0.029823971912264824, -0.056262508034706116, -0.08622105419635773, 0.023418955504894257, -0.046823650598526, -0.003332190914079547, 0.014982437714934349, -0.0644950121641159, 0.030106406658887863, 0.04980135336518288, -0.06496141105890274, 0.03735063970088959, -0.04487380385398865, 0.02884705737233162, -0.018498562276363373, -0.008579655550420284, 0.0670013427734375, -0.04781774803996086, -0.031514737755060196, -0.004049103241413832, -0.09345913678407669, -0.005942082032561302, 0.0017031150637194514, 0.03018060326576233, -0.017726151272654533, 0.01104129571467638, -0.061257071793079376, -0.042044658213853836, 0.01833242177963257, -0.008481677621603012, -0.00932414922863245, 0.015169758349657059, 0.07536593824625015, 0.018668046221137047, 0.03406914323568344, -0.04851142317056656, -0.037202414125204086, 0.025710884481668472, 0.028211677446961403, 0.0165683813393116, 0.06433254480361938, 0.0272636990994215, -0.044306520372629166, 0.03260606899857521, -0.02850485034286976, -0.018425973132252693, 0.0866437554359436, -0.036656562238931656, 0.018305962905287743, -0.12161277234554291, 0.11469462513923645, -0.09562315791845322, 0.11883432418107986, -0.0070869470946490765, 0.08698974549770355, -0.08920498937368393, 0.04782654345035553, -0.008019222877919674, 0.05238351970911026, -0.031745053827762604, -0.07551302015781403, -0.050789251923561096, 0.011407134123146534, -0.08334764838218689, -0.0215056911110878, 0.006274714600294828, 0.01432600524276495, 0.028390681371092796, 0.010662791319191456, -0.05216481536626816, 0.019821899011731148, -0.021988853812217712, -0.006232212297618389, -0.0397409126162529, 0.057981811463832855, 0.009963824413716793, 0.03563624992966652, -0.057418908923864365, 0.00015492601960431784, 0.04662596434354782, 0.05257036164402962, -0.04212111607193947, 0.09916680306196213, -0.004572189413011074, -0.036958664655685425, -0.12208747118711472, -0.03846576064825058, -0.004669409245252609, -5.770870714627563e-8, 0.015144246630370617, 0.048297323286533356, -0.038515686988830566, 0.12025170773267746, -0.027060450986027718, -0.011624041013419628, 0.02758835069835186, 0.006602802779525518, -0.04415368661284447, -0.024962911382317543, 0.026149041950702667, -0.054795071482658386, -0.03761013597249985, -0.0422113873064518, 0.021290572360157967, -0.008070417679846287, -0.019473521038889885, 0.013932157307863235, -0.04777003824710846, -0.023100826889276505, -0.033486805856227875, 0.009585586376488209, 0.034753017127513885, 0.03334223851561546, -0.01943928748369217, 0.09699193388223648, 0.020483635365962982, 0.014572681859135628, 0.04678623005747795, -0.023530492559075356, -0.040134407579898834, -0.023657063022255898, 0.0768464207649231, -0.0025279242545366287, -0.017417460680007935, 0.05813485383987427, -0.09851834923028946, 0.029658490791916847, -0.03666669875383377, 0.04056944325566292, 0.0008055479265749454, 0.03259493038058281, -0.01948540098965168, 0.02433697134256363, 0.03817088529467583, -0.013375145383179188, -0.03154949098825455, 0.06754235923290253, 0.05930306389927864, -0.027094805613160133, -0.0008856034255586565, -0.06931007653474808, -0.0003750563191715628, 0.06262971460819244, 0.06846814602613449, -0.00946678314357996, 0.008099245838820934, -0.016975007951259613, 0.04752754792571068, 0.035006120800971985, 0.13885892927646637, -0.09227713942527771, -0.04912451282143593, -0.030533239245414734 ]
0.000812
single shard (`index.number\_of\_shards: 1`). Then index statistics will be the same for all documents and scores will be consistent. Otherwise the recommended way to work around this issue is to use the <> search type. This will make Elasticsearch perform an inital round trip to all involved shards, asking them for their index statistics relatively to the query, then the coordinating node will merge those statistics and send the merged statistics alongside the request when asking shards to perform the `query` phase, so that shards can use these global statistics rather than their own statistics in order to do the scoring. In most cases, this additional round trip should be very cheap. However in the event that your query contains a very large number of fields/terms or fuzzy queries, beware that gathering statistics alone might not be cheap since all terms have to be looked up in the terms dictionaries in order to look up statistics.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/how-to/recipes/scoring.asciidoc
6.2
elasticsearch-6-2
[ 0.10380729287862778, -0.00725881103426218, 0.046208228915929794, 0.07264824956655502, -0.00983159989118576, 0.017077062278985977, -0.057129036635160446, -0.0035263733007013798, 0.08707962930202484, 0.027844978496432304, -0.06239839643239975, -0.02175699919462204, 0.0711374282836914, 0.00204360275529325, -0.04081385210156441, -0.0006557892775163054, -0.054470863193273544, -0.019952941685914993, -0.03551081195473671, 0.03302312642335892, 0.0034891734831035137, 0.01266697607934475, 0.022110331803560257, -0.09492358565330505, -0.002473504049703479, -0.04328339546918869, -0.08521559834480286, -0.016511376947164536, 0.011632092297077179, 0.016203531995415688, 0.017240436747670174, 0.012235411442816257, -0.029868662357330322, 0.05516961216926575, -0.10184944421052933, -0.021936025470495224, -0.025718534365296364, -0.05571838840842247, -0.05409016087651253, 0.05616652965545654, 0.008249582722783089, 0.004294745158404112, -0.0614360086619854, -0.06486427783966064, 0.012952065095305443, -0.021246755495667458, -0.042939119040966034, -0.01422838307917118, 0.0387013778090477, 0.10354350507259369, -0.0816473439335823, -0.044762298464775085, -0.008891204372048378, 0.009836774319410324, 0.013459748588502407, 0.02946721948683262, -0.10306544601917267, -0.029337314888834953, -0.04037900269031525, -0.09894859045743942, 0.08814109861850739, -0.07581370323896408, 0.01204325444996357, -0.055186111479997635, 0.05661521479487419, -0.0013334739487618208, 0.12975341081619263, 0.028216255828738213, 0.032213225960731506, 0.024621030315756798, 0.017331494018435478, 0.030113505199551582, -0.032941125333309174, 0.02446947991847992, 0.044422902166843414, 0.08299258351325989, -0.0937260314822197, -0.049300193786621094, 0.012293010950088501, 0.05952480062842369, -0.08534218370914459, -0.03088466264307499, -0.002863853005692363, -0.017574863508343697, 0.04998316615819931, -0.06467604637145996, 0.017203060910105705, -0.049454137682914734, 0.00022492253629025072, -0.04302815720438957, 0.01668357662856579, -0.014934190548956394, 0.07149511575698853, -0.06768760830163956, 0.067207470536232, 0.036194123327732086, -0.039175741374492645, 0.08149176090955734, 0.10107608884572983, -0.009719772264361382, -0.014189098961651325, -0.0031911837868392467, -0.014866413548588753, -0.07603520900011063, -0.02466406673192978, -0.0016057756729424, -0.07786200195550919, 0.055699944496154785, -0.03078075498342514, -0.03332193195819855, 0.035362761467695236, -0.0030990440864115953, 0.005349656101316214, 0.012784278951585293, 0.02356518805027008, 0.10599364340305328, 0.04447018727660179, -0.036690931767225266, 0.02590497024357319, 0.06312932074069977, 0.03982561454176903, 0.030249152332544327, 0.09261409938335419, 0.024438098073005676, -0.002361393766477704, 0.060929156839847565, -0.07286395877599716, 4.456606549208429e-33, 0.09379242360591888, 0.03203842416405678, 0.001038962509483099, -0.018964719027280807, -0.028343982994556427, 0.0893554762005806, -0.004425590857863426, 0.06238578259944916, -0.06526821851730347, -0.023746512830257416, -0.0768464058637619, 0.13483349978923798, 0.037641704082489014, -0.08601170778274536, 0.051974106580019, -0.020853035151958466, 0.08575271815061569, 0.06297792494297028, -0.02572096884250641, 0.009290218353271484, 0.0903632715344429, -0.0633590966463089, 0.011160504072904587, 0.012058181688189507, 0.00617204699665308, -0.02702367678284645, 0.006162742618471384, -0.07023419439792633, -0.014891402795910835, -0.014082509092986584, -0.013858423568308353, -0.0387854240834713, 0.0063516185618937016, 0.0045339567586779594, 0.0025660863611847162, 0.012792378664016724, -0.014604898169636726, 0.061551082879304886, -0.011609675362706184, -0.06912501156330109, -0.02126036025583744, 0.0040492587722837925, 0.044659487903118134, -0.0900864452123642, -0.09347514808177948, 0.036027323454618454, -0.08323559165000916, 0.0002708616084419191, 0.005496673285961151, -0.029504751786589622, -0.011367418803274632, -0.007590880151838064, 0.059028174728155136, 0.032744597643613815, 0.03883600980043411, 0.036355942487716675, -0.010700899176299572, 0.030144155025482178, -0.07518360763788223, 0.027900299057364464, 0.0012794083449989557, -0.05273545905947685, 0.05175413191318512, 0.01774420589208603, 0.015964752063155174, 0.014427317306399345, 0.02905881404876709, 0.1349940001964569, 0.04080091789364815, 0.05944925919175148, 0.07413775473833084, 0.11450117081403732, -0.047476187348365784, -0.07227330654859543, 0.01865399442613125, -0.03826121240854263, 0.020598508417606354, -0.07063758373260498, -0.08889477699995041, 0.016585813835263252, -0.05745495483279228, -0.038643427193164825, 0.009466171264648438, -0.009888767264783382, -0.02967792935669422, 0.12275078892707825, 0.05818001925945282, -0.00849146582186222, -0.0435246117413044, -0.05891496315598488, -0.013016548939049244, -0.013385400176048279, -0.07646126300096512, -0.08566433936357498, -0.049770355224609375, -4.586147863378968e-33, -0.018845198675990105, -0.09845564514398575, -0.004233573563396931, 0.039439067244529724, 0.05883254483342171, 0.020520107820630074, 0.011098203249275684, -0.06714294105768204, -0.013539227657020092, -0.049320582300424576, 0.028131816536188126, -0.05259960889816284, 0.0077956924214959145, -0.06766536831855774, -0.04732630401849747, 0.04349777474999428, -0.004768877290189266, -0.07034853100776672, 0.06553744524717331, 0.0444384329020977, -0.0776270180940628, -0.051252685487270355, -0.003089678240939975, 0.05820148438215256, -0.037409670650959015, -0.03154255077242851, 0.005691473837941885, -0.0742550790309906, -0.034554000943899155, 0.028912799432873726, -0.03199644014239311, -0.04301324114203453, 0.02497030422091484, -0.06678015738725662, -0.09302221983671188, 0.0017443859251216054, -0.0034168532583862543, -0.0432949960231781, 0.028502708300948143, 0.07079232484102249, 0.020775089040398598, 0.03146790713071823, -0.05827898159623146, -0.046568602323532104, -0.0013524808455258608, 0.010365424677729607, -0.04988221079111099, 0.07116588205099106, -0.002295170910656452, -0.05816454067826271, -0.009690177626907825, -0.02022898755967617, -0.0020484509877860546, 0.09377700835466385, -0.04646890610456467, 0.024839600548148155, -0.09439805895090103, 0.08332402259111404, -0.13144536316394806, 0.0658516138792038, -0.01282338798046112, 0.09307312965393066, -0.07360789179801941, -0.0000210255675483495, 0.0048924945294857025, -0.004842498805373907, -0.035540997982025146, -0.10492707043886185, -0.09878028929233551, -0.03156927227973938, -0.048260241746902466, -0.02934308908879757, 0.025376800447702408, 0.04524926468729973, 0.044297073036432266, 0.0014861791860312223, -0.0012298714136704803, -0.004474255256354809, 0.025742504745721817, 0.03319849073886871, -0.020261134952306747, 0.056142713874578476, 0.02793985791504383, 0.009565125219523907, 0.030165566131472588, -0.014542915858328342, 0.06690863519906998, 0.0685407966375351, -0.023226743564009666, 0.029492348432540894, -0.026874087750911713, -0.04384228214621544, -0.03924451768398285, -0.09325288981199265, 0.025232238695025444, -4.9888626563188154e-8, 0.044717662036418915, 0.10245483368635178, -0.036519475281238556, 0.0720636174082756, -0.01134537998586893, 0.027643050998449326, 0.004982196260243654, 0.07323525846004486, -0.05992379039525986, -0.0028843439649790525, 0.020385360345244408, -0.07020188868045807, -0.06568284332752228, -0.014735406264662743, 0.01113829668611288, 0.01263412181288004, 0.01677466183900833, 0.06230153888463974, -0.03685043379664421, -0.017138054594397545, -0.003244012361392379, 0.03558216989040375, 0.03714593127369881, 0.013338974677026272, 0.027772940695285797, 0.04744997248053551, 0.01878402754664421, -0.040216341614723206, 0.06560700386762619, -0.03047197125852108, -0.08144830912351608, -0.07821912318468094, 0.018317000940442085, -0.012704536318778992, 0.03087403066456318, 0.06352512538433075, -0.11478286236524582, 0.04554654285311699, -0.029925845563411713, 0.09372120350599289, 0.03353969380259514, 0.013063467107713223, -0.03685040399432182, 0.042584650218486786, 0.012260346673429012, -0.047645971179008484, -0.028816014528274536, 0.06052643060684204, 0.08558391779661179, 0.04020070284605026, 0.02721843123435974, -0.0331912562251091, 0.0548025481402874, 0.03434257209300995, 0.03155531734228134, 0.049940381199121475, 0.042047735303640366, -0.030427739024162292, 0.02449663169682026, 0.024592215195298195, 0.1082269549369812, -0.13652756810188293, -0.05758596211671829, -0.024148911237716675 ]
0.007264
[[search-multi-search]] == Multi Search API The multi search API allows to execute several search requests within the same API. The endpoint for it is `\_msearch`. The format of the request is similar to the bulk API format and makes use of the newline delimited JSON (NDJSON) format. the structure is as follows (the structure is specifically optimized to reduce parsing if a specific search ends up redirected to another node): [source,js] -------------------------------------------------- header\n body\n header\n body\n -------------------------------------------------- // NOTCONSOLE \*NOTE\*: the final line of data must end with a newline character `\n`. Each newline character may be preceded by a carriage return `\r`. When sending requests to this endpoint the `Content-Type` header should be set to `application/x-ndjson`. The header part includes which index / indices to search on, optional (mapping) types to search on, the `search\_type`, `preference`, and `routing`. The body includes the typical search body request (including the `query`, `aggregations`, `from`, `size`, and so on). Here is an example: [source,js] -------------------------------------------------- $ cat requests {"index" : "test"} {"query" : {"match\_all" : {}}, "from" : 0, "size" : 10} {"index" : "test", "search\_type" : "dfs\_query\_then\_fetch"} {"query" : {"match\_all" : {}}} {} {"query" : {"match\_all" : {}}} {"query" : {"match\_all" : {}}} {"search\_type" : "dfs\_query\_then\_fetch"} {"query" : {"match\_all" : {}}} -------------------------------------------------- // NOTCONSOLE [source,js] -------------------------------------------------- $ curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/\_msearch --data-binary "@requests"; echo -------------------------------------------------- // NOTCONSOLE Note, the above includes an example of an empty header (can also be just without any content) which is supported as well. The response returns a `responses` array, which includes the search response and status code for each search request matching its order in the original multi search request. If there was a complete failure for that specific search request, an object with `error` message and corresponding status code will be returned in place of the actual search response. The endpoint allows to also search against an index/indices and type/types in the URI itself, in which case it will be used as the default unless explicitly defined otherwise in the header. For example: [source,js] -------------------------------------------------- GET twitter/\_msearch {} {"query" : {"match\_all" : {}}, "from" : 0, "size" : 10} {} {"query" : {"match\_all" : {}}} {"index" : "twitter2"} {"query" : {"match\_all" : {}}} -------------------------------------------------- // CONSOLE // TEST[setup:twitter] The above will execute the search against the `twitter` index for all the requests that don't define an index, and the last one will be executed against the `twitter2` index. The `search\_type` can be set in a similar manner to globally apply to all search requests. The msearch's `max\_concurrent\_searches` request parameter can be used to control the maximum number of concurrent searches the multi search api will execute. This default is based on the number of data nodes and the default search thread pool size. [float] [[msearch-security]] === Security See <> [float] [[template-msearch]] === Template support Much like described in <> for the \_search resource, \_msearch also provides support for templates. Submit them like follows: [source,js] ----------------------------------------------- GET \_msearch/template {"index" : "twitter"} { "source" : "{ \"query\": { \"match\": { \"message\" : \"{{keywords}}\" } } } }", "params": { "query\_type": "match", "keywords": "some message" } } {"index" : "twitter"} { "source" : "{ \"query\": { \"match\_{{template}}\": {} } }", "params": { "template": "all" } } ----------------------------------------------- // CONSOLE // TEST[setup:twitter] for inline templates. You can also create search templates: [source,js] ------------------------------------------ POST /\_scripts/my\_template\_1 { "script": { "lang": "mustache", "source": { "query": { "match": { "message": "{{query\_string}}" } } } } } ------------------------------------------ // CONSOLE // TEST[setup:twitter] [source,js] ------------------------------------------ POST /\_scripts/my\_template\_2 { "script": { "lang": "mustache", "source": { "query": { "term": { "{{field}}": "{{value}}" } }
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/multi-search.asciidoc
6.2
elasticsearch-6-2
[ -0.1365649253129959, 0.06562826037406921, -0.025991588830947876, 0.005697709508240223, -0.011619442142546177, -0.0633268654346466, -0.033004872500896454, 0.018115749582648277, 0.03628813847899437, -0.051539719104766846, -0.0007503960514441133, -0.033320363610982895, 0.012527963146567345, -0.07238802313804626, 0.06365799158811569, 0.029677916318178177, -0.09762755781412125, 0.012771177105605602, -0.06246640533208847, -0.07003609836101532, 0.07868608832359314, 0.09157248586416245, -0.004422225058078766, -0.07629446685314178, -0.033358361572027206, -0.00726229278370738, -0.020576173439621925, -0.08301319926977158, 0.035731133073568344, 0.030286546796560287, 0.04437996447086334, -0.014352322556078434, -0.046357300132513046, 0.13826601207256317, 0.0011432230239734054, 0.08173880726099014, -0.04686383157968521, -0.05713801085948944, -0.01059202291071415, 0.008074235171079636, 0.00516478018835187, 0.09644997864961624, -0.09180303663015366, -0.07720165699720383, 0.058182038366794586, -0.040699973702430725, -0.13548187911510468, -0.04754578694701195, 0.0077905552461743355, -0.04435039684176445, -0.09172594547271729, -0.02659040316939354, -0.07241691648960114, 0.00721505843102932, 0.08033382147550583, -0.014203015714883804, -0.05847008153796196, 0.00010713262599892914, -0.0036591708194464445, -0.03858358412981033, 0.08639878034591675, -0.06875753402709961, -0.0043182335793972015, -0.0120247732847929, 0.10230866819620132, -0.060345519334077835, -0.055195633322000504, -0.019364219158887863, 0.04110647737979889, -0.06047283113002777, -0.021067723631858826, -0.030948316678404808, -0.0829223245382309, -0.02041803114116192, 0.026674143970012665, 0.0006050977972336113, -0.013744722120463848, 0.04168732464313507, -0.035283684730529785, 0.006396446842700243, -0.01101186964660883, -0.06247970461845398, -0.02785905823111534, 0.051603954285383224, -0.05471852794289589, 0.010067764669656754, -0.08408989012241364, -0.04211793467402458, 0.07504203915596008, 0.02298673242330551, -0.037108778953552246, -0.07425419241189957, -0.038618963211774826, 0.021843168884515762, -0.022047970443964005, 0.07793810218572617, -0.01336282305419445, 0.007964430376887321, 0.010617841966450214, 0.0167497880756855, 0.04027761146426201, 0.015460287220776081, 0.05230332165956497, -0.01888449862599373, -0.05061428248882294, -0.009476386941969395, 0.04227101057767868, 0.06737767904996872, -0.009961606934666634, -0.030611282214522362, -0.003160082967951894, 0.05888444557785988, -0.0046539269387722015, -0.042645055800676346, -0.07653782516717911, -0.00671218940988183, -0.010137006640434265, -0.03768199309706688, 0.0696403756737709, 0.1199975311756134, 0.06327834725379944, -0.04617006331682205, -0.05988629534840584, -0.02475578896701336, 0.021835174411535263, -0.012633183039724827, 0.006190619431436062, 3.661268173468023e-33, 0.017900824546813965, -0.03439749777317047, 0.042350511997938156, -0.06245400756597519, -0.006980639882385731, 0.0016899635083973408, 0.045877259224653244, 0.04912356287240982, -0.11969438195228577, -0.004409605637192726, -0.08454527705907822, -0.01303485780954361, -0.016643119975924492, 0.05401216819882393, -0.06856564432382584, -0.07484826445579529, 0.05858132243156433, 0.033898625522851944, 0.026006054133176804, 0.08153323829174042, 0.0560656413435936, 0.03813246265053749, 0.027947595342993736, 0.02413296513259411, 0.004461464937776327, 0.006998577155172825, -0.021006722003221512, -0.043729476630687714, -0.0974666103720665, 0.0003667273558676243, -0.0161434318870306, -0.003510713344439864, -0.04454447701573372, 0.04891372472047806, 0.07248394191265106, 0.0653453841805458, -0.014292934909462929, 0.035232119262218475, -0.06024375930428505, -0.046218715608119965, -0.04447047412395477, 0.007081362884491682, -0.01824307069182396, -0.056678324937820435, -0.05828751251101494, -0.049599431455135345, -0.15418919920921326, -0.02918713353574276, -0.013915203511714935, 0.020617306232452393, -0.04353293031454086, 0.1051233783364296, 0.040598805993795395, 0.004605466034263372, 0.10822678357362747, 0.0007298181299120188, -0.009386989288032055, 0.06590116769075394, -0.016327613964676857, 0.0596805177628994, 0.0011476135114207864, -0.006702025420963764, -0.02815234661102295, 0.058524373918771744, 0.05966529622673988, 0.04990619421005249, -0.0072257318533957005, 0.022445961833000183, 0.03963121026754379, 0.05843788757920265, -0.011467845179140568, 0.043510064482688904, 0.11747937649488449, -0.03127743676304817, -0.011673958040773869, -0.11738362163305283, -0.030522920191287994, 0.005426135379821062, 0.06289774924516678, -0.05168110132217407, 0.020935889333486557, 0.03631259500980377, -0.040399178862571716, 0.01979401707649231, -0.029437661170959473, 0.03874875605106354, -0.03050975687801838, -0.1337059587240219, -0.010656995698809624, -0.012369493022561073, -0.013901866972446442, 0.0056502302177250385, -0.1177065446972847, -0.09771604835987091, -0.038348618894815445, -7.082663500339312e-33, 0.06620598584413528, -0.03771577775478363, -0.04154444485902786, -0.022825684398412704, -0.007856379263103008, -0.04753772169351578, -0.0002307616377947852, -0.05862507224082947, 0.05233796685934067, 0.10414557158946991, 0.020365428179502487, 0.019796984270215034, 0.02710556797683239, -0.04005039855837822, -0.016080588102340698, 0.1264677494764328, 0.00443991320207715, -0.04858902469277382, 0.03941739723086357, -0.01814553700387478, -0.04850349575281143, 0.039064936339855194, -0.03474218025803566, 0.01615871861577034, -0.020808327943086624, -0.060681670904159546, -0.048803672194480896, 0.03408357873558998, -0.06636681407690048, 0.01651867665350437, -0.00928342342376709, -0.023556282743811607, -0.0031527916435152292, 0.04014270007610321, -0.029144756495952606, -0.014079799875617027, 0.02564847096800804, 0.10049591213464737, 0.045626550912857056, 0.005128259304910898, 0.04033131152391434, -0.0027140334714204073, 0.03933265805244446, 0.009024734608829021, 0.08260853588581085, -0.009229404851794243, -0.11952006071805954, 0.10267655551433563, -0.06349088251590729, -0.03420238196849823, 0.0058637578040361404, -0.02096780762076378, -0.04597027599811554, 0.031581733375787735, -0.01700604148209095, -0.03588027134537697, -0.021654875949025154, 0.04089604690670967, -0.026730000972747803, -0.05094548314809799, 0.0010029280092567205, -0.10193762928247452, -0.027087273076176643, 0.07812901586294174, 0.05071687698364258, -0.06679027527570724, -0.028760574758052826, -0.05347723513841629, -0.012811072170734406, -0.07135744392871857, -0.034472834318876266, -0.027579760178923607, 0.05069204047322273, 0.042257726192474365, 0.007921945303678513, -0.04110042378306389, -0.007824254222214222, -0.05312729999423027, 0.007523712236434221, 0.07435955852270126, -0.08701717108488083, 0.027330130338668823, 0.01255104597657919, 0.15169890224933624, 0.020808637142181396, -0.006424162071198225, -0.0013658920070156455, 0.12745767831802368, -0.06473620980978012, -0.038752488791942596, 0.02180608920753002, 0.04653965309262276, -0.017565779387950897, 0.02695014327764511, 0.022478053346276283, -5.6619356314513425e-8, -0.04779720678925514, -0.08444283157587051, -0.10230124741792679, 0.01203669048845768, 0.033630967140197754, 0.05578847974538803, -0.003560114186257124, 0.039630599319934845, 0.010104845277965069, -0.03203513100743294, 0.052971288561820984, 0.05316072329878807, -0.0661914274096489, -0.013370818458497524, -0.009749096818268299, 0.020782843232154846, -0.03520709276199341, -0.03965279087424278, -0.029556598514318466, -0.02752251736819744, 0.019190866500139236, 0.039432018995285034, -0.009010184556245804, -0.014186164364218712, 0.06083163991570473, 0.03410296142101288, 0.04462290555238724, 0.0714019387960434, -0.06563808023929596, -0.04102016240358353, -0.04204215481877327, 0.017131326720118523, -0.010181521996855736, -0.05337014049291611, 0.017670495435595512, -0.003941385541111231, 0.09383755177259445, 0.01604435406625271, -0.023383917286992073, 0.05903419852256775, 0.04395776987075806, 0.07531557232141495, -0.021113788709044456, 0.04026156663894653, 0.04231327399611473, 0.006616486236453056, -0.004152318462729454, 0.05034051090478897, 0.05120272561907768, -0.01560287270694971, 0.01754305511713028, -0.025266285985708237, -0.04230866581201553, -0.001616460969671607, -0.049616895616054535, -0.01995699107646942, -0.046201761811971664, -0.042257871478796005, 0.05378052592277527, 0.04523204267024994, 0.1000179573893547, 0.05676525831222534, 0.04884791001677513, 0.006857166066765785 ]
0.16192
also create search templates: [source,js] ------------------------------------------ POST /\_scripts/my\_template\_1 { "script": { "lang": "mustache", "source": { "query": { "match": { "message": "{{query\_string}}" } } } } } ------------------------------------------ // CONSOLE // TEST[setup:twitter] [source,js] ------------------------------------------ POST /\_scripts/my\_template\_2 { "script": { "lang": "mustache", "source": { "query": { "term": { "{{field}}": "{{value}}" } } } } } ------------------------------------------ // CONSOLE // TEST[continued] and later use them in a \_msearch: [source,js] ----------------------------------------------- GET \_msearch/template {"index" : "main"} { "id": "my\_template\_1", "params": { "query\_string": "some message" } } {"index" : "main"} { "id": "my\_template\_2", "params": { "field": "user", "value": "test" } } ----------------------------------------------- // CONSOLE // TEST[continued]
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/multi-search.asciidoc
6.2
elasticsearch-6-2
[ -0.07600913941860199, 0.06414628028869629, 0.03767223656177521, 0.03492281585931778, 0.0066126021556556225, 0.06899600476026535, 0.03525200113654137, 0.04636595398187637, 0.06008776277303696, -0.09986931830644608, -0.010522431693971157, -0.03412094712257385, 0.029678599908947945, -0.016738958656787872, 0.04952024295926094, 0.03752880543470383, -0.030493533238768578, -0.017371797934174538, 0.014794462360441685, -0.0999302864074707, 0.026643892750144005, 0.050977129489183426, -0.001597211230546236, -0.036015938967466354, 0.025208359584212303, 0.002621276304125786, -0.05003618448972702, -0.08695055544376373, 0.021160030737519264, 0.07588683068752289, 0.022197725251317024, -0.03784191608428955, -0.05129119008779526, 0.04571658745408058, 0.016949040815234184, 0.05985191464424133, -0.048782479017972946, -0.024785205721855164, 0.017748478800058365, -0.004893087781965733, -0.02991791069507599, 0.04924819990992546, -0.10297679901123047, -0.11138499528169632, 0.01292872428894043, -0.07873614877462387, -0.02746778354048729, 0.0475018173456192, -0.13231337070465088, -0.05598728731274605, -0.11883009225130081, -0.09728864580392838, -0.048527792096138, -0.04161388799548149, 0.0056866249069571495, 0.019250711426138878, -0.05815555527806282, 0.025479810312390327, 0.06297767907381058, -0.017531532794237137, 0.018419889733195305, -0.025656910613179207, 0.03304873779416084, 0.01642051339149475, 0.02632400579750538, -0.04190228134393692, -0.020398057997226715, 0.06013260409235954, -0.011119931004941463, 0.0356682613492012, -0.0713745728135109, 0.031349241733551025, 0.0029769085813313723, 0.028440013527870178, -0.03637807443737984, 0.01006070151925087, -0.0011763102374970913, -0.04254629835486412, -0.007225670386105776, -0.015360448509454727, -0.0493500642478466, -0.11034118384122849, -0.02038775570690632, 0.006004690658301115, 0.05750793218612671, 0.02386569045484066, -0.004827883094549179, -0.018193718045949936, 0.06269246339797974, -0.03624901548027992, -0.05880700424313545, -0.043241094797849655, 0.0204066913574934, 0.008043439127504826, 0.025749538093805313, 0.06552096456289291, -0.025413915514945984, 0.031370364129543304, 0.06930612027645111, 0.03320116922259331, -0.0003217316116206348, -0.03311333805322647, 0.03933233395218849, -0.029653163626790047, -0.030642328783869743, 0.09600674360990524, -0.061848659068346024, 0.009420061483979225, 0.06244191527366638, -0.016643570736050606, -0.027904383838176727, 0.08388742804527283, -0.01768300123512745, -0.06499338150024414, 0.010342689231038094, -0.008933967910706997, 0.10512860119342804, -0.047071848064661026, 0.07975233346223831, 0.1453985720872879, 0.11950183659791946, -0.0023208654019981623, -0.07620230317115784, -0.061511531472206116, 0.04780157282948494, 0.023121537640690804, -0.03338255733251572, 1.0347071372987291e-33, 0.08608740568161011, 0.006265012547373772, -0.08062831312417984, 0.04386089742183685, 0.0705489069223404, 0.047811657190322876, 0.034936681389808655, 0.09023889899253845, -0.10714546591043472, 0.013684836216270924, -0.03759703412652016, 0.03646403178572655, -0.0684283897280693, -0.05068603903055191, -0.0728461816906929, -0.003781802486628294, 0.03378953039646149, 0.017779100686311722, 0.048673342913389206, -0.021422747522592545, 0.00041711400263011456, 0.010632101446390152, -0.017484869807958603, 0.04443551227450371, -0.011787507683038712, 0.011406336911022663, 0.025849487632513046, -0.06585212796926498, -0.10417316854000092, -0.02057061344385147, -0.00109676958527416, -0.02037675492465496, -0.052181635051965714, 0.009495792910456657, 0.06899716705083847, -0.017584120854735374, 0.0040910146199166775, 0.0026397681795060635, -0.06779800355434418, 0.01896042749285698, -0.003844259539619088, -0.007338384632021189, -0.03572117164731026, -0.09514264017343521, -0.020060179755091667, -0.06975814700126648, -0.07815733551979065, 0.0030041257850825787, -0.016426946967840195, -0.06466317921876907, -0.03186259791254997, 0.07196421176195145, -0.018816808238625526, 0.0015863791340962052, 0.08391028642654419, 0.024804869666695595, -0.05575473606586456, 0.014966876246035099, 0.08912039548158646, 0.05543689429759979, -0.01721406914293766, 0.0036337333731353283, 0.051973313093185425, 0.0068144346587359905, 0.0735604539513588, -0.05237936973571777, 0.015027125366032124, 0.05022326111793518, 0.031534310430288315, 0.028890665620565414, 0.05673712491989136, -0.005188700743019581, 0.060399387031793594, 0.042834289371967316, 0.0322687029838562, -0.10574516654014587, -0.08900553733110428, 0.02404697984457016, 0.010328664444386959, 0.009692024439573288, -0.011104138568043709, -0.0967366173863411, -0.03757018595933914, 0.024463456124067307, 0.012347099371254444, 0.02120961993932724, -0.022758591920137405, -0.09788696467876434, -0.030382763594388962, 0.0006002497975714505, -0.0429469496011734, -0.02951277233660221, -0.03141986206173897, -0.12327524274587631, 0.014690314419567585, -5.721366839006207e-33, 0.046436961740255356, 0.0020438849460333586, -0.027105482295155525, 0.02103552594780922, -0.004898476880043745, -0.022186368703842163, 0.0550018735229969, -0.011537134647369385, -0.009402838535606861, 0.06773846596479416, -0.01716981828212738, -0.008050487376749516, 0.032855913043022156, -0.017535412684082985, -0.016350705176591873, 0.04156506061553955, -0.022463396191596985, -0.061492688953876495, 0.024403071030974388, -0.009615269489586353, -0.030122626572847366, 0.04311041533946991, -0.07764489203691483, 0.09734861552715302, -0.08785513043403625, -0.02528686635196209, -0.012599878013134003, 0.011287473142147064, -0.09602688252925873, 0.06152838096022606, -0.07667229324579239, 0.01725824736058712, -0.004789752420037985, 0.01796294003725052, -0.06618780642747879, 0.013528747484087944, -0.05994531512260437, -0.005380443762987852, 0.05488201603293419, 0.08918746560811996, 0.07662986218929291, -0.016066323965787888, -0.018927443772554398, 0.03011961840093136, -0.10948755592107773, -0.02005576156079769, 0.020784061402082443, 0.01031424943357706, 0.008958759717643261, -0.07501017302274704, 0.021884245797991753, 0.0040457663126289845, -0.08679493516683578, -0.041287168860435486, -0.04553758352994919, -0.08348958939313889, -0.04417821764945984, -0.041299302130937576, -0.10844127088785172, 0.056243427097797394, 0.01042969524860382, -0.03168901428580284, -0.005844992119818926, -0.029820552095770836, 0.07079851627349854, -0.14820435643196106, -0.0382741317152977, -0.0017283628694713116, 0.06520936638116837, -0.09621611982584, 0.03245760500431061, -0.06794793158769608, 0.13676413893699646, 0.05963125079870224, 0.055891457945108414, -0.04851596802473068, 0.062247857451438904, -0.009839486330747604, 0.10010768473148346, -0.013762730173766613, -0.03916085138916969, 0.011940580792725086, -0.001742257270962, 0.03489740192890167, -0.02043936587870121, -0.004507469013333321, -0.09508876502513885, 0.14828528463840485, -0.035842761397361755, -0.05736478790640831, 0.02520214393734932, 0.06792627274990082, 0.03304864093661308, -0.018962549045681953, 0.033372920006513596, -5.608244535437734e-8, -0.06784533709287643, -0.007168276235461235, -0.07062879949808121, 0.045168839395046234, -0.04885932803153992, 0.026533925905823708, 0.027768833562731743, 0.04985998570919037, -0.039384666830301285, -0.0362592376768589, -0.022764133289456367, 0.08160720765590668, 0.02014056220650673, 0.043678827583789825, -0.06044875830411911, -0.049131665378808975, -0.12429261952638626, 0.019544217735528946, -0.02672629989683628, -0.03753425553441048, -0.006990922149270773, 0.09950809925794601, 0.005173501092940569, 0.02782725915312767, 0.05360385775566101, 0.05021386593580246, -0.03075077384710312, 0.004075958859175444, 0.030510539188981056, 0.05813496187329292, -0.06383337825536728, 0.0005291493143886328, -0.050791267305612564, -0.035421986132860184, -0.001811053603887558, -0.006324206944555044, 0.030720127746462822, -0.06589625775814056, -0.04712437465786934, -0.024042055010795593, 0.10151971131563187, -0.00414786534383893, -0.03794410824775696, 0.016089120879769325, -0.03713662549853325, 0.0054154787212610245, 0.00196648808196187, -0.03459872305393219, 0.0250210240483284, -0.003908837214112282, 0.0378541573882103, -0.06688619405031204, 0.003657568246126175, -0.009482051245868206, -0.033242080360651016, -0.05265006422996521, 0.04368235543370247, 0.012307794764637947, 0.012692689895629883, -0.018258344382047653, 0.058167602866888046, -0.026883043348789215, 0.046390023082494736, -0.03808613866567612 ]
0.033053
[[search-search]] == Search The search API allows you to execute a search query and get back search hits that match the query. The query can either be provided using a simple <>, or using a <>. ["float",id="search-multi-index-type"] === Multi-Index, Multi-Type All search APIs can be applied across multiple types within an index, and across multiple indices with support for the <>. For example, we can search on all documents across all types within the twitter index: [source,js] -------------------------------------------------- GET /twitter/\_search?q=user:kimchy -------------------------------------------------- // CONSOLE // TEST[setup:twitter] We can also search within specific types: [source,js] -------------------------------------------------- GET /twitter/tweet,user/\_search?q=user:kimchy -------------------------------------------------- // CONSOLE // TEST[setup:twitter] We can also search all tweets with a certain tag across several indices (for example, when each user has his own index): [source,js] -------------------------------------------------- GET /kimchy,elasticsearch/\_search?q=tag:wow -------------------------------------------------- // CONSOLE // TEST[s/^/PUT kimchy\nPUT elasticsearch\n/] Or we can search all tweets across all available indices using `\_all` placeholder: [source,js] -------------------------------------------------- GET /\_all/\_search?q=tag:wow -------------------------------------------------- // CONSOLE // TEST[setup:twitter] Or even search across all indices and all types: [source,js] -------------------------------------------------- GET /\_search?q=tag:wow -------------------------------------------------- // CONSOLE // TEST[setup:twitter]
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/search.asciidoc
6.2
elasticsearch-6-2
[ -0.03200649097561836, 0.06247922405600548, -0.015975365415215492, 0.09094427525997162, 0.04037468507885933, 0.026170238852500916, 0.02208922989666462, -0.0008244389900937676, 0.06846839934587479, -0.09104031324386597, -0.0450524277985096, -0.06135282292962074, 0.06261022388935089, -0.016039440408349037, 0.0555184967815876, -0.01367239560931921, -0.03753416985273361, 0.012350278906524181, -0.009336850605905056, -0.07163642346858978, 0.04644966870546341, 0.03393445909023285, 0.008394323289394379, 0.004244648851454258, -0.07131090015172958, -0.043812286108732224, -0.05991283059120178, -0.1145763024687767, 0.053708888590335846, 0.10132835805416107, -0.033074669539928436, 0.059785015881061554, -0.08481284976005554, 0.06663183122873306, -0.082229383289814, 0.01689009554684162, -0.09327980130910873, -0.003830856643617153, 0.052619971334934235, -0.005262794438749552, 0.024004654958844185, -0.002797110937535763, -0.059591058641672134, -0.05351393297314644, -0.004228079225867987, -0.05157049000263214, -0.04941973835229874, -0.03557320311665535, -0.045299503952264786, 0.025384729728102684, -0.08065271377563477, -0.011504590511322021, -0.05897996947169304, 0.05385592579841614, 0.030821658670902252, -0.01755099557340145, -0.08350429683923721, 0.019123027101159096, 0.09111391007900238, -0.03275628387928009, 0.05284823477268219, -0.03932877257466316, 0.03933499753475189, -0.0352051705121994, 0.06622276455163956, -0.02045917883515358, -0.04898131638765335, -0.004228151869028807, 0.019870039075613022, -0.09030958265066147, 0.049129560589790344, -0.0014183660969138145, 0.0037706971634179354, -0.0006879452848806977, 0.05548255890607834, -0.02316141128540039, 0.015759067609906197, -0.04251932352781296, -0.023585882037878036, 0.08289562910795212, -0.05928780883550644, -0.09045945107936859, -0.028759866952896118, 0.037514787167310715, 0.07262012362480164, -0.02211170457303524, -0.023303339257836342, -0.08176462352275848, 0.07676546275615692, -0.0003599304473027587, -0.009728264063596725, -0.03245604783296585, 0.0005335873574949801, -0.023597784340381622, 0.10042275488376617, 0.02757217548787594, -0.023644719272851944, -0.0040910085663199425, 0.08410022407770157, -0.008840491063892841, -0.030919929966330528, -0.0163947232067585, 0.03329693153500557, -0.0019207301083952188, -0.021831689402461052, 0.0007439501932822168, 0.06118826940655708, -0.012138665653765202, 0.00942083541303873, -0.053621795028448105, -0.050083283334970474, 0.024599319323897362, 0.009221545420587063, -0.028023842722177505, -0.020826848223805428, 0.020937828347086906, -0.01653885282576084, -0.03048895299434662, 0.09529583901166916, 0.0814044326543808, 0.011509883217513561, 0.028053434565663338, 0.007154372055083513, -0.04056801274418831, 0.06585156172513962, 0.09668571501970291, -0.03194883465766907, -1.429223543709206e-34, 0.06040700525045395, -0.001345376716926694, -0.005878244526684284, -0.030020004138350487, -0.04448655992746353, 0.05798680707812309, 0.006581324618309736, 0.0334826335310936, -0.07684765756130219, -0.01637517847120762, -0.06138031557202339, 0.10722773522138596, -0.08570202440023422, 0.0026477945502847433, 0.01847677119076252, 0.02004614844918251, -0.004787703510373831, 0.001766819041222334, -0.036689262837171555, -0.0016210894100368023, 0.020721597597002983, 0.05282169580459595, -0.016110530123114586, 0.02809378132224083, 0.03422597795724869, -0.004501585382968187, -0.025566568598151207, -0.06173795089125633, -0.07091425359249115, 0.008536322973668575, -0.05372201278805733, 0.0070158024318516254, -0.056979428976774216, -0.019542839378118515, 0.07795609533786774, 0.08386467397212982, -0.08132141083478928, 0.10962070524692535, -0.07874145358800888, -0.019274434074759483, -0.02999967709183693, 0.019189966842532158, 0.04339409992098808, -0.13305535912513733, -0.07294443249702454, 0.0177201759070158, -0.1172233521938324, 0.017309287562966347, 0.024232834577560425, -0.04145486652851105, -0.030544545501470566, 0.09977778792381287, -0.06207622215151787, -0.017910929396748543, 0.12889611721038818, 0.010395292192697525, 0.044267404824495316, 0.09461328387260437, 0.03463628143072128, 0.038829255849123, 0.0018464747117832303, -0.03807082772254944, 0.04377647861838341, -0.00713682547211647, -0.024899307638406754, 0.031633470207452774, -0.032148607075214386, 0.02497445046901703, 0.05212562531232834, 0.03760940209031105, 0.06623879075050354, 0.049689702689647675, 0.05143412947654724, -0.002541226800531149, -0.011642512865364552, -0.08662225306034088, -0.07414621859788895, -0.04184882342815399, 0.018689800053834915, -0.002935679629445076, -0.015181292779743671, -0.06090625002980232, 0.02139272540807724, 0.005923077464103699, -0.007804292719811201, 0.030791031196713448, -0.05677123740315437, -0.09347674995660782, 0.008436108008027077, -0.060853082686662674, -0.041819099336862564, 0.05784318223595619, -0.12542010843753815, -0.12809592485427856, -0.042017992585897446, -3.232977541429892e-33, -0.016652457416057587, -0.06437859684228897, 0.005166913382709026, -0.023889625445008278, -0.012229102663695812, -0.042605407536029816, 0.03969850763678551, -0.09988497197628021, 0.0291745588183403, 0.06746665388345718, 0.03163347393274307, -0.026294443756341934, -0.06770814955234528, -0.057639531791210175, -0.025353064760565758, 0.09909700602293015, -0.0467785969376564, -0.05768876522779465, 0.014485688880085945, 0.008009960874915123, -0.06611187756061554, -0.031798191368579865, -0.028805531561374664, 0.11021836847066879, -0.05187602341175079, -0.026046378538012505, 0.05085635557770729, 0.06743115931749344, -0.04522538557648659, 0.0017115157097578049, -0.052112579345703125, -0.06783144921064377, -0.018262818455696106, 0.029630452394485474, -0.053685013204813004, -0.015990903601050377, 0.013863899745047092, 0.027417782694101334, 0.0228742565959692, 0.033047400414943695, 0.050551868975162506, -0.06714238226413727, 0.06506911665201187, 0.04708134010434151, -0.026010051369667053, 0.019564345479011536, -0.04476795345544815, 0.05990628898143768, 0.013663014397025108, -0.05781397223472595, 0.09323766082525253, -0.022940421476960182, -0.0067423321306705475, 0.011228819377720356, -0.03465428948402405, -0.08060543984174728, -0.02789282612502575, 0.02298613078892231, -0.07657646387815475, -0.0004826429358217865, 0.009394358843564987, -0.045387089252471924, 0.019367648288607597, 0.08993612974882126, -0.03496941924095154, -0.12053936719894409, -0.03998606279492378, -0.07440730929374695, -0.06766513735055923, -0.013355450704693794, 0.01083370577543974, -0.07801920920610428, 0.11895322054624557, -0.025185780599713326, 0.0026620354037731886, -0.027316967025399208, 0.05847149342298508, 0.04553849250078201, 0.08829498291015625, -0.04249786213040352, -0.009324165061116219, 0.041265472769737244, 0.054004739969968796, 0.04676845669746399, -0.03494395688176155, 0.03595875948667526, -0.04239029437303543, 0.11483410745859146, -0.05247017368674278, -0.02570756897330284, -0.0012383859138935804, 0.01372505258768797, -0.03306550532579422, -0.04072360694408417, 0.05775518715381622, -5.4298439522426634e-8, -0.05738747492432594, -0.05485609173774719, -0.12195272743701935, 0.024922534823417664, -0.025214875116944313, 0.06909430027008057, 0.0014540357515215874, 0.04368925467133522, -0.036381933838129044, 0.002209434984251857, -0.018871648237109184, 0.04507496953010559, 0.005315745249390602, 0.008660062216222286, 0.013830583542585373, -0.06849120557308197, -0.03903881460428238, -0.06396947801113129, -0.0050314744003117085, 0.01385357417166233, -0.021774007007479668, 0.025300564244389534, 0.010132024995982647, -0.009363753721117973, 0.09252958744764328, 0.08180159330368042, -0.06140284612774849, 0.010419193655252457, 0.041519053280353546, 0.04962403327226639, 0.003089751349762082, 0.01520340982824564, -0.05400845408439636, -0.00010166369611397386, 0.042429473251104355, 0.0323055237531662, 0.03877878189086914, 0.008378538303077221, -0.09501936286687851, 0.04055190086364746, 0.05649717152118683, 0.01717754825949669, -0.027984067797660828, -0.012222502380609512, 0.017284652218222618, 0.023384565487504005, -0.0030678515322506428, -0.0038688520435243845, 0.12231555581092834, 0.03301655501127243, -0.03607439994812012, -0.058438703417778015, -0.011450975202023983, 0.08341819792985916, -0.027994362637400627, -0.04410061612725258, 0.0033194508869200945, 0.002282007597386837, 0.05071466043591499, -0.018139749765396118, 0.11757297813892365, -0.0838812068104744, 0.026455329731106758, 0.058527108281850815 ]
0.071202
[[search-count]] == Count API The count API allows to easily execute a query and get the number of matches for that query. It can be executed across one or more indices and across one or more types. The query can either be provided using a simple query string as a parameter, or using the <> defined within the request body. Here is an example: [source,js] -------------------------------------------------- PUT /twitter/\_doc/1?refresh { "user": "kimchy" } GET /twitter/\_doc/\_count?q=user:kimchy GET /twitter/\_doc/\_count { "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- //CONSOLE NOTE: The query being sent in the body must be nested in a `query` key, same as the <> works Both examples above do the same thing, which is count the number of tweets from the `twitter` index for a certain user. The result is: [source,js] -------------------------------------------------- { "count" : 1, "\_shards" : { "total" : 5, "successful" : 5, "skipped" : 0, "failed" : 0 } } -------------------------------------------------- // TESTRESPONSE The query is optional, and when not provided, it will use `match\_all` to count all the docs. [float] === Multi index, Multi type The count API can be applied to <>. [float] === Request Parameters When executing count using the query parameter `q`, the query passed is a query string using Lucene query parser. There are additional parameters that can be passed: [cols="<,<",options="header",] |======================================================================= |Name |Description |`df` |The default field to use when no field prefix is defined within the query. |`analyzer` |The analyzer name to be used when analyzing the query string. |`default\_operator` |The default operator to be used, can be `AND` or `OR`. Defaults to `OR`. |`lenient` |If set to true will cause format based failures (like providing text to a numeric field) to be ignored. Defaults to false. |`analyze\_wildcard` |Should wildcard and prefix queries be analyzed or not. Defaults to `false`. |`terminate\_after` |The maximum count for each shard, upon reaching which the query execution will terminate early. If set, the response will have a boolean field `terminated\_early` to indicate whether the query execution has actually terminated\_early. Defaults to no terminate\_after. |======================================================================= [float] === Request Body The count can use the <> within its body in order to express the query that should be executed. The body content can also be passed as a REST parameter named `source`. Both HTTP GET and HTTP POST can be used to execute count with body. Since not all clients support GET with body, POST is allowed as well. [float] === Distributed The count operation is broadcast across all shards. For each shard id group, a replica is chosen and executed against it. This means that replicas increase the scalability of count. [float] === Routing The routing value (a comma separated list of the routing values) can be specified to control which shards the count request will be executed on.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/count.asciidoc
6.2
elasticsearch-6-2
[ 0.0010329040233045816, 0.03803962841629982, 0.004597800783813, 0.11528506129980087, -0.04578284174203873, 0.07942706346511841, 0.009074350818991661, 0.03494169935584068, 0.1144568994641304, -0.04936365783214569, -0.021264007315039635, -0.07227173447608948, 0.09979664534330368, -0.05191608518362045, 0.011744518764317036, 0.024144431576132774, -0.10024459660053253, -0.01814970187842846, 0.031034165993332863, -0.12452772259712219, 0.07126396894454956, 0.0729348212480545, 0.00903667788952589, -0.029105352237820625, 0.01378696970641613, -0.03560780733823776, -0.08770280331373215, -0.0973290428519249, 0.04316564276814461, 0.11328938603401184, -0.03919834643602371, 0.04223005846142769, -0.06053689867258072, 0.0628112182021141, -0.04968373104929924, -0.02817220613360405, -0.10558623820543289, -0.08440042287111282, 0.0662459209561348, 0.04014145955443382, 0.014032522216439247, -0.009989584796130657, -0.059280216693878174, -0.05508777126669884, 0.01638944074511528, 0.022938156500458717, -0.034913886338472366, 0.032610658556222916, -0.07358051836490631, 0.05836571380496025, -0.03600446507334709, 0.02010471746325493, -0.07107905298471451, 0.046375516802072525, 0.08433022350072861, -0.03542731702327728, -0.10450387746095657, 0.005890681874006987, -0.02242450788617134, -0.030324744060635567, 0.026368984952569008, -0.15173527598381042, 0.013263148255646229, -0.04905242845416069, -0.06420796364545822, -0.002742314012721181, -0.039226848632097244, 0.014663591049611568, 0.09107331931591034, -0.01881176233291626, 0.025144701823592186, 0.027509909123182297, 0.017602063715457916, -0.04903708025813103, -0.03358088433742523, -0.031603872776031494, -0.013487543910741806, 0.00033984932815656066, -0.02010016143321991, 0.034668270498514175, -0.06971072405576706, -0.10810390114784241, -0.03494878113269806, 0.02486412227153778, 0.01725986786186695, -0.006051066797226667, 0.023771755397319794, -0.09788762778043747, 0.00593196926638484, -0.05022222176194191, 0.024627510458230972, 0.019903449341654778, 0.017097236588597298, -0.021919453516602516, 0.0503549799323082, 0.030690953135490417, -0.06188575178384781, 0.03731018304824829, 0.050802428275346756, 0.01712634600698948, -0.039068803191185, -0.038869865238666534, -0.010280543938279152, -0.055020589381456375, -0.06377632170915604, 0.045098111033439636, 0.001433282857760787, 0.033272597938776016, -0.018807612359523773, 0.042174726724624634, -0.026000283658504486, 0.04209919646382332, 0.050271112471818924, 0.020530352368950844, -0.00005556131145567633, -0.011548181064426899, 0.09634394198656082, -0.03641577064990997, 0.09765107184648514, 0.08749177306890488, 0.09926333278417587, 0.037033528089523315, 0.004532052204012871, -0.08412842452526093, -0.006172800902277231, 0.06498462706804276, 0.05270441994071007, 6.790284443498215e-34, 0.09702980518341064, 0.01699039898812771, 0.0022388321813195944, -0.0150006003677845, -0.03792991116642952, 0.026395006105303764, 0.05081089958548546, 0.08728164434432983, -0.06209564954042435, -0.02719416469335556, -0.06357540935277939, 0.08468130975961685, -0.026067208498716354, -0.037929415702819824, -0.011655867099761963, -0.01672176457941532, 0.00400117039680481, -0.014315611682832241, -0.019689155742526054, 0.03807605057954788, 0.03624538704752922, -0.025262750685214996, -0.014375605620443821, 0.04963311180472374, -0.00528141763061285, 0.010403089225292206, -0.003233476774767041, -0.03468077629804611, -0.07721006870269775, -0.0307001993060112, 0.015372850932180882, 0.0034903257619589567, -0.02095734141767025, -0.025576258078217506, 0.08145338296890259, 0.009883162565529346, -0.02286740392446518, 0.09917712211608887, -0.08882775902748108, -0.045409318059682846, -0.0441117063164711, 0.03948607295751572, 0.018699631094932556, -0.12390825152397156, -0.11915872246026993, -0.01376800611615181, -0.04239622503519058, -0.026602627709507942, -0.009159605950117111, 0.014319577254354954, 0.038046274334192276, 0.06988191604614258, -0.039600227028131485, 0.028487762436270714, 0.08491002023220062, -0.020924681797623634, -0.007103319279849529, 0.11299022287130356, 0.022936927154660225, 0.07849600166082382, 0.007912340573966503, -0.01872522011399269, 0.11618676781654358, 0.006257600616663694, 0.06453002244234085, 0.046287283301353455, -0.017236752435564995, 0.11985442787408829, -0.01196265872567892, 0.06432896107435226, 0.08881011605262756, 0.07354068011045456, 0.004815166816115379, -0.03727605193853378, -0.012615188024938107, -0.10254867374897003, -0.051226112991571426, -0.023026974871754646, -0.058008722960948944, 0.05043771117925644, 0.02216481976211071, -0.1091127023100853, 0.003261308651417494, 0.035175833851099014, -0.020225439220666885, 0.08793213218450546, -0.0408877432346344, -0.02312154322862625, -0.03312867879867554, -0.03743671625852585, 0.049296751618385315, -0.03488711267709732, -0.10125662386417389, -0.09822327643632889, -0.07808300852775574, -2.821503274435235e-33, 0.020536672323942184, -0.07104498893022537, 0.009077474474906921, -0.006994520779699087, 0.022240877151489258, -0.06202515587210655, 0.04591943323612213, 0.04137851297855377, 0.0009051813976839185, 0.03873481974005699, 0.07323770970106125, 0.02372186817228794, 0.009649758227169514, -0.003489516442641616, 0.017871489748358727, 0.010061077773571014, -0.053490787744522095, -0.029034335166215897, -0.009660045616328716, 0.02404952049255371, -0.05210387334227562, -0.052884235978126526, -0.06874566525220871, 0.05046592280268669, -0.053673695772886276, 0.0028410875238478184, 0.02778860181570053, -0.013773920945823193, -0.05228106305003166, -0.003770354436710477, 0.04312881827354431, -0.06477418541908264, -0.012882240116596222, 0.042582135647535324, -0.014976346865296364, -0.026653096079826355, 0.021812882274389267, 0.07021595537662506, 0.03255007416009903, 0.06959575414657593, 0.050956159830093384, -0.013570762239396572, 0.03991398960351944, 0.019713323563337326, -0.019469358026981354, -0.01895899698138237, -0.02308964543044567, 0.067498117685318, -0.025490786880254745, -0.08014830946922302, 0.07074879109859467, 0.022640032693743706, -0.04215268790721893, 0.0370853990316391, -0.04935780167579651, -0.1219329833984375, -0.03518848866224289, -0.04180478677153587, -0.04523981362581253, -0.005563873331993818, -0.060391753911972046, -0.009573370218276978, -0.023552976548671722, 0.036969128996133804, -0.010213902220129967, -0.10313133895397186, -0.08080336451530457, -0.05199403688311577, -0.025357134640216827, 0.014445916749536991, 0.01883069798350334, -0.04998338595032692, 0.035065632313489914, 0.019065989181399345, 0.025345230475068092, -0.00955632608383894, -0.0007026140810921788, -0.015047184191644192, 0.027929196134209633, 0.01813984476029873, -0.05322027951478958, -0.02098812162876129, 0.06159039959311485, 0.04632316529750824, -0.041336458176374435, 0.03468362241983414, -0.017325444146990776, 0.10216286033391953, -0.04624471813440323, -0.007029541302472353, 0.02409888431429863, -0.05069844424724579, -0.06590110808610916, -0.05939310044050217, 0.026004012674093246, -5.1488402874610983e-8, -0.09704151004552841, -0.04096674174070358, -0.05940676108002663, 0.04873955622315407, -0.00040910151437856257, 0.10944170504808426, 0.0029143907595425844, 0.05678246170282364, -0.05757744610309601, -0.001132009900175035, 0.014118464663624763, 0.04236987233161926, -0.02087687887251377, 0.015315389260649681, -0.03079601749777794, -0.04403208941221237, -0.007215755991637707, 0.018525641411542892, 0.011303302831947803, 0.005640481598675251, -0.046387456357479095, 0.003254608018323779, 0.027609344571828842, -0.03712211176753044, 0.09916168451309204, 0.02535022608935833, 0.00088071683421731, 0.06081128865480423, -0.011406537145376205, -0.013613561168313026, -0.001374589977785945, 0.0025404104962944984, -0.06378833949565887, -0.017180847004055977, 0.030175969004631042, 0.01144955214112997, -0.024745961651206017, -0.01107749529182911, -0.07875695824623108, 0.04139634966850281, 0.04556981101632118, -0.00862286239862442, -0.030650392174720764, 0.07400776445865631, 0.0009918393334373832, -0.015138729475438595, -0.0024615449365228415, -0.08658727258443832, 0.11146808415651321, -0.07472419738769531, 0.033535122871398926, -0.09264072775840759, -0.009368611499667168, 0.01219305582344532, -0.09390789270401001, -0.0032005824614316225, 0.005258352030068636, 0.015680521726608276, 0.037109602242708206, -0.0028628043364733458, 0.1107182577252388, -0.024129003286361694, 0.014722109772264957, 0.04797950014472008 ]
0.064286
[[search-validate]] == Validate API The validate API allows a user to validate a potentially expensive query without executing it. We'll use the following test data to explain \_validate: [source,js] -------------------------------------------------- PUT twitter/\_doc/\_bulk?refresh {"index":{"\_id":1}} {"user" : "kimchy", "post\_date" : "2009-11-15T14:12:12", "message" : "trying out Elasticsearch"} {"index":{"\_id":2}} {"user" : "kimchi", "post\_date" : "2009-11-15T14:12:13", "message" : "My username is similar to @kimchy!"} -------------------------------------------------- // CONSOLE // TESTSETUP When sent a valid query: [source,js] -------------------------------------------------- GET twitter/\_validate/query?q=user:foo -------------------------------------------------- // CONSOLE The response contains `valid:true`: [source,js] -------------------------------------------------- {"valid":true,"\_shards":{"total":1,"successful":1,"failed":0}} -------------------------------------------------- // TESTRESPONSE [float] === Request Parameters When executing exists using the query parameter `q`, the query passed is a query string using Lucene query parser. There are additional parameters that can be passed: [cols="<,<",options="header",] |======================================================================= |Name |Description |`df` |The default field to use when no field prefix is defined within the query. |`analyzer` |The analyzer name to be used when analyzing the query string. |`default\_operator` |The default operator to be used, can be `AND` or `OR`. Defaults to `OR`. |`lenient` |If set to true will cause format based failures (like providing text to a numeric field) to be ignored. Defaults to false. |`analyze\_wildcard` |Should wildcard and prefix queries be analyzed or not. Defaults to `false`. |======================================================================= The query may also be sent in the request body: [source,js] -------------------------------------------------- GET twitter/\_doc/\_validate/query { "query" : { "bool" : { "must" : { "query\_string" : { "query" : "\*:\*" } }, "filter" : { "term" : { "user" : "kimchy" } } } } } -------------------------------------------------- // CONSOLE NOTE: The query being sent in the body must be nested in a `query` key, same as the <> works If the query is invalid, `valid` will be `false`. Here the query is invalid because Elasticsearch knows the post\_date field should be a date due to dynamic mapping, and 'foo' does not correctly parse into a date: [source,js] -------------------------------------------------- GET twitter/\_doc/\_validate/query { "query": { "query\_string": { "query": "post\_date:foo", "lenient": false } } } -------------------------------------------------- // CONSOLE [source,js] -------------------------------------------------- {"valid":false,"\_shards":{"total":1,"successful":1,"failed":0}} -------------------------------------------------- // TESTRESPONSE An `explain` parameter can be specified to get more detailed information about why a query failed: [source,js] -------------------------------------------------- GET twitter/\_doc/\_validate/query?explain=true { "query": { "query\_string": { "query": "post\_date:foo", "lenient": false } } } -------------------------------------------------- // CONSOLE responds with: [source,js] -------------------------------------------------- { "valid" : false, "\_shards" : { "total" : 1, "successful" : 1, "failed" : 0 }, "explanations" : [ { "index" : "twitter", "valid" : false, "error" : "twitter/IAEc2nIXSSunQA\_suI0MLw] QueryShardException[failed to create query:...failed to parse date field [foo]" } ] } -------------------------------------------------- // TESTRESPONSE[s/"error" : "[^\"]+"/"error": "$body.explanations.0.error"/] When the query is valid, the explanation defaults to the string representation of that query. With `rewrite` set to `true`, the explanation is more detailed showing the actual Lucene query that will be executed. For More Like This: [source,js] -------------------------------------------------- GET twitter/\_doc/\_validate/query?rewrite=true { "query": { "more\_like\_this": { "like": { "\_id": "2" }, "boost\_terms": 1 } } } -------------------------------------------------- // CONSOLE // TEST[skip:the output is randomized depending on which shard we hit] Response: [source,js] -------------------------------------------------- { "valid": true, "\_shards": { "total": 1, "successful": 1, "failed": 0 }, "explanations": [ { "index": "twitter", "valid": true, "explanation": "((user:terminator^3.71334 plot:future^2.763601 plot:human^2.8415773 plot:sarah^3.4193945 plot:kyle^3.8244398 plot:cyborg^3.9177752 plot:connor^4.040236 plot:reese^4.7133346 ... )~6) -ConstantScore(\_uid:tweet#2)) #(ConstantScore(\_type:tweet))^0.0" } ] } -------------------------------------------------- // TESTRESPONSE By default, the request is executed on a single shard only, which is randomly selected. The detailed explanation of the query may depend on which shard is being hit, and therefore may vary from one request to another. So, in case of query rewrite the `all\_shards` parameter should be used to get response from all available shards. For Fuzzy Queries: [source,js] -------------------------------------------------- GET twitter/\_doc/\_validate/query?rewrite=true&all\_shards=true { "query": { "match": { "user":
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/validate.asciidoc
6.2
elasticsearch-6-2
[ -0.05114731937646866, 0.08857626467943192, 0.028816720470786095, 0.07587142288684845, 0.016069777309894562, -0.037434451282024384, -0.005673892796039581, -0.011386929079890251, 0.06867647171020508, -0.03785876929759979, -0.016339169815182686, -0.06355368345975876, 0.05401024967432022, -0.01792224310338497, -0.00562307657673955, 0.010549415834248066, -0.026621734723448753, -0.018833564594388008, -0.05874110013246536, -0.09707210958003998, 0.044336434453725815, 0.04349011927843094, -0.043953534215688705, 0.002378122415393591, 0.0030478760600090027, -0.024267204105854034, -0.05481551215052605, -0.061816100031137466, 0.007228856440633535, 0.05962539464235306, -0.0006097748992033303, -0.03969259932637215, -0.07516124844551086, 0.03331369906663895, 0.012985669076442719, 0.05965124070644379, -0.057513151317834854, -0.059983544051647186, 0.040270160883665085, 0.04799577593803406, 0.015025465749204159, -0.0823492482304573, -0.09037737548351288, -0.04903921112418175, -0.02152634784579277, -0.06333101540803909, 0.029515858739614487, -0.0063100880943238735, -0.07328715920448303, 0.05668944865465164, -0.09391544759273529, -0.03986029326915741, -0.02726428024470806, -0.010483765043318272, -0.006097758188843727, 0.032325394451618195, -0.08978423476219177, 0.06038672477006912, -0.00695231044664979, -0.10879523307085037, 0.0639246329665184, -0.12896811962127686, 0.04879745841026306, -0.016131512820720673, -0.02671760879456997, -0.04230857267975807, -0.05434916540980339, -0.01099642738699913, 0.06658607721328735, -0.02934548258781433, 0.09802892804145813, 0.02137240208685398, -0.08321534097194672, 0.054610226303339005, 0.027964385226368904, 0.015301582403481007, 0.004955293145030737, -0.03316853567957878, -0.013887934386730194, 0.0641363188624382, -0.07067568600177765, -0.08909543603658676, -0.039570022374391556, -0.024140838533639908, -0.02547059953212738, -0.03582549840211868, 0.019734740257263184, -0.04456082731485367, 0.011647181585431099, -0.03516615554690361, 0.04392151162028313, 0.020192449912428856, 0.039403051137924194, -0.00952088087797165, 0.04022251069545746, 0.059802282601594925, -0.11105483025312424, 0.013799984939396381, 0.06416458636522293, 0.06308383494615555, -0.04121128469705582, 0.012672796845436096, -0.06060461327433586, -0.023410722613334656, 0.06504471600055695, 0.0012290924787521362, 0.0100523941218853, 0.023183424025774002, -0.03343147784471512, 0.041732657700777054, -0.018411291763186455, 0.06952589005231857, 0.041863203048706055, 0.0016395073616877198, 0.0357002429664135, 0.06534745544195175, 0.039813246577978134, 0.003778281155973673, 0.0459224171936512, 0.06575991213321686, 0.08543571084737778, -0.026944328099489212, 0.0116459671407938, -0.07590093463659286, 0.021154632791876793, 0.036150697618722916, 0.04308108240365982, 2.4761233813674692e-33, 0.0998247042298317, 0.0629565492272377, 0.02058572880923748, -0.06356033682823181, -0.063475102186203, 0.02021719329059124, 0.002210515784099698, 0.044069159775972366, -0.06659844517707825, -0.04364288970828056, -0.07593996822834015, 0.055561505258083344, 0.009760189801454544, -0.03635197877883911, -0.031463298946619034, -0.005717766936868429, 0.00036761281080543995, 0.029372679069638252, 0.04870256781578064, 0.021883321925997734, 0.06329679489135742, -0.08048278838396072, -0.0029873130843043327, 0.024999503046274185, -0.05800320953130722, -0.04673872888088226, 0.05080515891313553, -0.026607567444443703, -0.028434762731194496, -0.00773489847779274, -0.07203418016433716, 0.022851860150694847, 0.00023857485211919993, 0.011947805993258953, 0.07526662945747375, 0.03744880482554436, -0.0537559799849987, 0.05424810200929642, -0.06471657752990723, -0.015615087933838367, 0.04622720554471016, 0.04002251848578453, -0.01067949179559946, -0.040294449776411057, -0.082041896879673, -0.0029037506319582462, -0.043631020933389664, -0.02673187665641308, 0.023709379136562347, -0.01756448484957218, -0.021122276782989502, 0.04623064771294594, -0.002262465190142393, -0.02804318442940712, -0.0032956721261143684, -0.03706147521734238, 0.016129011288285255, 0.08667135238647461, 0.0364852100610733, -0.0028288266621530056, 0.04798787459731102, -0.0378289669752121, 0.08422766625881195, 0.055902764201164246, 0.055183567106723785, -0.032540515065193176, 0.00976339727640152, 0.092376708984375, -0.0522923544049263, 0.011432603001594543, 0.0746408998966217, 0.049544043838977814, 0.060711074620485306, -0.0509130023419857, -0.014959489926695824, -0.19427801668643951, 0.0372767336666584, 0.04204442724585533, -0.009765502996742725, 0.003178783692419529, 0.04882727935910225, -0.1346711367368698, -0.06581473350524902, 0.03552105277776718, -0.07719656825065613, 0.07013370841741562, -0.049531660974025726, 0.03470617160201073, -0.008046875707805157, -0.020954404026269913, -0.02018670178949833, 0.02471030503511429, -0.11258554458618164, -0.0913626030087471, -0.04702003300189972, -3.0392755415395644e-33, 0.05535141006112099, -0.09439441561698914, 0.012122885324060917, 0.02261342667043209, 0.0454724095761776, -0.060570091009140015, 0.05139009654521942, 0.0835471823811531, -0.03745517134666443, 0.00893800426274538, 0.025973789393901825, -0.08487717062234879, 0.002768593607470393, -0.03434514254331589, -0.034422777593135834, 0.024563055485486984, -0.038978952914476395, -0.05027630180120468, -0.013228164054453373, -0.044644180685281754, -0.04216468706727028, 0.03396864980459213, -0.1283244639635086, 0.10594964027404785, -0.061662789434194565, -0.03826909512281418, -0.0072163469158113, 0.019614767283201218, -0.08029435575008392, 0.032453324645757675, -0.02248128317296505, 0.01524386927485466, -0.04238009825348854, 0.029346156865358353, -0.0484800823032856, 0.021646950393915176, 0.04016796872019768, 0.05034065246582031, 0.03853379935026169, 0.06885083764791489, 0.0373276062309742, 0.07828566431999207, -0.03966473042964935, -0.015905916690826416, 0.019365763291716576, 0.025858784094452858, -0.023569749668240547, 0.005808747839182615, -0.02677616849541664, 0.008628828451037407, 0.042858727276325226, 0.014246522448956966, -0.008424859493970871, 0.0366184301674366, 0.01849074475467205, -0.10398942977190018, -0.047653764486312866, -0.023418394848704338, -0.046783387660980225, 0.007102598436176777, -0.06673845648765564, -0.002823664341121912, 0.0034082538913935423, 0.045403387397527695, 0.03430889919400215, -0.06850966066122055, -0.020519046112895012, -0.052490055561065674, -0.01923205330967903, -0.052720293402671814, 0.06564304977655411, -0.07019025087356567, 0.06280513852834702, 0.019976655021309853, 0.0769420936703682, -0.044952392578125, 0.034856799989938736, 0.001471234834752977, 0.026233842596411705, 0.007918838411569595, -0.04935985058546066, 0.054311688989400864, 0.07899042218923569, 0.07416743040084839, -0.06107800453901291, 0.08234065026044846, -0.04060471057891846, 0.10502690076828003, -0.07559028267860413, 0.053912751376628876, 0.012028655968606472, -0.07822129130363464, -0.061174262315034866, -0.04799383506178856, -0.013633552938699722, -5.532976743438667e-8, -0.04408332332968712, -0.006623936351388693, -0.020879819989204407, 0.1047711968421936, 0.00976607110351324, 0.01822034828364849, 0.04593822732567787, 0.04956015944480896, 0.012212797068059444, -0.06678745150566101, 0.02051216922700405, 0.024760384112596512, -0.032084543257951736, -0.02987849712371826, -0.004701950121670961, -0.0010111603187397122, -0.06618307530879974, -0.007626235485076904, -0.030104564502835274, 0.03923214599490166, 0.0048042540438473225, 0.07259488850831985, 0.029104365035891533, -0.01946132630109787, 0.16813047230243683, 0.08508230745792389, -0.020906846970319748, 0.07232354581356049, 0.020094512030482292, -0.03509359434247017, -0.04734043404459953, -0.04682578146457672, 0.020056013017892838, -0.0375954769551754, -0.003992115613073111, 0.0335228331387043, -0.015948288142681122, -0.013745184987783432, -0.11803886294364929, 0.038303401321172714, 0.042050763964653015, 0.05057399719953537, -0.04832513630390167, 0.012717747129499912, -0.006522392388433218, -0.03192826732993126, -0.054025936871767044, 0.02466086857020855, 0.03572225943207741, -0.03771473467350006, 0.00119428348261863, -0.05543212592601776, 0.0033507938496768475, 0.0665016919374466, -0.05079899728298187, -0.03482046723365784, 0.020717507228255272, -0.000626262160949409, 0.07477616518735886, -0.003841598518192768, 0.1804327517747879, -0.02910890057682991, 0.023752719163894653, -0.0011256512952968478 ]
0.066319
query may depend on which shard is being hit, and therefore may vary from one request to another. So, in case of query rewrite the `all\_shards` parameter should be used to get response from all available shards. For Fuzzy Queries: [source,js] -------------------------------------------------- GET twitter/\_doc/\_validate/query?rewrite=true&all\_shards=true { "query": { "match": { "user": { "query": "kimchy", "fuzziness": "auto" } } } } -------------------------------------------------- // CONSOLE Response: [source,js] -------------------------------------------------- { "valid": true, "\_shards": { "total": 5, "successful": 5, "failed": 0 }, "explanations": [ { "index": "twitter", "shard": 0, "valid": true, "explanation": "user:kimchy~2" }, { "index": "twitter", "shard": 1, "valid": true, "explanation": "user:kimchy~2" }, { "index": "twitter", "shard": 2, "valid": true, "explanation": "(user:kimchi)^0.8333333" }, { "index": "twitter", "shard": 3, "valid": true, "explanation": "user:kimchy" }, { "index": "twitter", "shard": 4, "valid": true, "explanation": "user:kimchy~2" } ] } -------------------------------------------------- // TESTRESPONSE
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/validate.asciidoc
6.2
elasticsearch-6-2
[ 0.02913709357380867, 0.062146224081516266, 0.08169030398130417, 0.05203652381896973, -0.002994186244904995, -0.042444098740816116, 0.0230861809104681, -0.026691045612096786, 0.09210333228111267, -0.030411070212721825, -0.01923637092113495, -0.03446495160460472, 0.02260981872677803, -0.042005375027656555, -0.017866048961877823, 0.020350191742181778, -0.0002416261995676905, -0.03211564943194389, -0.06580657511949539, -0.05249779298901558, 0.03267783671617508, 0.01988285221159458, -0.04471436142921448, -0.015176934190094471, -0.00901061948388815, -0.0833377093076706, -0.08653661608695984, -0.07411297410726547, -0.0011034449562430382, 0.026573050767183304, 0.0006125557702034712, -0.026383142918348312, -0.13657870888710022, 0.026195712387561798, -0.03997476026415825, 0.051378991454839706, -0.02907177433371544, -0.0578312873840332, -0.030494440346956253, 0.008362902328372002, -0.04753052443265915, -0.05520663782954216, -0.1198805421590805, -0.028553415089845657, 0.01933731883764267, -0.056754160672426224, -0.03399300202727318, -0.0036275330930948257, -0.0270083025097847, 0.0638064369559288, -0.11091652512550354, -0.07296310365200043, -0.05059179663658142, 0.0014256344875320792, 0.02426922880113125, 0.04943244159221649, -0.11400001496076584, 0.07455158978700638, 0.021695684641599655, -0.07252424210309982, 0.06343818455934525, -0.13471677899360657, 0.03699188306927681, -0.012250367552042007, 0.014628221280872822, -0.0590042881667614, 0.00936530064791441, 0.004458067938685417, 0.012292025610804558, -0.009895062074065208, 0.06963793188333511, 0.011189006268978119, -0.07667127996683121, -0.013461792841553688, 0.024095965549349785, 0.04620777815580368, -0.03160397708415985, -0.03432231396436691, 0.0021346367429941893, 0.06974738836288452, -0.04142932966351509, -0.07982847094535828, -0.017368284985423088, -0.011328119784593582, 0.06855276226997375, -0.011859738267958164, -0.028957534581422806, -0.05055373162031174, 0.031442251056432724, -0.005462915636599064, -0.00001327524569205707, -0.003896387293934822, 0.09672371298074722, -0.017227785661816597, 0.0354500412940979, 0.030588721856474876, -0.03660038486123085, 0.014382661320269108, 0.06440819054841995, 0.038416989147663116, -0.0035668436903506517, -0.05316640064120293, -0.035974156111478806, -0.06041983887553215, 0.04365355893969536, 0.021157097071409225, -0.08737032860517502, 0.07480468600988388, -0.015971647575497627, 0.022422589361667633, -0.014321673661470413, 0.06455951929092407, 0.0402691550552845, -0.03390185534954071, 0.023417126387357712, 0.055805061012506485, 0.08527915179729462, -0.026612382382154465, -0.013740584254264832, 0.009946276433765888, 0.06536655128002167, 0.045259784907102585, 0.05694181099534035, -0.010771511122584343, -0.0010178260272368789, 0.0003361956332810223, -0.03636723384261131, -7.148614610892196e-34, 0.10597879439592361, 0.04904068261384964, 0.012968895025551319, -0.08729758858680725, -0.00027244846569374204, 0.05986667796969414, -0.018537811934947968, 0.053071390837430954, -0.0448538176715374, -0.0018927016062662005, -0.08961623162031174, 0.06146162375807762, 0.02780655398964882, -0.1264452338218689, -0.060908328741788864, 0.005314534064382315, 0.032312799245119095, 0.05234522745013237, -0.03533761948347092, 0.04771161079406738, 0.013941663317382336, -0.015382213518023491, -0.02046569623053074, 0.06920631229877472, -0.006153361406177282, -0.028271816670894623, 0.011608069762587547, -0.019018754363059998, -0.09774446487426758, -0.006906666327267885, -0.06093471124768257, -0.03281910717487335, 0.03826386481523514, -0.007873854599893093, 0.06271597743034363, 0.02261810563504696, 0.03162825107574463, 0.02253585308790207, -0.08765485137701035, -0.08890561759471893, 0.024681953713297844, 0.040288761258125305, 0.026235442608594894, -0.08696655184030533, -0.0962357223033905, -0.0003405972965992987, -0.07135718315839767, -0.0063782655633986, -0.041477493941783905, -0.04782192409038544, -0.04017026349902153, 0.04836547374725342, 0.019107723608613014, 0.02595440298318863, -0.000626261462457478, -0.037075404077768326, -0.03001827374100685, 0.08304765820503235, 0.021543990820646286, 0.0472152940928936, 0.057983528822660446, -0.04989500716328621, 0.04929375648498535, -0.018872832879424095, 0.024472106248140335, -0.020596593618392944, 0.006757940631359816, 0.11267074942588806, 0.0016436055302619934, 0.04367801174521446, 0.04402656853199005, 0.11949270963668823, -0.0008860587258823216, -0.005068603437393904, -0.048173315823078156, -0.1355818659067154, -0.08192414790391922, 0.024169547483325005, -0.03986964747309685, 0.02973819524049759, -0.031868577003479004, -0.05715153366327286, -0.09569717198610306, 0.06295198947191238, -0.0626806989312172, 0.10204194486141205, 0.023610105738043785, -0.04854760318994522, -0.03834594413638115, 0.0077564772218465805, -0.03516826033592224, -0.02047150768339634, -0.052292242646217346, -0.07434632629156113, -0.06744672358036041, -1.3382239112783709e-33, 0.03053899109363556, -0.08624380081892014, -0.0195205956697464, 0.042914558202028275, 0.024154385551810265, -0.02782021090388298, 0.0716223195195198, 0.022491425275802612, 0.032629478722810745, -0.016073904931545258, 0.04107089340686798, -0.05203252658247948, 0.002932718489319086, -0.044242601841688156, -0.019958095625042915, 0.04907682538032532, -0.007132533006370068, -0.13032762706279755, -0.011972147971391678, 0.00853247381746769, -0.04472150653600693, -0.011702576652169228, -0.06773965060710907, 0.08396810293197632, -0.04868294671177864, 0.03326509892940521, 0.01746433414518833, -0.08082806318998337, -0.07314959168434143, 0.07888218015432358, -0.019673172384500504, -0.03432535007596016, -0.042388755828142166, -0.0006829070043750107, -0.05623849481344223, -0.01684805192053318, -0.047945886850357056, 0.05825938656926155, 0.07183445990085602, 0.08876994997262955, 0.06516072154045105, -0.012279968708753586, -0.03245442733168602, 0.05655984580516815, -0.057698462158441544, 0.024416280910372734, -0.005497480742633343, 0.027219275012612343, 0.024773407727479935, -0.06148960441350937, 0.08875922113656998, -0.0033230630215257406, 0.03263511881232262, 0.1278296262025833, 0.016956813633441925, -0.04745873808860779, -0.03354340419173241, -0.000850165612064302, -0.09740521013736725, 0.038383275270462036, -0.055528637021780014, 0.02392519637942314, -0.00509609654545784, -0.006615669932216406, -0.006837752647697926, -0.029447119683027267, -0.04422636702656746, -0.022144533693790436, 0.013680631294846535, -0.12447479367256165, -0.02313440851867199, -0.03073134645819664, 0.09104325622320175, 0.049081865698099136, 0.09957908093929291, -0.04593760892748833, -0.006619682069867849, -0.02348356693983078, 0.0581020824611187, 0.07586976140737534, -0.06810135394334793, 0.042120564728975296, 0.05791403353214264, 0.07691799849271774, 0.021464329212903976, -0.1120556890964508, -0.04222385957837105, 0.06971907615661621, -0.020525168627500534, 0.010593018494546413, 0.028182795271277428, -0.003656074870377779, -0.043541260063648224, -0.03464272618293762, 0.03278064727783203, -4.910292616955303e-8, -0.023834412917494774, 0.05933377891778946, -0.014748291112482548, 0.07548727840185165, 0.010825918056070805, 0.0431353785097599, 0.08871553093194962, 0.058931864798069, -0.0706067606806755, -0.0009967255173251033, -0.008924669586122036, 0.07769819349050522, 0.003305383026599884, -0.04454265162348747, 0.012970316223800182, -0.03642822429537773, -0.009834684431552887, 0.04203593730926514, -0.03680681809782982, -0.01973174698650837, -0.05355428159236908, 0.01713385432958603, -0.014237118884921074, -0.03398286551237106, 0.09812432527542114, 0.0477297306060791, -0.04166967049241066, -0.026684558019042015, 0.03752335160970688, 0.016468845307826996, -0.07876252382993698, -0.04157025367021561, -0.013931157998740673, -0.02460261806845665, 0.015211092308163643, 0.06506354361772537, -0.07871901243925095, 0.04258615896105766, -0.023966088891029358, 0.045061949640512466, 0.01612965762615204, 0.03226873278617859, -0.01684809848666191, 0.03949899971485138, -0.04591987282037735, -0.052536897361278534, 0.007835221476852894, 0.0038010114803910255, 0.060862086713314056, 0.036332808434963226, 0.06467673927545547, -0.06214890256524086, 0.06648513674736023, 0.007543229963630438, -0.02854524925351143, -0.028639396652579308, 0.07091790437698364, -0.02622346207499504, 0.037618488073349, -0.028007537126541138, 0.14494824409484863, -0.057947788387537, 0.023425500839948654, 0.01930353231728077 ]
-0.017346
[[search-uri-request]] == URI Search A search request can be executed purely using a URI by providing request parameters. Not all search options are exposed when executing a search using this mode, but it can be handy for quick "curl tests". Here is an example: [source,js] -------------------------------------------------- GET twitter/\_search?q=user:kimchy -------------------------------------------------- // CONSOLE // TEST[setup:twitter] And here is a sample response: [source,js] -------------------------------------------------- { "timed\_out": false, "took": 62, "\_shards":{ "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits":{ "total" : 1, "max\_score": 1.3862944, "hits" : [ { "\_index" : "twitter", "\_type" : "\_doc", "\_id" : "0", "\_score": 1.3862944, "\_source" : { "user" : "kimchy", "date" : "2009-11-15T14:12:12", "message" : "trying out Elasticsearch", "likes": 0 } } ] } } -------------------------------------------------- // TESTRESPONSE[s/"took": 62/"took": "$body.took"/] [float] === Parameters The parameters allowed in the URI are: [cols="<,<",options="header",] |======================================================================= |Name |Description |`q` |The query string (maps to the `query\_string` query, see <> for more details). |`df` |The default field to use when no field prefix is defined within the query. |`analyzer` |The analyzer name to be used when analyzing the query string. |`analyze\_wildcard` |Should wildcard and prefix queries be analyzed or not. Defaults to `false`. |`batched\_reduce\_size` | The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. |`default\_operator` |The default operator to be used, can be `AND` or `OR`. Defaults to `OR`. |`lenient` |If set to true will cause format based failures (like providing text to a numeric field) to be ignored. Defaults to false. |`explain` |For each hit, contain an explanation of how scoring of the hits was computed. |`\_source`|Set to `false` to disable retrieval of the `\_source` field. You can also retrieve part of the document by using `\_source\_include` & `\_source\_exclude` (see the <> documentation for more details) |`stored\_fields` |The selective stored fields of the document to return for each hit, comma delimited. Not specifying any value will cause no fields to return. |`sort` |Sorting to perform. Can either be in the form of `fieldName`, or `fieldName:asc`/`fieldName:desc`. The fieldName can either be an actual field within the document, or the special `\_score` name to indicate sorting based on scores. There can be several `sort` parameters (order is important). |`track\_scores` |When sorting, set to `true` in order to still track scores and return them as part of each hit. |`track\_total\_hits` |Set to `false` in order to disable the tracking of the total number of hits that match the query. (see <> for more details). Defaults to true. |`timeout` |A search timeout, bounding the search request to be executed within the specified time value and bail with the hits accumulated up to that point when expired. Defaults to no timeout. |`terminate\_after` |The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. If set, the response will have a boolean field `terminated\_early` to indicate whether the query execution has actually terminated\_early. Defaults to no terminate\_after. |`from` |The starting from index of the hits to return. Defaults to `0`. |`size` |The number of hits to return. Defaults to `10`. |`search\_type` |The type of the search operation to perform. Can be `dfs\_query\_then\_fetch` or `query\_then\_fetch`. Defaults to `query\_then\_fetch`. See <> for more details on the different types of search that can be performed. |=======================================================================
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/uri-request.asciidoc
6.2
elasticsearch-6-2
[ -0.06645991653203964, 0.10758204013109207, -0.04158025607466698, 0.04451233893632889, -0.011153732426464558, -0.04776106774806976, -0.032885316759347916, -0.01751822978258133, 0.04066813364624977, -0.08332082629203796, -0.0063276332803070545, -0.023749494925141335, 0.027799295261502266, -0.05802339315414429, 0.04157270863652229, -0.03655926510691643, -0.004357135389000177, -0.007320036180317402, -0.02143203280866146, -0.0836082324385643, 0.042459335178136826, 0.02069462276995182, 0.013174899853765965, -0.062168776988983154, -0.06805124133825302, -0.06648683547973633, -0.03270268812775612, -0.09340330213308334, 0.04220396652817726, 0.0625278577208519, 0.071947380900383, 0.007811089511960745, -0.06646953523159027, 0.030296040698885918, -0.013301609084010124, 0.03553967922925949, -0.07004275918006897, -0.028077909722924232, 0.011224937625229359, 0.012638253159821033, 0.008656658232212067, -0.0396418422460556, -0.07898563891649246, -0.039897844195365906, -0.018719902262091637, -0.02974316105246544, -0.03257935866713524, -0.02570629119873047, -0.08810887485742569, -0.017266130074858665, -0.08419180661439896, -0.010492540895938873, -0.03648192062973976, -0.00522968266159296, 0.012466615065932274, -0.046574488282203674, -0.07448966056108475, 0.003732561832293868, 0.07017488032579422, -0.011435951106250286, 0.0036064169835299253, -0.10547055304050446, 0.024507980793714523, 0.011496116407215595, -0.007455715909600258, -0.005771508440375328, -0.04700501263141632, -0.024431655183434486, 0.04129461944103241, -0.05120733380317688, 0.007878263480961323, -0.03444709628820419, -0.09182398021221161, -0.02648390270769596, 0.04355175048112869, 0.027224311605095863, -0.011144223622977734, -0.02762337028980255, -0.0748552680015564, 0.04847826063632965, 0.009516982361674309, -0.10820378363132477, -0.008277062326669693, 0.08963985741138458, 0.03819703310728073, 0.05836520716547966, 0.005024236626923084, -0.0555322989821434, 0.08303797990083694, -0.006120003759860992, 0.02429795078933239, -0.008187854662537575, -0.0655481368303299, -0.03260185942053795, 0.0393676720559597, 0.025902623310685158, -0.020942075178027153, -0.08863884210586548, -0.01861896924674511, -0.005832124035805464, 0.03309524431824684, -0.06240818649530411, 0.03534163907170296, -0.03967693820595741, -0.03155887871980667, 0.008787613362073898, 0.040239255875349045, 0.041882358491420746, 0.0981299877166748, 0.03089773654937744, -0.07569039613008499, 0.012369327247142792, 0.04775598272681236, -0.073247030377388, -0.03887828812003136, -0.019224677234888077, 0.032649483531713486, 0.00012480028090067208, 0.027892792597413063, 0.06528709828853607, 0.09493157267570496, 0.02581620216369629, -0.04240608215332031, -0.06243579462170601, 0.020954642444849014, 0.05892355367541313, 0.004144276957958937, 3.0667797216259058e-33, 0.06865254789590836, -0.0013596309581771493, -0.003051792038604617, 0.0012397411046549678, -0.04936704784631729, 0.03395150229334831, 0.06921185553073883, 0.04384415224194527, -0.05479290336370468, -0.0271829254925251, -0.10077802836894989, 0.009072509594261646, -0.044913288205862045, -0.02476147562265396, -0.05602541193366051, 0.06697990000247955, -0.0028842478059232235, 0.032634202390909195, 0.05131067335605621, 0.04166518896818161, 0.03785755857825279, 0.015771912410855293, 0.035569388419389725, -0.05525432527065277, 0.03844070062041283, -0.05206267163157463, 0.02091105841100216, -0.052735719829797745, -0.10958559066057205, -0.015159716829657555, -0.008609522134065628, -0.016241686418652534, -0.07499545067548752, 0.016802851110696793, 0.08971944451332092, 0.03623632714152336, -0.008930898271501064, 0.10352388769388199, -0.1378563493490219, 0.006284564267843962, -0.062242746353149414, -0.0009903155732899904, -0.009143820032477379, -0.04998675733804703, -0.02308814227581024, -0.07275831699371338, -0.13178493082523346, -0.05470962077379227, 0.05790454149246216, 0.016904490068554878, -0.03954485058784485, 0.08897077292203903, 0.026336584240198135, -0.04076651483774185, 0.10728858411312103, 0.0116388825699687, 0.02765275351703167, 0.051283225417137146, 0.005813544616103172, 0.03988679498434067, 0.022848747670650482, 0.009634002111852169, 0.02215004712343216, -0.017527632415294647, -0.01626923680305481, 0.020816214382648468, -0.03840121999382973, -0.014074630104005337, 0.0011440325761213899, 0.0547359474003315, 0.023372270166873932, 0.010827009566128254, 0.040321800857782364, -0.018987681716680527, -0.005085190758109093, -0.13163022696971893, -0.09840000420808792, 0.062440115958452225, 0.11294356733560562, -0.011623301543295383, 0.10428966581821442, -0.10881892591714859, -0.00036215296131558716, 0.04900532588362694, 0.04302709922194481, 0.003840903751552105, -0.042777642607688904, -0.12221956998109818, -0.035895757377147675, -0.042905066162347794, -0.016153650358319283, 0.03487782180309296, -0.14215901494026184, -0.05302133783698082, -0.012087522074580193, -7.071942257175843e-33, 0.03211396187543869, -0.07448229193687439, 0.03207647055387497, 0.08481153100728989, -0.00007991011079866439, -0.007987065240740776, 0.04604160040616989, -0.07690244168043137, 0.026475580409169197, 0.07866789400577545, 0.055569298565387726, 0.02855658531188965, -0.035833146423101425, -0.043818291276693344, -0.02212562784552574, 0.05722729489207268, -0.04230060055851936, -0.07431898266077042, -0.0159158892929554, 0.01011721696704626, -0.07645240426063538, -0.011931843124330044, -0.08268013596534729, 0.033086247742176056, -0.1141572892665863, -0.04354321211576462, 0.06679834425449371, 0.008248535916209221, -0.008770927786827087, -0.024734871461987495, -0.01860770396888256, 0.023464985191822052, -0.11692717671394348, 0.03597496449947357, -0.017226748168468475, 0.05810732766985893, 0.03021501749753952, 0.12774524092674255, 0.0390009768307209, 0.07248155772686005, 0.08317466825246811, -0.02346717193722725, 0.02411673776805401, 0.05821336805820465, -0.012416031211614609, -0.013970806263387203, -0.029769621789455414, 0.008329097181558609, -0.023389823734760284, -0.010779052041471004, 0.07094909995794296, 0.038813576102256775, -0.024600252509117126, 0.037992022931575775, -0.010247423313558102, -0.06803619861602783, -0.054428309202194214, 0.020542526617646217, -0.09686829149723053, 0.026406696066260338, 0.049598708748817444, -0.04345540702342987, -0.041222717612981796, 0.048651374876499176, -0.04847320169210434, -0.0641755610704422, 0.007384328171610832, -0.023610424250364304, 0.022324662655591965, -0.05794622376561165, -0.0019468175014480948, -0.09237630665302277, 0.12519879639148712, -0.012071059085428715, 0.12050936371088028, -0.0049597108736634254, 0.036953724920749664, -0.024913080036640167, 0.09288578480482101, 0.006638974417001009, -0.04665173217654228, 0.004167282022535801, -0.000954299874138087, 0.013206671923398972, -0.004732846282422543, 0.020859692245721817, -0.09447860717773438, 0.1263669729232788, -0.008590199053287506, -0.052961260080337524, 0.07960673421621323, 0.0273036640137434, -0.026465285569429398, 0.031154612079262733, 0.035713985562324524, -6.037770816647026e-8, -0.0376681350171566, -0.08188829571008682, -0.06564820557832718, 0.04111505299806595, -0.042622391134500504, 0.10216730833053589, 0.04808513820171356, -0.02465563267469406, -0.018414869904518127, -0.027860127389431, 0.014141413383185863, 0.0742679312825203, -0.015539429150521755, 0.0426015704870224, -0.0006487501668743789, -0.030609218403697014, -0.05184490606188774, -0.03077595867216587, 0.023635832592844963, -0.00827557872980833, -0.03433100879192352, 0.02923322468996048, 0.009963241405785084, -0.024799423292279243, 0.06451819092035294, 0.0018682230729609728, -0.03792155534029007, 0.03411318361759186, -0.060002390295267105, 0.01454125065356493, 0.005446451250463724, -0.0022457032464444637, -0.08785078674554825, -0.05081236734986305, 0.004756025969982147, 0.08429545164108276, -0.03344065696001053, -0.01887017861008644, -0.06905633956193924, -0.031496208161115646, 0.029811618849635124, 0.029587090015411377, -0.02343437820672989, -0.01759357750415802, -0.03991875424981117, 0.04464402049779892, 0.0111355260014534, -0.010562185198068619, 0.028692973777651787, -0.06153557077050209, 0.002262461930513382, -0.06695275753736496, -0.0037707991432398558, 0.0379345528781414, -0.005328843370079994, -0.00891540665179491, 0.034849829971790314, -0.0681038424372673, 0.022439060732722282, 0.005331068765372038, 0.13205070793628693, -0.02416694536805153, 0.0019155580084770918, 0.03847722336649895 ]
0.06171
be `dfs\_query\_then\_fetch` or `query\_then\_fetch`. Defaults to `query\_then\_fetch`. See <> for more details on the different types of search that can be performed. |=======================================================================
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/uri-request.asciidoc
6.2
elasticsearch-6-2
[ -0.01872641034424305, -0.027929779142141342, -0.013542743399739265, 0.03012215718626976, -0.0043313284404575825, -0.08625778555870056, 0.004276568535715342, 0.014006099663674831, -0.0007521588704548776, 0.005646844860166311, 0.019887249916791916, 0.010190472938120365, 0.026639726012945175, -0.021131020039319992, -0.0468594990670681, -0.047929469496011734, 0.024993207305669785, 0.008264310657978058, 0.022112473845481873, 0.006186320446431637, 0.058995187282562256, 0.09958010911941528, 0.03335803374648094, -0.039118535816669464, -0.0385221391916275, -0.09500698000192642, -0.018602337688207626, -0.08411099761724472, 0.011203252710402012, 0.025349102914333344, -0.02059275470674038, 0.010530958883464336, -0.042052388191223145, 0.1130542904138565, 0.03156254440546036, -0.010149774141609669, -0.0593424066901207, -0.021327197551727295, 0.020347004756331444, -0.04354055970907211, 0.014408126473426819, 0.04134305939078331, 0.07391346991062164, -0.004632890224456787, -0.025304939597845078, -0.0024165487848222256, -0.015418803319334984, -0.022709663957357407, 0.06684451550245285, -0.05211629718542099, -0.11162158101797104, 0.008580509573221207, -0.046260904520750046, -0.0018904984463006258, 0.0910799577832222, 0.025690412148833275, -0.039866723120212555, 0.016654351726174355, -0.04559602960944176, -0.03126341104507446, 0.03290035203099251, -0.12475088238716125, 0.04995686188340187, -0.06627798825502396, 0.005672591272741556, -0.04488905891776085, -0.007758753839880228, -0.03255469352006912, 0.13014402985572815, -0.09073800593614578, -0.013838116079568863, 0.02088589034974575, -0.04458223283290863, -0.0314541831612587, 0.04952000081539154, 0.05685107782483101, 0.03973589837551117, 0.007190716452896595, -0.019053833559155464, -0.06625654548406601, -0.045251451432704926, -0.03639363497495651, -0.02462897263467312, 0.0034079435281455517, -0.026607537642121315, -0.003698331071063876, -0.006909017916768789, -0.16720561683177948, 0.11949522793292999, -0.05722940340638161, -0.008454641327261925, -0.07496368139982224, -0.100226491689682, -0.022776657715439796, -0.08353400230407715, 0.017182739451527596, 0.0161135233938694, 0.053965918719768524, 0.08535055816173553, -0.023523597046732903, 0.03481552377343178, -0.004094693344086409, -0.02873661369085312, 0.02702256850898266, -0.10521716624498367, 0.006444865837693214, 0.006833265069872141, 0.056169863790273666, -0.04056391492486, -0.019529927521944046, -0.030794762074947357, 0.06937873363494873, 0.01561441645026207, -0.04088173434138298, -0.061665479093790054, -0.051069434732198715, -0.024037480354309082, -0.05223546922206879, -0.03870793804526329, 0.026840073987841606, 0.028788095340132713, 0.00786047987639904, -0.019953981041908264, -0.06219185143709183, -0.10139495134353638, 0.01601119339466095, -0.04740413278341293, 8.153978929636005e-33, 0.03508242592215538, -0.03873634338378906, 0.04910785332322121, -0.04484507441520691, -0.09920241683721542, -0.043476130813360214, 0.103349469602108, 0.06733442097902298, -0.01363840326666832, 0.019570372998714447, -0.02036011591553688, 0.0004585654241964221, -0.0790303647518158, -0.015189782716333866, -0.0675378069281578, -0.029499299824237823, 0.03871104493737221, -0.017048640176653862, 0.006914564874023199, 0.023782607167959213, 0.04384182021021843, 0.026090554893016815, -0.028239406645298004, -0.0524054691195488, 0.11544959247112274, -0.06866755336523056, -0.011206076480448246, 0.031046902760863304, -0.06007195636630058, 0.008037595078349113, -0.07453935593366623, -0.07346349209547043, 0.008387426845729351, 0.020388036966323853, 0.01916218176484108, 0.047465868294239044, -0.04262476786971092, 0.07219860702753067, -0.09827864915132523, -0.060169968754053116, -0.012163994833827019, 0.0024790819734334946, 0.038504425436258316, -0.06552714854478836, -0.009688792750239372, -0.008610065095126629, -0.061942294239997864, -0.039784133434295654, -0.04700671136379242, -0.02709478884935379, 0.014081458561122417, -0.015558123588562012, 0.044860370457172394, -0.04118217155337334, 0.07776177674531937, 0.021912239491939545, -0.04257466644048691, 0.0065198359079658985, -0.023887328803539276, 0.0731128603219986, -0.07133705168962479, -0.03849763050675392, 0.00955375749617815, -0.06398084759712219, -0.03396598994731903, -0.006097785662859678, 0.06849121302366257, -0.0035414686426520348, 0.05981225520372391, 0.016120169311761856, 0.04730519652366638, 0.04642484337091446, 0.08805546164512634, 0.0130965206772089, 0.055817846208810806, -0.0924910232424736, -0.03225916996598244, 0.00033485659514553845, 0.06444469094276428, -0.031548380851745605, 0.000497746339533478, -0.04268038272857666, -0.07748908549547195, 0.1285000592470169, 0.0537654347717762, 0.053207095712423325, -0.005003050900995731, -0.04191132262349129, -0.017231769859790802, -0.0322478748857975, -0.028649160638451576, 0.03478363901376724, 0.03379341587424278, -0.044623374938964844, 0.008074680343270302, -1.0677989379462081e-32, 0.08765071630477905, -0.05525858327746391, -0.0030609900131821632, -0.09201394766569138, -0.01594405062496662, -0.006781356874853373, 0.04951426759362221, -0.085035040974617, 0.005963834933936596, 0.012247651815414429, -0.0018676337786018848, -0.00045998900895938277, 0.062137309461832047, -0.058849841356277466, -0.07955005019903183, 0.11269035935401917, 0.017478257417678833, -0.08835157006978989, -0.027825281023979187, 0.07405233383178711, -0.058463290333747864, 0.07721534371376038, -0.08103957027196884, 0.0617995522916317, 0.01706087589263916, -0.04295961931347847, -0.009426379576325417, 0.0733519196510315, -0.08964213728904724, 0.0025185653939843178, -0.00005142285590409301, 0.007549996022135019, -0.11675713956356049, 0.02476702630519867, -0.05984167754650116, 0.001443321700207889, -0.03155078738927841, -0.017758799716830254, -0.012673970311880112, 0.06304514408111572, -0.0552043579518795, 0.04763256385922432, -0.020901400595903397, 0.09098105877637863, -0.0003382462600711733, -0.06609563529491425, 0.026731617748737335, 0.07220198959112167, 0.05622120201587677, 0.02673659659922123, 0.026107806712388992, -0.021575292572379112, 0.001867191749624908, 0.007283270359039307, 0.009991391561925411, 0.020290670916438103, 0.027699455618858337, 0.07036198675632477, -0.06965300440788269, 0.023537179455161095, 0.018436675891280174, -0.004667138680815697, -0.07747860252857208, 0.02601948194205761, -0.06553230434656143, -0.027725182473659515, -0.09329470247030258, 0.005162570625543594, -0.06461868435144424, -0.05833078548312187, 0.0015887717017903924, -0.017583681270480156, 0.09095447510480881, 0.020556410774588585, 0.027242105454206467, 0.046254586428403854, 0.02414529398083687, 0.07445310801267624, 0.08369167894124985, 0.13796649873256683, -0.06683819741010666, 0.09849690645933151, -0.014151617884635925, 0.10813786834478378, -0.05542303994297981, -0.02851369045674801, -0.07352433353662491, 0.024155268445611, -0.052947819232940674, -0.060975030064582825, -0.008528200909495354, -0.10292167216539383, -0.0006754231289960444, 0.039227262139320374, 0.0613933727145195, -5.134063840728231e-8, -0.041593633592128754, -0.0056821019388735294, 0.0008948342292569578, 0.019306490197777748, 0.04112941026687622, 0.04210078716278076, 0.03623538464307785, 0.1194710060954094, -0.04758305847644806, -0.06008545681834221, 0.018196670338511467, 0.05610198900103569, -0.024443885311484337, 0.0023096580989658833, -0.01710049994289875, -0.05476100742816925, 0.04394685849547386, -0.07355518639087677, -0.04276101663708687, -0.011683259159326553, -0.013311851769685745, -0.006764431018382311, 0.0050073955208063126, -0.009076989255845547, 0.06797517836093903, -0.001886972808279097, 0.04014085605740547, -0.011609095148742199, -0.0019038579193875194, 0.08689043670892715, 0.024088159203529358, -0.04261228069663048, -0.09003192186355591, -0.05754256993532181, 0.06652738153934479, -0.004345729947090149, 0.02183450013399124, 0.012704255990684032, -0.03729276731610298, 0.025615431368350983, 0.08838468044996262, 0.08220838010311127, 0.030079161748290062, 0.07787897437810898, -0.07268636673688889, 0.015864206477999687, 0.023077568039298058, 0.05384301021695137, 0.06291176378726959, -0.061460692435503006, -0.02915501967072487, -0.06655746698379517, -0.04263884574174881, 0.01933673955500126, -0.017925826832652092, 0.0005883113481104374, 0.008493359200656414, 0.051564283668994904, -0.03215881064534187, -0.035643674433231354, 0.047859691083431244, 0.038497451692819595, -0.019786693155765533, 0.04750252142548561 ]
-0.002097
[[search-profile]] == Profile API WARNING: The Profile API is a debugging tool and adds significant overhead to search execution. The Profile API provides detailed timing information about the execution of individual components in a search request. It gives the user insight into how search requests are executed at a low level so that the user can understand why certain requests are slow, and take steps to improve them. The output from the Profile API is \*very\* verbose, especially for complicated requests executed across many shards. Pretty-printing the response is recommended to help understand the output [float] === Usage Any `\_search` request can be profiled by adding a top-level `profile` parameter: [source,js] -------------------------------------------------- GET /twitter/\_search { "profile": true,<1> "query" : { "match" : { "message" : "some number" } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] <1> Setting the top-level `profile` parameter to `true` will enable profiling for the search This will yield the following result: [source,js] -------------------------------------------------- { "took": 25, "timed\_out": false, "\_shards": { "total": 1, "successful": 1, "skipped" : 0, "failed": 0 }, "hits": { "total": 4, "max\_score": 0.5093388, "hits": [...] <1> }, "profile": { "shards": [ { "id": "[2aE02wS1R8q\_QFnYu6vDVQ][twitter][0]", "searches": [ { "query": [ { "type": "BooleanQuery", "description": "message:some message:number", "time\_in\_nanos": "1873811", "breakdown": { "score": 51306, "score\_count": 4, "build\_scorer": 2935582, "build\_scorer\_count": 1, "match": 0, "match\_count": 0, "create\_weight": 919297, "create\_weight\_count": 1, "next\_doc": 53876, "next\_doc\_count": 5, "advance": 0, "advance\_count": 0 }, "children": [ { "type": "TermQuery", "description": "message:some", "time\_in\_nanos": "391943", "breakdown": { "score": 28776, "score\_count": 4, "build\_scorer": 784451, "build\_scorer\_count": 1, "match": 0, "match\_count": 0, "create\_weight": 1669564, "create\_weight\_count": 1, "next\_doc": 10111, "next\_doc\_count": 5, "advance": 0, "advance\_count": 0 } }, { "type": "TermQuery", "description": "message:number", "time\_in\_nanos": "210682", "breakdown": { "score": 4552, "score\_count": 4, "build\_scorer": 42602, "build\_scorer\_count": 1, "match": 0, "match\_count": 0, "create\_weight": 89323, "create\_weight\_count": 1, "next\_doc": 2852, "next\_doc\_count": 5, "advance": 0, "advance\_count": 0 } } ] } ], "rewrite\_time": 51443, "collector": [ { "name": "CancellableCollector", "reason": "search\_cancelled", "time\_in\_nanos": "304311", "children": [ { "name": "SimpleTopScoreDocCollector", "reason": "search\_top\_hits", "time\_in\_nanos": "32273" } ] } ] } ], "aggregations": [] } ] } } -------------------------------------------------- // TESTRESPONSE[s/"took": 25/"took": $body.took/] // TESTRESPONSE[s/"hits": \[...\]/"hits": $body.$\_path/] // TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$\_path/] // TESTRESPONSE[s/\[2aE02wS1R8q\_QFnYu6vDVQ\]\[twitter\]\[0\]/$body.$\_path/] <1> Search results are returned, but were omitted here for brevity Even for a simple query, the response is relatively complicated. Let's break it down piece-by-piece before moving to more complex examples. First, the overall structure of the profile response is as follows: [source,js] -------------------------------------------------- { "profile": { "shards": [ { "id": "[2aE02wS1R8q\_QFnYu6vDVQ][twitter][0]", <1> "searches": [ { "query": [...], <2> "rewrite\_time": 51443, <3> "collector": [...] <4> } ], "aggregations": [...] <5> } ] } } -------------------------------------------------- // TESTRESPONSE[s/"profile": /"took": $body.took, "timed\_out": $body.timed\_out, "\_shards": $body.\_shards, "hits": $body.hits, "profile": /] // TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$\_path/] // TESTRESPONSE[s/\[2aE02wS1R8q\_QFnYu6vDVQ\]\[twitter\]\[0\]/$body.$\_path/] // TESTRESPONSE[s/"query": \[...\]/"query": $body.$\_path/] // TESTRESPONSE[s/"collector": \[...\]/"collector": $body.$\_path/] // TESTRESPONSE[s/"aggregations": \[...\]/"aggregations": []/] <1> A profile is returned for each shard that participated in the response, and is identified by a unique ID <2> Each profile contains a section which holds details about the query execution <3> Each profile has a single time representing the cumulative rewrite time <4> Each profile also contains a section about the Lucene Collectors which run the search <5> Each profile contains a section which holds the details about the aggregation execution Because a search request may be executed against one or more shards in an index, and a search may cover one or more indices, the top level element in the profile response is an array of `shard` objects. Each shard object lists it's `id` which uniquely identifies the shard. The ID's format is `[nodeID][indexName][shardID]`. The profile itself may consist of one or more "searches", where a search is a
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/profile.asciidoc
6.2
elasticsearch-6-2
[ -0.008358628489077091, 0.08890469372272491, -0.009969575330615044, 0.09259921312332153, 0.06628351658582687, -0.042144324630498886, -0.0002938191464636475, 0.03232184424996376, 0.02806786820292473, -0.05957183614373207, -0.01561996340751648, -0.044073686003685, 0.075731061398983, -0.0014245187630876899, 0.01114162802696228, -0.020526079460978508, 0.001908658305183053, -0.03461490198969841, -0.021540138870477676, -0.1160518229007721, 0.03707747533917427, 0.020521027967333794, 0.011994410306215286, -0.02593064308166504, -0.027726372703909874, -0.05482668802142143, -0.09828904271125793, -0.09941001981496811, 0.007564859930425882, 0.07722672820091248, 0.0019353200914338231, 0.03186019882559776, -0.06509312987327576, 0.04234527796506882, -0.07833069562911987, 0.05516723170876503, -0.04239571839570999, -0.06246780604124069, -0.00976474303752184, -0.05446581542491913, 0.012837933376431465, -0.05357968807220459, -0.13041450083255768, 0.000123703881399706, -0.03479292243719101, -0.05521835386753082, -0.0029718291480094194, -0.040933649986982346, -0.10154648870229721, 0.041613854467868805, -0.10501261800527573, -0.052200064063072205, -0.03357526659965515, -0.027955830097198486, 0.02520788460969925, 0.03282255679368973, -0.008387560024857521, 0.03620637208223343, 0.028270766139030457, -0.044360220432281494, -0.0010350315133109689, -0.10236574709415436, 0.00904769916087389, -0.022914836183190346, 0.024520041421055794, -0.04164246842265129, 0.004805855918675661, -0.031894929707050323, 0.03752119839191437, -0.005281043238937855, 0.01805231347680092, 0.042697299271821976, -0.06587114930152893, -0.02464969828724861, 0.02392493560910225, 0.006885759066790342, -0.030232498422265053, -0.00808359868824482, -0.03429413214325905, 0.056484051048755646, -0.056582916527986526, -0.1087789461016655, -0.018202882260084152, 0.09239828586578369, 0.05516185238957405, -0.04982269927859306, -0.0026239592116326094, -0.12082391232252121, 0.02886905148625374, -0.0054480405524373055, 0.054980307817459106, -0.008301754482090473, 0.03626798838376999, -0.027029551565647125, 0.027011098340153694, 0.07189185172319412, -0.04596629738807678, -0.031280629336833954, 0.022252891212701797, 0.0036740293726325035, -0.04700307548046112, -0.036545708775520325, 0.04749242216348648, 0.01472288928925991, -0.00026228080969303846, 0.03669572249054909, -0.042813174426555634, 0.07864531874656677, -0.015145014971494675, 0.024471845477819443, -0.008926949463784695, 0.000012877534572908189, 0.0015927832573652267, 0.011617489159107208, 0.06457548588514328, 0.07106632739305496, 0.05980450659990311, -0.04868429899215698, 0.03288090229034424, 0.10292497277259827, 0.11395186185836792, 0.049165669828653336, 0.009233278222382069, -0.037066955119371414, 0.010322858579456806, 0.07021696120500565, -0.04425409808754921, 3.2123068406126666e-33, 0.14102788269519806, 0.05189836397767067, -0.006934898905456066, -0.032769206911325455, -0.0370824858546257, 0.03001420572400093, -0.017700036987662315, 0.025762807577848434, -0.04840874671936035, 0.00548532884567976, -0.07594547420740128, 0.07712787389755249, -0.00793000590056181, 0.04682662710547447, 0.006268507335335016, -0.01699834130704403, 0.05452018603682518, 0.07280828803777695, -0.03057790920138359, 0.03147285059094429, 0.05783514305949211, -0.034205999225378036, -0.04598087817430496, -0.007756923325359821, 0.061358485370874405, 0.023571355268359184, 0.017073679715394974, -0.05340079590678215, -0.1097867488861084, -0.00502619706094265, -0.05263872072100639, -0.009596860967576504, 0.018533244729042053, -0.011329758912324905, 0.10478963702917099, 0.012264457531273365, 0.004888077266514301, 0.0687086209654808, -0.08745519816875458, -0.0774431824684143, -0.021432938054203987, 0.019597964361310005, 0.0013772028032690287, -0.11736606061458588, -0.1476169228553772, -0.014179927296936512, -0.06486160308122635, 0.01518363505601883, 0.025520140305161476, -0.014234088361263275, 0.019900817424058914, 0.06255435198545456, -0.02728986367583275, 0.03508105129003525, 0.06239332631230354, -0.01624239794909954, 0.04391702264547348, 0.04436192288994789, 0.04330378398299217, 0.0413665845990181, 0.07330310344696045, -0.0692589059472084, 0.036320947110652924, -0.0028005321510136127, -0.01275092177093029, -0.013883610256016254, -0.016909493133425713, 0.07690314203500748, 0.007359531242400408, 0.04533199220895767, -0.004595734179019928, 0.10557832568883896, 0.0596328005194664, -0.050017099827528, -0.020604535937309265, -0.13896708190441132, -0.041827283799648285, -0.007647563237696886, -0.04120078682899475, 0.044997140765190125, 0.03409450501203537, 0.0012591693084686995, -0.042164213955402374, -0.01626901514828205, -0.02193242311477661, 0.04947298392653465, -0.008191355504095554, -0.07119741290807724, -0.04076550155878067, -0.0142747787758708, -0.010620041750371456, -0.015543028712272644, -0.08049769699573517, -0.08606638014316559, -0.1427200734615326, -4.574909402701138e-33, -0.02134789153933525, -0.10552902519702911, 0.03524235263466835, 0.02392144501209259, 0.04471122473478317, -0.04811040684580803, 0.07274282723665237, 0.04855805262923241, 0.042388033121824265, 0.029032999649643898, -0.0043969061225652695, -0.013303779996931553, -0.05392181873321533, -0.051400452852249146, -0.0032840094063431025, 0.09284363687038422, -0.02219470404088497, -0.1022157147526741, 0.046121757477521896, -0.018997568637132645, -0.03186896815896034, -0.0036484887823462486, -0.10721305757761002, 0.04738565534353256, -0.09906181693077087, -0.009538495913147926, 0.05069410428404808, -0.03861064091324806, -0.053084660321474075, 0.033817533403635025, -0.04421218857169151, -0.04114409536123276, -0.05230918526649475, -0.009126139804720879, -0.05134047940373421, 0.02791120484471321, -0.04392476752400398, 0.05540679767727852, 0.011883052997291088, 0.04576053470373154, 0.10653543472290039, -0.000616859644651413, -0.023773225024342537, 0.01853089965879917, -0.00952193234115839, 0.0075378925539553165, -0.013752742670476437, 0.013410310260951519, 0.0179886594414711, -0.024710850790143013, 0.09612008929252625, 0.05403995141386986, 0.029122328385710716, 0.10176407545804977, 0.001866246690042317, -0.08037889748811722, -0.08030369877815247, 0.043962009251117706, -0.03115737996995449, -0.0009110649698413908, -0.013167346827685833, 0.0016610737657174468, -0.014138934202492237, 0.03835616260766983, -0.01110629178583622, -0.071207694709301, -0.005652913823723793, -0.0569903627038002, -0.03994904085993767, -0.03036298044025898, -0.005104620475322008, -0.07381870597600937, 0.04327070713043213, 0.04253770783543587, 0.07090416550636292, -0.07922280579805374, -0.010572569444775581, 0.0017474202904850245, 0.031139729544520378, 0.07026322185993195, -0.015757286921143532, 0.0784590095281601, -0.006569437682628632, -0.007991828955709934, -0.005789217539131641, -0.054099150002002716, -0.06316322833299637, 0.14900673925876617, -0.022946922108530998, 0.013950081542134285, 0.03450550511479378, -0.01740868203341961, -0.1264590620994568, 0.025468237698078156, 0.04237589240074158, -5.576867678769304e-8, -0.0236138254404068, -0.01575605757534504, -0.04139837250113487, 0.07015909254550934, -0.004735693335533142, 0.09041604399681091, 0.04872063174843788, 0.058384280651807785, -0.029995758086442947, -0.015180188231170177, 0.036556459963321686, 0.0356215201318264, -0.06104235723614693, -0.01812123879790306, 0.0018941840389743447, -0.010256359353661537, -0.041757822036743164, -0.028810204938054085, -0.026481950655579567, -0.03140971437096596, -0.034705281257629395, 0.07588200271129608, -0.020311880856752396, -0.05690258368849754, 0.057264480739831924, 0.022113407030701637, -0.016320601105690002, 0.06393325328826904, -0.01237979531288147, -0.05357431620359421, -0.0753963515162468, 0.008482837118208408, -0.019949160516262054, -0.06397821009159088, 0.04558694735169411, 0.0626818984746933, -0.07592765986919403, -0.013904454186558723, -0.033245544880628586, 0.1008092388510704, 0.04814555495977402, 0.06119333207607269, 0.003886643797159195, 0.04014858976006508, -0.0022390016820281744, 0.014973318204283714, -0.004585058894008398, 0.005886096972972155, 0.0855843648314476, -0.00260546850040555, 0.012393228709697723, -0.0619712732732296, 0.005386863835155964, 0.06439171731472015, -0.020551571622490883, -0.030282314866781235, 0.04710201174020767, -0.03820440173149109, 0.054046113044023514, 0.026390762999653816, 0.11775818467140198, -0.05703946575522423, 0.026705747470259666, -0.004434835631400347 ]
0.019844
cover one or more indices, the top level element in the profile response is an array of `shard` objects. Each shard object lists it's `id` which uniquely identifies the shard. The ID's format is `[nodeID][indexName][shardID]`. The profile itself may consist of one or more "searches", where a search is a query executed against the underlying Lucene index. Most Search Requests submitted by the user will only execute a single `search` against the Lucene index. But occasionally multiple searches will be executed, such as including a global aggregation (which needs to execute a secondary "match\_all" query for the global context). Inside each `search` object there will be two arrays of profiled information: a `query` array and a `collector` array. Alongside the `search` object is an `aggregations` object that contains the profile information for the aggregations. In the future, more sections may be added, such as `suggest`, `highlight`, etc There will also be a `rewrite` metric showing the total time spent rewriting the query (in nanoseconds). NOTE: As with other statistics apis, the Profile API supports human readable outputs. This can be turned on by adding `?human=true` to the query string. In this case, the output contains the additional `time` field containing rounded, human readable timing information (e.g. `"time": "391,9ms"`, `"time": "123.3micros"`). === Profiling Queries [NOTE] ======================================= The details provided by the Profile API directly expose Lucene class names and concepts, which means that complete interpretation of the results require fairly advanced knowledge of Lucene. This page attempts to give a crash-course in how Lucene executes queries so that you can use the Profile API to successfully diagnose and debug queries, but it is only an overview. For complete understanding, please refer to Lucene's documentation and, in places, the code. With that said, a complete understanding is often not required to fix a slow query. It is usually sufficient to see that a particular component of a query is slow, and not necessarily understand why the `advance` phase of that query is the cause, for example. ======================================= [[profile-query-section]] ==== `query` Section The `query` section contains detailed timing of the query tree executed by Lucene on a particular shard. The overall structure of this query tree will resemble your original Elasticsearch query, but may be slightly (or sometimes very) different. It will also use similar but not always identical naming. Using our previous `match` query example, let's analyze the `query` section: [source,js] -------------------------------------------------- "query": [ { "type": "BooleanQuery", "description": "message:some message:number", "time\_in\_nanos": "1873811", "breakdown": {...}, <1> "children": [ { "type": "TermQuery", "description": "message:some", "time\_in\_nanos": "391943", "breakdown": {...} }, { "type": "TermQuery", "description": "message:number", "time\_in\_nanos": "210682", "breakdown": {...} } ] } ] -------------------------------------------------- // TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed\_out": $body.timed\_out,\n"\_shards": $body.\_shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ {\n"id": "$body.$\_path",\n"searches": [{\n/] // TESTRESPONSE[s/]$/],"rewrite\_time": $body.$\_path, "collector": $body.$\_path}], "aggregations": []}]}}/] // TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$\_path/] // TESTRESPONSE[s/"breakdown": \{...\}/"breakdown": $body.$\_path/] <1> The breakdown timings are omitted for simplicity Based on the profile structure, we can see that our `match` query was rewritten by Lucene into a BooleanQuery with two clauses (both holding a TermQuery). The `type` field displays the Lucene class name, and often aligns with the equivalent name in Elasticsearch. The `description` field displays the Lucene explanation text for the query, and is made available to help differentiating between parts of your query (e.g. both `message:search` and `message:test` are TermQuery's and would appear identical otherwise. The `time\_in\_nanos` field shows that this query took ~1.8ms for the entire BooleanQuery to execute. The recorded time is inclusive of all children. The `breakdown` field will give detailed stats about how the time was spent, we'll look at that in a moment. Finally, the `children` array lists any sub-queries
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/profile.asciidoc
6.2
elasticsearch-6-2
[ 0.012546803802251816, -0.0020293365232646465, -0.034601226449012756, 0.09005223959684372, 0.014651279896497726, 0.004870615433901548, -0.0042947339825332165, 0.02181893400847912, 0.004581746645271778, -0.06844460219144821, -0.05592414736747742, -0.02148742415010929, 0.06575019657611847, -0.030548211187124252, -0.0659162700176239, -0.027012452483177185, -0.028002168983221054, 0.013369985856115818, -0.055018648505210876, -0.09686151891946793, 0.04852103814482689, -0.0057004038244485855, 0.04370556399226189, -0.086774080991745, -0.09286312758922577, -0.01740616373717785, -0.03896128013730049, -0.03731590881943703, -0.006569150369614363, 0.024129122495651245, 0.040888261049985886, 0.07258861511945724, -0.01770390383899212, 0.09547413140535355, -0.1199638620018959, 0.018856968730688095, -0.005620491225272417, -0.0063545964658260345, -0.034137606620788574, -0.05570799484848976, 0.006617359351366758, 0.006884406786412001, -0.09201077371835709, 0.031900499016046524, 0.025235101580619812, -0.04030708968639374, -0.07284443080425262, -0.04650203883647919, -0.045347247272729874, 0.006119131576269865, -0.06898421794176102, -0.005849276203662157, -0.040400706231594086, 0.025075789541006088, 0.1001671552658081, 0.05816219374537468, -0.032862041145563126, -0.03729628399014473, -0.007288984023034573, -0.04783622547984123, -0.022042827680706978, -0.04743349924683571, -0.020859679207205772, -0.007329761981964111, 0.07172905653715134, -0.07303197681903839, 0.06304915994405746, -0.0691647008061409, 0.059947725385427475, -0.029828133061528206, -0.010265341028571129, 0.02491193823516369, -0.0768837109208107, 0.012263619340956211, 0.08225976675748825, 0.06600601971149445, -0.032062944024801254, 0.003565813647583127, 0.03632749244570732, -0.04900696128606796, -0.03219420090317726, -0.016317762434482574, 0.06577291339635849, 0.04044591635465622, 0.05011109635233879, -0.05887524038553238, 0.023526495322585106, -0.09366875886917114, 0.034942787140607834, 0.033753301948308945, 0.021720040589571, -0.04734274744987488, -0.006219514179974794, -0.0651506781578064, 0.02637990564107895, 0.048655588179826736, -0.016717860475182533, 0.012545619159936905, 0.08173373341560364, -0.0020092646591365337, -0.04529206082224846, -0.049623724073171616, 0.016297664493322372, 0.02393217943608761, -0.06978283822536469, -0.010682853870093822, -0.02536763809621334, 0.07189011573791504, -0.06331770122051239, -0.014819817617535591, 0.010512488894164562, 0.025982612743973732, 0.016194775700569153, -0.01628922112286091, 0.010933469980955124, 0.0635567232966423, 0.08250129967927933, -0.0007849528919905424, 0.03547988086938858, 0.10004208236932755, 0.05727073550224304, 0.05990724265575409, 0.07797843217849731, -0.050637222826480865, -0.01938420534133911, 0.07655205577611923, -0.06748722493648529, 1.8063362511605302e-33, 0.11972738802433014, 0.004947996698319912, -0.05221971869468689, -0.018475743010640144, -0.09093474596738815, 0.03756536915898323, -0.006806500721722841, 0.0467427633702755, -0.0241696797311306, -0.009618062525987625, -0.030843792483210564, 0.14118440449237823, -0.014042968861758709, 0.12089879810810089, 0.049377523362636566, 0.006851517595350742, 0.08017712831497192, 0.11696259677410126, -0.05906965583562851, -0.029962588101625443, 0.040832530707120895, -0.0042910887859761715, 0.007911425083875656, -0.01275867410004139, 0.0790303498506546, -0.004178028553724289, 0.026960046961903572, -0.0344400554895401, -0.07469524443149567, 0.013002213090658188, -0.040277186781167984, -0.015995709225535393, -0.01991891674697399, 0.013976059854030609, 0.07704361528158188, 0.06850718706846237, -0.006528128869831562, 0.035083360970020294, -0.01704331859946251, -0.07028225809335709, -0.016042647883296013, 0.02509172447025776, 0.016814127564430237, -0.08424749225378036, -0.17860709130764008, -0.03417374938726425, -0.10356476902961731, 0.012601557187736034, 0.012853202410042286, 0.03653843328356743, 0.04136262089014053, 0.015499955043196678, 0.01215224340558052, 0.023452047258615494, 0.008218708448112011, 0.0260453037917614, 0.01229306310415268, -0.016573993489146233, -0.043069060891866684, 0.05310005694627762, 0.029504353180527687, -0.06098019331693649, -0.012806628830730915, 0.019999757409095764, 0.03135422244668007, 0.011424017138779163, 0.01252695918083191, 0.0815838873386383, 0.09677206724882126, 0.10349291563034058, -0.010537062771618366, 0.11755523085594177, 0.027680467814207077, -0.07326669245958328, -0.03828265890479088, -0.08566537499427795, 0.03207894787192345, -0.0007886519888415933, -0.08796856552362442, 0.00957711786031723, 0.015710916370153427, 0.04139716178178787, -0.035321708768606186, -0.05302361026406288, -0.000004582051133183995, 0.02383672632277012, 0.012010525912046432, -0.061762817203998566, -0.08205921202898026, -0.10417494922876358, 0.057248376309871674, 0.012671860866248608, -0.03630589693784714, -0.030392682179808617, -0.10706273466348648, -3.094102802113824e-33, -0.0186931062489748, -0.09545724838972092, 0.03676079213619232, -0.004754908382892609, -0.006646277848631144, -0.05253256484866142, 0.02119459956884384, 0.017868204042315483, 0.008016697131097317, -0.02239864319562912, 0.013788698241114616, -0.03072209097445011, 0.05833984911441803, -0.04608641564846039, -0.06217183917760849, 0.10089627653360367, -0.06742148846387863, -0.07156411558389664, 0.021046269685029984, 0.012150650843977928, -0.05406690016388893, 0.004955477546900511, -0.035905662924051285, 0.02203482761979103, -0.07246925681829453, -0.019997889176011086, -0.02331206575036049, -0.05237744376063347, -0.044276684522628784, 0.028294749557971954, 0.06066029891371727, -0.06562849134206772, -0.11272202432155609, -0.026760313659906387, -0.026140121743083, 0.008239120244979858, -0.002078779274597764, -0.020074695348739624, -0.012850453145802021, 0.0896315723657608, 0.03977514058351517, 0.04468350484967232, 0.006532222032546997, 0.029066842049360275, 0.05543389916419983, 0.008072111755609512, -0.07024400681257248, 0.04543997719883919, -0.001041428535245359, -0.0599423423409462, 0.028898460790514946, 0.026458406820893288, 0.04949198290705681, 0.08314387500286102, -0.018736111000180244, -0.014775988645851612, -0.013026461936533451, 0.036410506814718246, -0.009405466727912426, 0.04619861766695976, 0.03260474652051926, 0.021446026861667633, -0.034452248364686966, 0.056431856006383896, -0.026960479095578194, -0.01794501766562462, 0.041683461517095566, -0.1017698124051094, -0.05724947527050972, -0.06514963507652283, 0.003862683428451419, -0.07962546497583389, -0.022188808768987656, -0.002424716716632247, 0.01413777656853199, -0.04125642776489258, 0.02561354637145996, -0.02125791646540165, -0.03286007419228554, 0.09971114248037338, -0.014310204423964024, 0.048240117728710175, -0.019316118210554123, -0.01253125723451376, 0.003330731065943837, -0.05592954531311989, -0.0029316807631403208, 0.14559446275234222, -0.04688272252678871, 0.013199572451412678, 0.028036193922162056, -0.03296639025211334, -0.14033272862434387, -0.0021648386027663946, -0.019345587119460106, -5.401271963023646e-8, -0.022716287523508072, 0.0628378838300705, -0.06308064609766006, 0.06161987781524658, 0.05245697870850563, 0.007542419247329235, 0.005091115366667509, 0.07161648571491241, -0.046235665678977966, -0.013140715658664703, 0.10556942969560623, 0.03304252028465271, -0.06992152333259583, -0.015467053279280663, 0.10563278943300247, -0.00040348575566895306, -0.024797357618808746, 0.005124087445437908, -0.054704759269952774, -0.019044749438762665, -0.07025434076786041, 0.053926944732666016, -0.0388505756855011, -0.00837443396449089, 0.020252080634236336, 0.020854925736784935, 0.04599335044622421, 0.03280593082308769, 0.0020477958023548126, 0.03204426169395447, -0.04257044941186905, 0.022354429587721825, 0.017306437715888023, -0.04439575970172882, 0.027447964996099472, 0.0457662008702755, -0.07273610681295395, -0.007717788219451904, 0.008828926831483841, 0.14232680201530457, 0.07525409013032913, 0.008967376314103603, 0.04810265079140663, 0.09884893894195557, 0.008069653064012527, -0.0022344214376062155, -0.027805546298623085, 0.01742488145828247, 0.04835199564695358, 0.003668864257633686, -0.007150151766836643, -0.06811936944723129, 0.017421601340174675, 0.0326947346329689, -0.043420273810625076, 0.01566760055720806, -0.005644728895276785, -0.03939669206738472, 0.09806395322084427, -0.021376052871346474, 0.09429096430540085, -0.06480807811021805, -0.010949982330203056, 0.014111422933638096 ]
0.099052
The `time\_in\_nanos` field shows that this query took ~1.8ms for the entire BooleanQuery to execute. The recorded time is inclusive of all children. The `breakdown` field will give detailed stats about how the time was spent, we'll look at that in a moment. Finally, the `children` array lists any sub-queries that may be present. Because we searched for two values ("search test"), our BooleanQuery holds two children TermQueries. They have identical information (type, time, breakdown, etc). Children are allowed to have their own children. ===== Timing Breakdown The `breakdown` component lists detailed timing statistics about low-level Lucene execution: [source,js] -------------------------------------------------- "breakdown": { "score": 51306, "score\_count": 4, "build\_scorer": 2935582, "build\_scorer\_count": 1, "match": 0, "match\_count": 0, "create\_weight": 919297, "create\_weight\_count": 1, "next\_doc": 53876, "next\_doc\_count": 5, "advance": 0, "advance\_count": 0 } -------------------------------------------------- // TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed\_out": $body.timed\_out,\n"\_shards": $body.\_shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ {\n"id": "$body.$\_path",\n"searches": [{\n"query": [{\n"type": "BooleanQuery",\n"description": "message:some message:number",\n"time\_in\_nanos": $body.$\_path,/] // TESTRESPONSE[s/}$/},\n"children": $body.$\_path}],\n"rewrite\_time": $body.$\_path, "collector": $body.$\_path}], "aggregations": []}]}}/] // TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$\_path/] Timings are listed in wall-clock nanoseconds and are not normalized at all. All caveats about the overall `time\_in\_nanos` apply here. The intention of the breakdown is to give you a feel for A) what machinery in Lucene is actually eating time, and B) the magnitude of differences in times between the various components. Like the overall time, the breakdown is inclusive of all children times. The meaning of the stats are as follows: [float] ==== All parameters: [horizontal] `create\_weight`:: A Query in Lucene must be capable of reuse across multiple IndexSearchers (think of it as the engine that executes a search against a specific Lucene Index). This puts Lucene in a tricky spot, since many queries need to accumulate temporary state/statistics associated with the index it is being used against, but the Query contract mandates that it must be immutable. {empty} + {empty} + To get around this, Lucene asks each query to generate a Weight object which acts as a temporary context object to hold state associated with this particular (IndexSearcher, Query) tuple. The `weight` metric shows how long this process takes `build\_scorer`:: This parameter shows how long it takes to build a Scorer for the query. A Scorer is the mechanism that iterates over matching documents generates a score per-document (e.g. how well does "foo" match the document?). Note, this records the time required to generate the Scorer object, not actually score the documents. Some queries have faster or slower initialization of the Scorer, depending on optimizations, complexity, etc. {empty} + {empty} + This may also showing timing associated with caching, if enabled and/or applicable for the query `next\_doc`:: The Lucene method `next\_doc` returns Doc ID of the next document matching the query. This statistic shows the time it takes to determine which document is the next match, a process that varies considerably depending on the nature of the query. Next\_doc is a specialized form of advance() which is more convenient for many queries in Lucene. It is equivalent to advance(docId() + 1) `advance`:: `advance` is the "lower level" version of next\_doc: it serves the same purpose of finding the next matching doc, but requires the calling query to perform extra tasks such as identifying and moving past skips, etc. However, not all queries can use next\_doc, so `advance` is also timed for those queries. {empty} + {empty} + Conjunctions (e.g. `must` clauses in a boolean) are typical consumers of `advance` `matches`:: Some queries, such as phrase queries, match documents using a "Two Phase" process. First, the document is "approximately" matched, and if it matches approximately, it is checked a second time with a more rigorous (and expensive) process. The second phase verification
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/profile.asciidoc
6.2
elasticsearch-6-2
[ 0.024945147335529327, -0.0009551470284350216, -0.029297571629285812, 0.12040896713733673, 0.056777648627758026, -0.07320872694253922, 0.02036304399371147, -0.0176114272326231, 0.0818682387471199, 0.007568982429802418, -0.01404785830527544, -0.047599636018276215, -0.021194150671362877, -0.02893613837659359, -0.04260750487446785, -0.03847891837358475, -0.01639409549534321, -0.08313943445682526, -0.0502924881875515, -0.08177831023931503, 0.06142142787575722, -0.045894525945186615, 0.030012788251042366, -0.0778244212269783, -0.009596796706318855, -0.0027621989138424397, -0.0697503313422203, -0.041516825556755066, 0.020844243466854095, 0.0010564782423898578, -0.045783188194036484, 0.05516163259744644, 0.0383550263941288, 0.070397287607193, -0.05148763954639435, -0.007738664746284485, 0.03695059195160866, 0.017472395673394203, -0.027077514678239822, -0.04095757007598877, 0.006158638279885054, 0.009714854881167412, -0.06358537077903748, -0.025144485756754875, -0.006417387165129185, -0.05341120809316635, -0.060020118951797485, -0.08456242829561234, -0.035458922386169434, 0.038445815443992615, -0.09421315044164658, 0.04047494754195213, -0.029701724648475647, -0.013989737257361412, 0.044386353343725204, 0.06721242517232895, -0.04471995308995247, -0.0022142764646559954, -0.05104371905326843, -0.011678331531584263, -0.03972030431032181, -0.07158105820417404, -0.07139761745929718, 0.00282683246769011, 0.05800658091902733, -0.045918434858322144, 0.08650572597980499, -0.06986913830041885, 0.09123896807432175, -0.02785775251686573, 0.08212922513484955, 0.04920879378914833, -0.0023313548881560564, -0.004222929012030363, 0.021129371598362923, 0.08301378786563873, 0.08720260858535767, 0.00046859128633514047, 0.045582640916109085, -0.0725797638297081, -0.0627111941576004, -0.07372205704450607, -0.031000925227999687, 0.015865271911025047, 0.019022010266780853, -0.022617479786276817, 0.06472419947385788, -0.08863955736160278, 0.0646582692861557, -0.03387092798948288, 0.02340371161699295, -0.03463650494813919, -0.042348552495241165, -0.002805255353450775, 0.05167694762349129, 0.034274209290742874, 0.03699253499507904, 0.04402705654501915, 0.0573774091899395, -0.003305518999695778, 0.02929203398525715, 0.025868000462651253, -0.015134446322917938, 0.0006306077120825648, -0.08147364109754562, -0.025731144472956657, 0.051719535142183304, 0.03969310224056244, -0.05630200728774071, 0.024328654631972313, 0.02255892939865589, 0.041088685393333435, 0.08109728991985321, 0.0016707804752513766, -0.021952064707875252, 0.037398356944322586, 0.04075547680258751, -0.02517688274383545, 0.040162861347198486, 0.08879798650741577, 0.07864651083946228, 0.12942175567150116, -0.037587083876132965, -0.05806621164083481, -0.015353301540017128, 0.029446538537740707, -0.00015931999951135367, 1.787859316675527e-33, 0.0609409436583519, 0.03121376782655716, 0.006060990504920483, -0.04476607218384743, -0.07119929790496826, 0.05660717189311981, 0.04239232838153839, 0.14194345474243164, -0.013714103028178215, 0.07682240009307861, -0.03152638301253319, 0.05454402044415474, -0.10131929814815521, -0.078399658203125, 0.07896579802036285, 0.009322703815996647, -0.016079070046544075, -0.019605154171586037, -0.03643224760890007, 0.04019719734787941, 0.05402766168117523, -0.05902731046080589, -0.055885471403598785, 0.031348034739494324, 0.06212162226438522, -0.06586913019418716, -0.0015784570714458823, 0.000009316057912656106, -0.09506890177726746, 0.008383700624108315, -0.052380114793777466, -0.00990923773497343, -0.07068697363138199, 0.02917071431875229, 0.06392394006252289, 0.01747306063771248, 0.02449418231844902, 0.019973337650299072, -0.004239629954099655, -0.025939198210835457, -0.058448631316423416, -0.01645374856889248, 0.06883599609136581, -0.12163224816322327, -0.14030873775482178, -0.1025889590382576, -0.15378940105438232, -0.024394530802965164, 0.03744351118803024, 0.06803035736083984, 0.03623698279261589, 0.0523543544113636, 0.006871704012155533, -0.023525917902588844, 0.03949829563498497, 0.08672872185707092, 0.08938516676425934, 0.03003331460058689, -0.03653442859649658, 0.10187182575464249, 0.02679571881890297, -0.07764624804258347, 0.017864109948277473, -0.04160967096686363, -0.040964044630527496, 0.09644434601068497, 0.023130206391215324, 0.0817294716835022, 0.07497891783714294, 0.000774125219322741, 0.008679193444550037, 0.02874929830431938, 0.038449760526418686, -0.08227503299713135, 0.052104510366916656, -0.07506739348173141, 0.07277671247720718, -0.03741367906332016, -0.011112650856375694, -0.06709218770265579, 0.027739686891436577, -0.08382560312747955, -0.006811447441577911, 0.006781988777220249, -0.004663009662181139, -0.014670726843178272, -0.046379465609788895, -0.008854247629642487, -0.07647595554590225, -0.049289003014564514, 0.02584783174097538, 0.001126919873058796, -0.026364535093307495, -0.04862003028392792, -0.07019295543432236, -4.117658263278592e-33, -0.04236943647265434, -0.09900335967540741, 0.01970500499010086, 0.01589679718017578, 0.020373307168483734, -0.09988635033369064, -0.03293700888752937, -0.007413753308355808, 0.013179020956158638, 0.03568480908870697, -0.007621262222528458, -0.023854698985815048, 0.03599181026220322, -0.09785697609186172, -0.06681343913078308, 0.10003162175416946, 0.05070479214191437, -0.10645362734794617, 0.06755788624286652, 0.03457598760724068, 0.015076280571520329, 0.11482840776443481, -0.04476185888051987, -0.004667583387345076, -0.03140924498438835, -0.046272046864032745, -0.012789633125066757, -0.0024507108610123396, -0.02429281175136566, 0.039572566747665405, -0.018148260191082954, -0.10080549120903015, -0.006757598835974932, 0.02821013703942299, -0.007042443845421076, -0.09776709228754044, -0.011861572973430157, -0.004790520295500755, -0.030335649847984314, -0.024493681266903877, -0.004349987022578716, 0.02290838211774826, -0.050716109573841095, 0.01611490733921528, 0.024243663996458054, 0.04269300401210785, -0.05536465719342232, 0.026842575520277023, 0.06602542102336884, 0.02108338661491871, 0.027727527543902397, 0.041916120797395706, -0.0024214722216129303, 0.11707746982574463, -0.06832893937826157, -0.042553067207336426, -0.029628576710820198, -0.028334854170680046, 0.001969503704458475, 0.028019163757562637, -0.012152287177741528, 0.051445815712213516, -0.031165484338998795, -0.04176473245024681, 0.026399150490760803, 0.01924150437116623, -0.03842168301343918, -0.022374242544174194, -0.015921700745821, -0.07076923549175262, 0.011514880694448948, -0.03607509285211563, 0.02673526294529438, 0.0035917186178267, -0.057645656168460846, 0.04509904980659485, 0.008001667447388172, 0.019837526604533195, -0.04101347178220749, 0.0512988455593586, 0.008096922188997269, 0.041036006063222885, 0.017276519909501076, -0.018054252490401268, -0.06281173229217529, 0.05078979581594467, 0.021207382902503014, 0.024069977924227715, -0.05700799822807312, 0.019824722781777382, 0.06263022869825363, -0.056306641548871994, -0.06087050214409828, -0.026365645229816437, -0.003950331825762987, -5.282300463704814e-8, 0.0439712330698967, 0.038585979491472244, -0.0655449777841568, 0.042938344180583954, 0.07174430042505264, -0.06695667654275894, 0.01994987204670906, 0.1265062689781189, -0.04410139471292496, -0.03205897659063339, 0.07138912379741669, 0.0486895926296711, -0.016756204888224602, -0.021321767941117287, 0.07717481255531311, -0.05139027163386345, -0.034774962812662125, -0.04353177174925804, -0.037368662655353546, -0.07943394780158997, 0.015625914558768272, 0.045013826340436935, -0.03993784263730049, 0.05028252303600311, -0.03991730883717537, 0.01855897158384323, 0.023370619863271713, 0.00881428923457861, 0.06390347331762314, -0.028301702812314034, -0.05353659763932228, 0.011031671427190304, 0.01972931995987892, 0.008121912367641926, 0.0052828178741037846, 0.02287978306412697, -0.059185244143009186, 0.0076546515338122845, -0.02748408168554306, 0.09912754595279694, 0.04427029564976692, 0.018472159281373024, -0.014860178343951702, 0.06612370163202286, -0.003497418947517872, -0.04008403792977333, -0.06556341052055359, 0.06334898620843887, 0.1256990134716034, -0.016276508569717407, 0.01640997640788555, -0.038458358496427536, -0.06765972077846527, -0.02614334225654602, 0.004517442546784878, 0.0029124501161277294, -0.012081890366971493, 0.014462687075138092, 0.020372044295072556, 0.016094304621219635, 0.0760677307844162, -0.07858426123857498, -0.02012539654970169, 0.03867955878376961 ]
0.071458
in a boolean) are typical consumers of `advance` `matches`:: Some queries, such as phrase queries, match documents using a "Two Phase" process. First, the document is "approximately" matched, and if it matches approximately, it is checked a second time with a more rigorous (and expensive) process. The second phase verification is what the `matches` statistic measures. {empty} + {empty} + For example, a phrase query first checks a document approximately by ensuring all terms in the phrase are present in the doc. If all the terms are present, it then executes the second phase verification to ensure the terms are in-order to form the phrase, which is relatively more expensive than just checking for presence of the terms. {empty} + {empty} + Because this two-phase process is only used by a handful of queries, the `metric` statistic will often be zero `score`:: This records the time taken to score a particular document via it's Scorer `\*\_count`:: Records the number of invocations of the particular method. For example, `"next\_doc\_count": 2,` means the `nextDoc()` method was called on two different documents. This can be used to help judge how selective queries are, by comparing counts between different query components. [[profile-collectors-section]] ==== `collectors` Section The Collectors portion of the response shows high-level execution details. Lucene works by defining a "Collector" which is responsible for coordinating the traversal, scoring and collection of matching documents. Collectors are also how a single query can record aggregation results, execute unscoped "global" queries, execute post-query filters, etc. Looking at the previous example: [source,js] -------------------------------------------------- "collector": [ { "name": "CancellableCollector", "reason": "search\_cancelled", "time\_in\_nanos": "304311", "children": [ { "name": "SimpleTopScoreDocCollector", "reason": "search\_top\_hits", "time\_in\_nanos": "32273" } ] } ] -------------------------------------------------- // TESTRESPONSE[s/^/{\n"took": $body.took,\n"timed\_out": $body.timed\_out,\n"\_shards": $body.\_shards,\n"hits": $body.hits,\n"profile": {\n"shards": [ {\n"id": "$body.$\_path",\n"searches": [{\n"query": $body.$\_path,\n"rewrite\_time": $body.$\_path,/] // TESTRESPONSE[s/]$/]}], "aggregations": []}]}}/] // TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$\_path/] We see a single collector named `SimpleTopScoreDocCollector` wrapped into `CancellableCollector`. `SimpleTopScoreDocCollector` is the default "scoring and sorting" `Collector` used by Elasticsearch. The `reason` field attempts to give a plain english description of the class name. The `time\_in\_nanos` is similar to the time in the Query tree: a wall-clock time inclusive of all children. Similarly, `children` lists all sub-collectors. The `CancellableCollector` that wraps `SimpleTopScoreDocCollector` is used by Elasticsearch to detect if the current search was cancelled and stop collecting documents as soon as it occurs. It should be noted that Collector times are \*\*independent\*\* from the Query times. They are calculated, combined and normalized independently! Due to the nature of Lucene's execution, it is impossible to "merge" the times from the Collectors into the Query section, so they are displayed in separate portions. For reference, the various collector reason's are: [horizontal] `search\_sorted`:: A collector that scores and sorts documents. This is the most common collector and will be seen in most simple searches `search\_count`:: A collector that only counts the number of documents that match the query, but does not fetch the source. This is seen when `size: 0` is specified `search\_terminate\_after\_count`:: A collector that terminates search execution after `n` matching documents have been found. This is seen when the `terminate\_after\_count` query parameter has been specified `search\_min\_score`:: A collector that only returns matching documents that have a score greater than `n`. This is seen when the top-level parameter `min\_score` has been specified. `search\_multi`:: A collector that wraps several other collectors. This is seen when combinations of search, aggregations, global aggs and post\_filters are combined in a single search. `search\_timeout`:: A collector that halts execution after a specified period of time. This is seen when a `timeout` top-level parameter has been specified. `aggregation`:: A collector that Elasticsearch uses to run aggregations against the
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/profile.asciidoc
6.2
elasticsearch-6-2
[ -0.034823402762413025, 0.03994686156511307, -0.0014746725792065263, 0.04865693300962448, 0.06433811038732529, -0.016288496553897858, 0.03244518116116524, -0.012107644230127335, 0.1681889444589615, 0.054462891072034836, 0.022698555141687393, -0.06938344240188599, 0.10529002547264099, -0.04624592512845993, -0.004207165911793709, -0.05016870051622391, 0.017277609556913376, -0.07162141054868698, -0.024976033717393875, -0.06628812104463577, 0.018492441624403, -0.014735056087374687, 0.015968503430485725, -0.01413577701896429, 0.01618204452097416, -0.02167562022805214, -0.11652131378650665, -0.017020579427480698, 0.04859374091029167, 0.05275340378284454, -0.014647994190454483, 0.14281219244003296, 0.02172998897731304, 0.07569276541471481, -0.05357462540268898, 0.011246474459767342, 0.02068660408258438, -0.04017527028918266, -0.01385721005499363, -0.03421267494559288, -0.05786975473165512, -0.08181653171777725, -0.06431716680526733, 0.024759380146861076, 0.03700128197669983, 0.06621298938989639, -0.05757967010140419, 0.01918119750916958, -0.06423907727003098, -0.009600279852747917, -0.06236668676137924, 0.019970471039414406, -0.026443270966410637, 0.010383891873061657, 0.012150679714977741, 0.06975433230400085, -0.0019640468526631594, 0.007760009728372097, -0.06565866619348526, -0.04129042103886604, -0.0350903756916523, -0.11687702685594559, -0.13483327627182007, 0.01803692989051342, 0.07861872017383575, -0.03735540062189102, 0.008187507279217243, -0.057430896908044815, 0.04103376716375351, 0.10050389170646667, -0.02264871634542942, 0.005119876936078072, 0.030493980273604393, 0.06556253135204315, 0.011673718690872192, 0.02749621495604515, 0.04696066677570343, -0.06889064610004425, 0.02427147887647152, -0.000906461151316762, -0.10287453234195709, -0.039158500730991364, 0.002666429616510868, 0.0067726559937000275, 0.04282999783754349, -0.05944526195526123, 0.017984062433242798, -0.062401965260505676, 0.0655393972992897, -0.0055871750228106976, 0.021820612251758575, -0.016957126557826996, -0.02007603645324707, -0.025859111919999123, 0.10546313226222992, 0.04370381683111191, -0.025965681299567223, 0.05131703242659569, 0.1538865864276886, 0.03301173821091652, 0.029454205185174942, 0.06482212245464325, -0.0001561634853715077, -0.12512506544589996, 0.025486920028924942, -0.017894109711050987, 0.0009689498110674322, 0.014967942610383034, 0.050054680556058884, -0.055229149758815765, 0.002029357710853219, -0.06029048189520836, 0.1252535730600357, -0.018980594351887703, -0.09442123025655746, 0.05218680202960968, 0.0654432624578476, 0.04780794307589531, 0.05958724021911621, 0.05643913894891739, 0.008444358594715595, 0.03530092537403107, 0.057470183819532394, -0.07804017513990402, -0.02430613711476326, -0.028059950098395348, 0.01180455181747675, 2.1376537420436075e-33, 0.049897704273462296, -0.01533547230064869, -0.0433662049472332, -0.007090594153851271, -0.13249124586582184, 0.03042120486497879, -0.034098729491233826, 0.07789240032434464, -0.02186824567615986, 0.07370614260435104, -0.041538089513778687, 0.08951232582330704, -0.028701812028884888, 0.04911871999502182, 0.06787683069705963, -0.017751004546880722, 0.011609828099608421, 0.02683309093117714, 0.006294052116572857, 0.01356147788465023, 0.0564081072807312, -0.04475461319088936, 0.04161408543586731, 0.005626137368381023, 0.05158601701259613, 0.008141125552356243, 0.040088992565870285, -0.054650552570819855, -0.06686127930879593, -0.000808354583568871, -0.029095089063048363, -0.04251624271273613, -0.02891240268945694, 0.000022781632651458494, 0.03155557066202164, 0.03250431269407272, -0.017512096092104912, -0.009110966697335243, -0.00840844213962555, -0.08196141570806503, -0.12125898152589798, -0.027701053768396378, 0.026659376919269562, -0.07424046099185944, -0.07099654525518417, -0.042840875685214996, -0.092930369079113, 0.01592538319528103, 0.0647117868065834, 0.04141044616699219, 0.08852525800466537, 0.04466578736901283, 0.0064668841660022736, 0.04826464504003525, -0.025591302663087845, 0.04237638786435127, 0.020111406221985817, -0.012160730548202991, -0.060711540281772614, 0.04467941075563431, -0.007197380997240543, -0.028626034036278725, -0.023442817851901054, 0.008876768872141838, -0.01823507808148861, 0.08857341855764389, -0.036136094480752945, 0.03365206718444824, 0.11570870876312256, 0.03271673619747162, -0.006115299183875322, 0.019570913165807724, -0.023896776139736176, -0.02254428155720234, 0.11439163982868195, -0.07779201120138168, 0.08196261525154114, -0.01324706245213747, -0.016041675582528114, -0.05543065071105957, -0.02525530382990837, -0.006184409838169813, -0.009437242522835732, 0.018371157348155975, -0.05190373212099075, 0.03391965106129646, 0.06092924252152443, 0.001142550609074533, -0.08226443827152252, -0.12497799098491669, -0.006937328260391951, -0.0012674040626734495, -0.07901116460561752, 0.04124242067337036, 0.012001072987914085, -4.166214261491214e-33, 0.01717768982052803, -0.04358397424221039, -0.0223550982773304, 0.0660669356584549, -0.03392370417714119, -0.06864464282989502, 0.020012076944112778, -0.032580431550741196, 0.0843372493982315, -0.05704024061560631, 0.014165728352963924, -0.05088157206773758, 0.04004134610295296, -0.03985803574323654, -0.035041868686676025, 0.011337408795952797, -0.040412772446870804, -0.02250383421778679, -0.003555620787665248, 0.12121329456567764, 0.0865478515625, 0.018315285444259644, -0.04349646717309952, -0.016247136518359184, 0.007089770399034023, -0.03226068615913391, 0.021041475236415863, -0.05205513909459114, -0.0748165100812912, 0.043047744780778885, 0.048877984285354614, -0.022461485117673874, -0.03633493185043335, 0.02385459654033184, -0.023069016635417938, -0.06559082865715027, 0.06118093430995941, 0.021048475056886673, -0.01490637008100748, 0.07866412401199341, 0.04707254469394684, 0.06399336457252502, -0.03447946161031723, 0.018975498154759407, -0.034483231604099274, -0.01429041288793087, -0.035347338765859604, 0.012747801840305328, -0.022843804210424423, -0.0455453023314476, 0.048233289271593094, -0.011199909262359142, -0.0008562952862121165, 0.08278671652078629, -0.037276897579431534, -0.013009611517190933, -0.09969089925289154, -0.010279059410095215, -0.052342891693115234, 0.04369489476084709, -0.008918077684938908, 0.045049507170915604, -0.03425005078315735, 0.033688440918922424, 0.005816917400807142, 0.03221307694911957, 0.012531021609902382, 0.0038743256591260433, 0.03441154211759567, -0.01592736504971981, 0.009527861140668392, 0.02155114896595478, -0.09818647801876068, -0.03728015720844269, -0.00765675725415349, 0.04846585541963577, 0.009464187547564507, -0.07461078464984894, -0.06703580170869827, 0.015802180394530296, -0.053255707025527954, 0.013661440461874008, -0.007848145440220833, 0.07063491642475128, -0.027312686666846275, 0.03601616993546486, -0.011423181742429733, 0.029799699783325195, -0.04265478253364563, 0.04821372032165527, -0.00601145438849926, 0.026922762393951416, -0.016347555443644524, 0.0010509196436032653, -0.10307781398296356, -5.9189897427813776e-8, -0.05780331417918205, -0.03393018990755081, -0.02949407696723938, 0.020337775349617004, 0.04081409424543381, 0.020606569945812225, -0.027557747438549995, -0.015032927505671978, -0.05124266445636749, -0.10777907073497772, 0.11109483242034912, -0.0038197010289877653, -0.12214501947164536, -0.10319076478481293, 0.019859852269291878, 0.01722586899995804, -0.015261119231581688, 0.004459683317691088, -0.058639634400606155, -0.04393095150589943, -0.02946382574737072, 0.014045464806258678, -0.05849354714155197, 0.01555611565709114, -0.06455858051776886, 0.07174283266067505, 0.03661493584513664, 0.06437130272388458, 0.029083898290991783, -0.04212287440896034, 0.039630599319934845, 0.027654360979795456, 0.023857202380895615, -0.008730105124413967, 0.020028386265039444, 0.13467837870121002, 0.006304755806922913, 0.02082667499780655, 0.003954101819545031, 0.06825632601976395, -0.004770277999341488, 0.007822198793292046, -0.06344690918922424, 0.04237189143896103, 0.0011240855092182755, -0.05104104429483414, -0.05510399863123894, 0.036459892988204956, -0.0061951251700520515, -0.0854264497756958, 0.04324394091963768, -0.056429870426654816, -0.06218067929148674, 0.03812433406710625, -0.03175856173038483, 0.020686069503426552, 0.05225047841668129, 0.018134277313947678, 0.021294627338647842, 0.033889662474393845, 0.10079104453325272, -0.019169392064213753, 0.0366629883646965, -0.061513643711805344 ]
0.146308
seen when combinations of search, aggregations, global aggs and post\_filters are combined in a single search. `search\_timeout`:: A collector that halts execution after a specified period of time. This is seen when a `timeout` top-level parameter has been specified. `aggregation`:: A collector that Elasticsearch uses to run aggregations against the query scope. A single `aggregation` collector is used to collect documents for \*all\* aggregations, so you will see a list of aggregations in the name rather. `global\_aggregation`:: A collector that executes an aggregation against the global query scope, rather than the specified query. Because the global scope is necessarily different from the executed query, it must execute it's own match\_all query (which you will see added to the Query section) to collect your entire dataset [[rewrite-section]] ==== `rewrite` Section All queries in Lucene undergo a "rewriting" process. A query (and its sub-queries) may be rewritten one or more times, and the process continues until the query stops changing. This process allows Lucene to perform optimizations, such as removing redundant clauses, replacing one query for a more efficient execution path, etc. For example a Boolean -> Boolean -> TermQuery can be rewritten to a TermQuery, because all the Booleans are unnecessary in this case. The rewriting process is complex and difficult to display, since queries can change drastically. Rather than showing the intermediate results, the total rewrite time is simply displayed as a value (in nanoseconds). This value is cumulative and contains the total time for all queries being rewritten. ==== A more complex example To demonstrate a slightly more complex query and the associated results, we can profile the following query: [source,js] -------------------------------------------------- GET /twitter/\_search { "profile": true, "query": { "term": { "user": { "value": "test" } } }, "aggs": { "my\_scoped\_agg": { "terms": { "field": "likes" } }, "my\_global\_agg": { "global": {}, "aggs": { "my\_level\_agg": { "terms": { "field": "likes" } } } } }, "post\_filter": { "match": { "message": "some" } } } -------------------------------------------------- // CONSOLE // TEST[s/\_search/\_search\?filter\_path=profile.shards.id,profile.shards.searches,profile.shards.aggregations/] // TEST[continued] This example has: - A query - A scoped aggregation - A global aggregation - A post\_filter And the response: [source,js] -------------------------------------------------- { ... "profile": { "shards": [ { "id": "[P6-vulHtQRWuD4YnubWb7A][test][0]", "searches": [ { "query": [ { "type": "TermQuery", "description": "message:some", "time\_in\_nanos": "409456", "breakdown": { "score": 0, "build\_scorer\_count": 1, "match\_count": 0, "create\_weight": 31584, "next\_doc": 0, "match": 0, "create\_weight\_count": 1, "next\_doc\_count": 2, "score\_count": 1, "build\_scorer": 377872, "advance": 0, "advance\_count": 0 } }, { "type": "TermQuery", "description": "user:test", "time\_in\_nanos": "303702", "breakdown": { "score": 0, "build\_scorer\_count": 1, "match\_count": 0, "create\_weight": 185215, "next\_doc": 5936, "match": 0, "create\_weight\_count": 1, "next\_doc\_count": 2, "score\_count": 1, "build\_scorer": 112551, "advance": 0, "advance\_count": 0 } } ], "rewrite\_time": 7208, "collector": [ { "name": "CancellableCollector", "reason": "search\_cancelled", "time\_in\_nanos": 2390, "children": [ { "name": "MultiCollector", "reason": "search\_multi", "time\_in\_nanos": 1820, "children": [ { "name": "FilteredCollector", "reason": "search\_post\_filter", "time\_in\_nanos": 7735, "children": [ { "name": "SimpleTopScoreDocCollector", "reason": "search\_top\_hits", "time\_in\_nanos": 1328 } ] }, { "name": "BucketCollector: [[my\_scoped\_agg, my\_global\_agg]]", "reason": "aggregation", "time\_in\_nanos": 8273 } ] } ] } ] } ], "aggregations": [...] <1> } ] } } -------------------------------------------------- // TESTRESPONSE[s/"aggregations": \[\.\.\.\]/"aggregations": $body.$\_path/] // TESTRESPONSE[s/\.\.\.//] // TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$\_path/] // TESTRESPONSE[s/"id": "\[P6-vulHtQRWuD4YnubWb7A\]\[test\]\[0\]"/"id": $body.profile.shards.0.id/] <1> The ``"aggregations"` portion has been omitted because it will be covered in the next section As you can see, the output is significantly verbose from before. All the major portions of the query are represented: 1. The first `TermQuery` (user:test) represents the main `term` query 2. The second `TermQuery` (message:some) represents the `post\_filter` query The Collector tree is fairly straightforward, showing how a single CancellableCollector wraps a MultiCollector which also wraps a FilteredCollector to execute the post\_filter (and in turn wraps
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/profile.asciidoc
6.2
elasticsearch-6-2
[ 0.006308343727141619, 0.026404786854982376, 0.027309274300932884, 0.08815021067857742, 0.025435589253902435, -0.023458847776055336, -0.04878159239888191, -0.014328421093523502, 0.0797605887055397, -0.012481769546866417, -0.04415154457092285, -0.0013248699251562357, -0.020047472789883614, -0.07540035247802734, -0.1256270706653595, -0.014528661035001278, -0.06849043816328049, -0.021012648940086365, -0.08540578186511993, -0.0258330125361681, 0.10693012923002243, 0.051552508026361465, -0.03974791616201401, -0.06014753878116608, -0.08250011503696442, 0.01654432713985443, -0.11665934324264526, -0.07800545543432236, 0.0457284115254879, 0.023082979023456573, -0.03213421255350113, 0.0238509401679039, -0.0002951270143967122, 0.12949858605861664, -0.061536259949207306, 0.017343105748295784, 0.010405917651951313, -0.007554734591394663, -0.07454975694417953, -0.059648122638463974, 0.039845217019319534, 0.014688439667224884, -0.0832860916852951, -0.0524233840405941, 0.026463985443115234, -0.00573325902223587, 0.027501722797751427, -0.06049525737762451, -0.07640668749809265, 0.005549514200538397, -0.022849680855870247, -0.010616539046168327, -0.09331002831459045, 0.05218703672289848, 0.07230839878320694, 0.06396327167749405, -0.05749187618494034, -0.037425700575113297, -0.02017250470817089, -0.0415474958717823, -0.0011573140509426594, -0.06209252029657364, -0.05401379242539406, -0.010526499710977077, -0.018981391564011574, -0.0817815512418747, 0.10752283781766891, -0.0005287696258164942, 0.04604389891028404, 0.016268743202090263, 0.02777760662138462, -0.0030520602595061064, -0.006993542890995741, 0.04904630407691002, 0.0949416533112526, 0.05185622721910477, 0.02844245731830597, -0.04943191632628441, 0.08092249929904938, -0.02758808620274067, 0.015911176800727844, -0.03266501426696777, 0.004485598765313625, 0.005575852002948523, 0.015701550990343094, -0.07549978047609329, 0.053230877965688705, -0.11009133607149124, 0.06996628642082214, -0.01714704930782318, -0.05435366556048393, -0.10393054783344269, -0.012088785879313946, -0.05849725380539894, 0.03421666473150253, -0.03276120871305466, -0.002703486941754818, 0.02466995269060135, 0.12363813817501068, -0.027241069823503494, 0.021448053419589996, 0.0046613868325948715, 0.03288248926401138, -0.02990259788930416, -0.06830840557813644, -0.049235615879297256, -0.00614673038944602, 0.09409984946250916, -0.04189916327595711, -0.018975526094436646, 0.013565276749432087, 0.04606940969824791, 0.07727319747209549, -0.029472598806023598, -0.0080063221976161, 0.09717663377523422, 0.03378356993198395, -0.029864942654967308, 0.06970123201608658, 0.07408549636602402, 0.005954774562269449, 0.06511552631855011, 0.02389545738697052, -0.08853690326213837, 0.04444188252091408, 0.12697447836399078, -0.03652423247694969, 1.3473761449899801e-33, 0.054336052387952805, -0.07264095544815063, -0.0891125351190567, -0.03955282270908356, -0.05927805230021477, 0.06950307637453079, 0.037297334522008896, 0.09865909814834595, -0.006156230345368385, 0.012628765776753426, -0.017739543691277504, 0.04604334756731987, -0.05500904098153114, 0.060283511877059937, 0.08074059337377548, 0.025227123871445656, 0.07829608768224716, -0.0029366661328822374, 0.02702885866165161, 0.0012527307262644172, 0.06939802318811417, -0.017461970448493958, -0.008801828138530254, 0.04845622554421425, -0.019915057346224785, 0.014168933965265751, -0.050477493554353714, -0.03390202671289444, -0.0783357173204422, 0.04987727478146553, -0.06476368010044098, 0.04769955202937126, -0.042199280112981796, 0.028207194060087204, 0.051980119198560715, 0.019667431712150574, -0.019284050911664963, -0.0011103719007223845, 0.008418042212724686, -0.06222393736243248, -0.05351254716515541, 0.03278642147779465, -0.009488637559115887, -0.06437323242425919, -0.07467488199472427, -0.057885389775037766, -0.08390819281339645, 0.05168501287698746, 0.04715031012892723, 0.05898923799395561, -0.004644686356186867, 0.005422657821327448, 0.08697279542684555, 0.0028283391147851944, 0.08462953567504883, 0.07732469588518143, -0.007572784088551998, 0.026917822659015656, -0.0764964148402214, 0.039121173322200775, -0.006299315951764584, -0.06381260603666306, 0.01973503828048706, 0.052542347460985184, 0.06515669077634811, 0.09162403643131256, 0.025941917672753334, 0.10945030301809311, 0.01076095923781395, 0.03779425099492073, 0.01139102503657341, 0.07604227215051651, -0.011889509856700897, 0.04566015303134918, 0.01692773960530758, -0.09716074168682098, 0.09939836710691452, 0.025771766901016235, -0.08844306319952011, 0.03156190738081932, -0.01547251921147108, -0.03480374813079834, 0.0009395104716531932, -0.03073202446103096, -0.05707497522234917, 0.04572291299700737, 0.013719743117690086, -0.011459498666226864, 0.0010241249110549688, -0.10865863412618637, -0.0018529556691646576, 0.05501576513051987, -0.0450439527630806, -0.0447683148086071, -0.05788170546293259, -4.614531643847511e-33, 0.03901971876621246, -0.02094171568751335, -0.05411526560783386, 0.02545759826898575, 0.01932515762746334, -0.028637845069169998, -0.037509966641664505, -0.0011909533059224486, -0.009788062423467636, -0.021928684785962105, -0.03443922847509384, -0.018053807318210602, 0.05756042152643204, -0.07213985919952393, -0.07630524039268494, -0.012423642911016941, 0.004185952246189117, -0.1574956327676773, -0.0000907739668036811, 0.031571462750434875, -0.06873582303524017, 0.006893398705869913, -0.005943973548710346, 0.012799187563359737, -0.039877865463495255, -0.04116648808121681, -0.06925352662801743, -0.03630952537059784, -0.02529623731970787, 0.0531889945268631, 0.061179500073194504, -0.02460792474448681, 0.05418340116739273, 0.030529875308275223, -0.04702189937233925, -0.009372902102768421, -0.013139130547642708, -0.02585695870220661, -0.005571824498474598, -0.02610325813293457, 0.02878211811184883, 0.03971751406788826, 0.05310797318816185, 0.02911444939672947, 0.024760833010077477, 0.028421685099601746, -0.04334717616438866, 0.05217524990439415, -0.012796694412827492, -0.03753364458680153, -0.0369335412979126, -0.03056708723306656, 0.018057288601994514, 0.052587058395147324, -0.05761174112558365, -0.01303036417812109, 0.03173598274588585, 0.004580785520374775, -0.09433253109455109, 0.046003811061382294, 0.0038947260472923517, 0.032438457012176514, -0.0285547636449337, 0.027274783700704575, -0.00821235217154026, 0.045239441096782684, 0.019693637266755104, -0.057242341339588165, -0.029425829648971558, -0.05952765420079231, -0.01996351219713688, -0.06587377935647964, -0.053837329149246216, 0.005186560098081827, -0.0580173023045063, 0.09541504085063934, -0.03334975242614746, -0.02996358647942543, -0.04033265635371208, 0.00627277372404933, -0.042234379798173904, 0.03820834681391716, 0.018067320808768272, 0.10341167449951172, -0.04043678194284439, 0.021721309050917625, -0.023656345903873444, 0.1245688647031784, -0.05252104625105858, 0.04412676393985748, 0.05831044167280197, -0.05172758549451828, -0.09990152716636658, 0.03136003389954567, 0.04151483252644539, -5.564617566733432e-8, 0.0010487621184438467, 0.06953047960996628, -0.048933856189250946, 0.053504496812820435, 0.03298231586813927, -0.0013603812549263239, 0.06415534764528275, 0.1205032616853714, -0.0686538964509964, 0.01776360534131527, 0.020503681153059006, 0.03707081824541092, -0.05975973233580589, -0.043228879570961, 0.055224426090717316, -0.05515953525900841, -0.021880198270082474, -0.012544744648039341, -0.06174613907933235, -0.04488622769713402, -0.09137523919343948, -0.07428406924009323, -0.02900826558470726, -0.006363026797771454, 0.0011144885793328285, 0.025311792269349098, -0.013705283403396606, 0.01146317645907402, 0.01632807031273842, -0.058949168771505356, -0.024328768253326416, 0.03209887072443962, 0.001209915615618229, 0.04263004660606384, -0.017609700560569763, 0.0336015485227108, -0.036691609770059586, -0.011660214513540268, -0.005440907087177038, 0.03373394533991814, 0.07435575127601624, 0.015252950601279736, 0.016906261444091797, 0.0433630608022213, -0.03829206898808479, 0.04691923037171364, -0.04931052401661873, 0.05172036960721016, 0.06342872977256775, 0.040446892380714417, 0.002931188093498349, -0.011424273252487183, -0.03418038785457611, 0.04969248175621033, 0.03567531332373619, -0.013804239220917225, -0.00947550404816866, -0.09522774070501328, 0.08100626617670059, 0.02956266887485981, 0.03602216765284538, -0.08030962944030762, -0.09355685859918594, 0.03183167427778244 ]
0.158512
the query are represented: 1. The first `TermQuery` (user:test) represents the main `term` query 2. The second `TermQuery` (message:some) represents the `post\_filter` query The Collector tree is fairly straightforward, showing how a single CancellableCollector wraps a MultiCollector which also wraps a FilteredCollector to execute the post\_filter (and in turn wraps the normal scoring SimpleCollector), a BucketCollector to run all scoped aggregations. ==== Understanding MultiTermQuery output A special note needs to be made about the `MultiTermQuery` class of queries. This includes wildcards, regex and fuzzy queries. These queries emit very verbose responses, and are not overly structured. Essentially, these queries rewrite themselves on a per-segment basis. If you imagine the wildcard query `b\*`, it technically can match any token that begins with the letter "b". It would be impossible to enumerate all possible combinations, so Lucene rewrites the query in context of the segment being evaluated. E.g. one segment may contain the tokens `[bar, baz]`, so the query rewrites to a BooleanQuery combination of "bar" and "baz". Another segment may only have the token `[bakery]`, so query rewrites to a single TermQuery for "bakery". Due to this dynamic, per-segment rewriting, the clean tree structure becomes distorted and no longer follows a clean "lineage" showing how one query rewrites into the next. At present time, all we can do is apologize, and suggest you collapse the details for that query's children if it is too confusing. Luckily, all the timing statistics are correct, just not the physical layout in the response, so it is sufficient to just analyze the top-level MultiTermQuery and ignore its children if you find the details too tricky to interpret. Hopefully this will be fixed in future iterations, but it is a tricky problem to solve and still in-progress :) === Profiling Aggregations [[agg-section]] ==== `aggregations` Section The `aggregations` section contains detailed timing of the aggregation tree executed by a particular shard. The overall structure of this aggregation tree will resemble your original Elasticsearch request. Let's execute the previous query again and look at the aggregation profile this time: [source,js] -------------------------------------------------- GET /twitter/\_search { "profile": true, "query": { "term": { "user": { "value": "test" } } }, "aggs": { "my\_scoped\_agg": { "terms": { "field": "likes" } }, "my\_global\_agg": { "global": {}, "aggs": { "my\_level\_agg": { "terms": { "field": "likes" } } } } }, "post\_filter": { "match": { "message": "some" } } } -------------------------------------------------- // CONSOLE // TEST[s/\_search/\_search\?filter\_path=profile.shards.aggregations/] // TEST[continued] Which yields the following aggregation profile output [source,js] -------------------------------------------------- { "profile" : { "shards" : [ { "aggregations" : [ { "type" : "LongTermsAggregator", "description" : "my\_scoped\_agg", "time\_in\_nanos" : 195386, "breakdown" : { "reduce" : 0, "build\_aggregation" : 81171, "build\_aggregation\_count" : 1, "initialize" : 22753, "initialize\_count" : 1, "reduce\_count" : 0, "collect" : 91456, "collect\_count" : 4 } }, { "type" : "GlobalAggregator", "description" : "my\_global\_agg", "time\_in\_nanos" : 190430, "breakdown" : { "reduce" : 0, "build\_aggregation" : 59990, "build\_aggregation\_count" : 1, "initialize" : 29619, "initialize\_count" : 1, "reduce\_count" : 0, "collect" : 100815, "collect\_count" : 4 }, "children" : [ { "type" : "LongTermsAggregator", "description" : "my\_level\_agg", "time\_in\_nanos" : 160329, "breakdown" : { "reduce" : 0, "build\_aggregation" : 55712, "build\_aggregation\_count" : 1, "initialize" : 10559, "initialize\_count" : 1, "reduce\_count" : 0, "collect" : 94052, "collect\_count" : 4 } } ] } ] } ] } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\.//] // TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$\_path/] // TESTRESPONSE[s/"id": "\[P6-vulHtQRWuD4YnubWb7A\]\[test\]\[0\]"/"id": $body.profile.shards.0.id/] From the profile structure we can see that the `my\_scoped\_agg` is internally being run as a `LongTermsAggregator` (because the field it is aggregating, `likes`, is a numeric field). At the same level, we see a `GlobalAggregator` which comes from `my\_global\_agg`. That aggregation
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/profile.asciidoc
6.2
elasticsearch-6-2
[ 0.030552750453352928, 0.00842057354748249, -0.013279791921377182, 0.06320004910230637, -0.04177768900990486, 0.008606821298599243, 0.059570152312517166, -0.04589574784040451, 0.01611175388097763, -0.02057652547955513, -0.06062852963805199, -0.10487021505832672, 0.03647885099053383, -0.07145584374666214, -0.07092895358800888, 0.0515436977148056, -0.016448291018605232, -0.0012472143862396479, -0.0715608075261116, -0.048001766204833984, 0.06292760372161865, 0.03838847950100899, 0.0060782236978411674, -0.00798692274838686, -0.0689268633723259, -0.00032520847162231803, -0.09867321699857712, -0.00779992900788784, 0.035265956073999405, 0.009918288327753544, -0.011210203170776367, 0.0904608890414238, -0.010417778976261616, 0.12919792532920837, -0.0417189747095108, -0.05957062169909477, -0.014624807983636856, -0.042197294533252716, -0.029393618926405907, -0.06084631010890007, 0.01226744893938303, 0.002825699979439378, -0.042951103299856186, -0.017026489600539207, -0.013420415110886097, 0.015822961926460266, -0.09113240987062454, -0.004859105218201876, -0.026482783257961273, -0.03711259737610817, -0.0831030011177063, 0.031174808740615845, -0.11035130172967911, 0.08364652842283249, 0.055489394813776016, -0.0006744719576090574, -0.12778735160827637, -0.06674402207136154, -0.009397152811288834, -0.06073368340730667, -0.06629865616559982, -0.07636228948831558, -0.04458685964345932, 0.024772504344582558, 0.038216643035411835, -0.08135534077882767, 0.04426946863532066, -0.009420379064977169, 0.09520585089921951, -0.020419053733348846, -0.01049845851957798, -0.006989726331084967, -0.048663150519132614, 0.030835390090942383, 0.04075266420841217, 0.13495440781116486, 0.010763298720121384, 0.015489176847040653, 0.021616768091917038, 0.05280299112200737, -0.028398364782333374, -0.02159237302839756, 0.03621271252632141, 0.0451078899204731, 0.08080897480249405, -0.04412199556827545, -0.03289332985877991, -0.1762598752975464, 0.08827666938304901, -0.0054463595151901245, 0.0005928255268372595, -0.12098054587841034, 0.03194495663046837, 0.014843524433672428, 0.012976727448403835, -0.05346471443772316, 0.04085821285843849, -0.006135385949164629, 0.13891781866550446, 0.03464929759502411, 0.012954763136804104, -0.0009147950331680477, 0.03783515468239784, -0.12150594592094421, -0.08902069181203842, 0.011055639013648033, -0.0017976657254621387, 0.014055797830224037, 0.0895894467830658, -0.039253897964954376, -0.032756853848695755, 0.034108005464076996, 0.06024591997265816, 0.005420211236923933, -0.05604805052280426, -0.0007281260914169252, 0.0751633271574974, -0.029143666848540306, 0.060158468782901764, 0.007082951255142689, 0.02048194780945778, 0.03566991537809372, 0.001490458962507546, -0.05237099900841713, 0.05813334509730339, 0.07034975290298462, -0.02908707596361637, 5.3136018077013715e-33, 0.07946045696735382, -0.03941085562109947, 0.016269944608211517, -0.03779887035489082, -0.060787323862314224, 0.1135401502251625, -0.008249678649008274, 0.11669091880321503, 0.006572249345481396, 0.03860681131482124, 0.019324224442243576, 0.05838589370250702, -0.019549256190657616, 0.08293851464986801, 0.06120411306619644, -0.00972448755055666, -0.02570907585322857, -0.02835788205265999, 0.0016217435477301478, 0.02171768620610237, -0.011908965185284615, 0.023596063256263733, -0.03734632954001427, -0.007182374596595764, 0.0040627894923090935, 0.02981860190629959, -0.006253174040466547, -0.028959117829799652, -0.013871757313609123, 0.05964553728699684, -0.09205438196659088, -0.004109141882508993, -0.030678780749440193, 0.004672938026487827, 0.047589998692274094, 0.09237472712993622, -0.03643309697508812, -0.012315974570810795, -0.009062672965228558, -0.03285788744688034, -0.12051887810230255, -0.05667551979422569, 0.028348661959171295, -0.07001638412475586, -0.07079805433750153, -0.032810065895318985, -0.1023397445678711, -0.014745539985597134, 0.010313618928194046, -0.00901829544454813, -0.0015489441575482488, 0.0022611094173043966, 0.058483950793743134, 0.014169596135616302, 0.04861307144165039, 0.07051213085651398, 0.034299250692129135, 0.01355390902608633, -0.0602417029440403, 0.09458964318037033, -0.05695296823978424, 0.002145773498341441, -0.001071549253538251, 0.00368340197019279, 0.014453057199716568, 0.03304806351661682, -0.01680082269012928, 0.07201819866895676, 0.0666603222489357, 0.03568005934357643, -0.0025385499466210604, 0.04808490350842476, 0.007927104830741882, -0.03523452207446098, 0.018387727439403534, -0.040774766355752945, 0.07831322401762009, 0.05643065646290779, -0.02450972981750965, -0.021506836637854576, 0.006625902373343706, -0.042421746999025345, 0.03505953401327133, 0.030579717829823494, -0.07325373589992523, 0.0322694331407547, 0.03602520748972893, -0.022087326273322105, -0.061593957245349884, -0.07061994820833206, 0.013087617233395576, 0.03491288796067238, -0.05716298148036003, 0.04202913120388985, 0.009064002893865108, -7.596539672008906e-33, 0.01619802974164486, -0.04042564332485199, -0.055474117398262024, -0.009927191771566868, -0.024275945499539375, -0.09211509674787521, 0.014378279447555542, -0.06687727570533752, -0.009092089720070362, -0.0570007748901844, -0.08121953904628754, 0.022257035598158836, 0.056334760040044785, -0.033141132444143295, 0.013958895578980446, -0.005054973065853119, -0.021326541900634766, -0.0577130950987339, -0.04008544608950615, 0.07995506376028061, -0.0011066534789279103, 0.08866868168115616, -0.02736789733171463, -0.020997390151023865, -0.06993204355239868, -0.05491938441991806, -0.023746175691485405, -0.03929784521460533, 0.021024299785494804, 0.05236399546265602, 0.07917387783527374, -0.10699457675218582, 0.0490083210170269, -0.047294918447732925, -0.021133191883563995, -0.10784243792295456, 0.0038383137434720993, -0.02852771058678627, 0.023415228351950645, -0.01833135262131691, 0.03182680532336235, 0.009907550178468227, 0.033784668892621994, 0.0223236083984375, 0.07161324471235275, 0.00479893758893013, -0.007779084611684084, 0.037575699388980865, 0.008804439567029476, 0.007982367649674416, -0.03780808672308922, -0.017710890620946884, -0.024091778323054314, 0.12625762820243835, -0.07161253690719604, -0.04380395635962486, 0.0019591362215578556, -0.04552463814616203, -0.02471204660832882, 0.004205105360597372, -0.05653531104326248, 0.07009395956993103, 0.040239106863737106, -0.019619833678007126, 0.03649858012795448, 0.022758973762392998, 0.007770744152367115, -0.04448266699910164, -0.019597815349698067, -0.06946714222431183, -0.01767946593463421, -0.07489588856697083, 0.013455187901854515, 0.045250024646520615, 0.04628866910934448, 0.05065540224313736, -0.05095808207988739, -0.027249790728092194, -0.04151420295238495, 0.03552767634391785, -0.06843221187591553, -0.015864109620451927, 0.029478879645466805, 0.1518925577402115, -0.020299868658185005, -0.03919524326920509, 0.014723498374223709, 0.07535349577665329, -0.034904707223176956, -0.014458240941166878, 0.09963857382535934, -0.010786093771457672, -0.04552089795470238, 0.026754077523946762, 0.03335479274392128, -6.024288268235978e-8, -0.06266207247972488, 0.012256383895874023, -0.13526026904582977, 0.06372135132551193, 0.05097627267241478, -0.02428513765335083, 0.0005713553400710225, 0.050274789333343506, -0.09159411489963531, -0.003561897436156869, 0.07550585269927979, 0.022132819518446922, -0.09087264537811279, -0.05063534528017044, 0.05455823615193367, -0.01077935378998518, -0.056369177997112274, 0.01997370645403862, -0.05472862347960472, 0.006759092211723328, -0.05987268313765526, -0.037659965455532074, -0.009623320773243904, 0.04506474733352661, -0.04069322720170021, 0.07519315183162689, 0.060453012585639954, 0.012784475460648537, 0.03416819870471954, 0.0008736032759770751, 0.010695523582398891, 0.03290662169456482, -0.019816666841506958, 0.020233038812875748, -0.00490312185138464, 0.04105355218052864, -0.04609764367341995, -0.01416095718741417, 0.014362307265400887, 0.06733372062444687, 0.08084239810705185, 0.011867405846714973, 0.026662226766347885, 0.03413878753781319, -0.021749937906861305, -0.03390485793352127, -0.025430945679545403, 0.02647419460117817, 0.07274819910526276, 0.07154341787099838, -0.014586439356207848, -0.024276122450828552, -0.007757031824439764, 0.07400387525558472, 0.00387586303986609, -0.049768611788749695, -0.011688056401908398, -0.045337580144405365, 0.024221939966082573, 0.03399578481912613, 0.13232295215129852, -0.026854529976844788, -0.06129099428653717, 0.06307706981897354 ]
0.094739
TESTRESPONSE[s/\.\.\.//] // TESTRESPONSE[s/(?<=[" ])\d+(\.\d+)?/$body.$\_path/] // TESTRESPONSE[s/"id": "\[P6-vulHtQRWuD4YnubWb7A\]\[test\]\[0\]"/"id": $body.profile.shards.0.id/] From the profile structure we can see that the `my\_scoped\_agg` is internally being run as a `LongTermsAggregator` (because the field it is aggregating, `likes`, is a numeric field). At the same level, we see a `GlobalAggregator` which comes from `my\_global\_agg`. That aggregation then has a child `LongTermsAggregator` which from the second terms aggregation on `likes`. The `time\_in\_nanos` field shows the time executed by each aggregation, and is inclusive of all children. While the overall time is useful, the `breakdown` field will give detailed stats about how the time was spent. ===== Timing Breakdown The `breakdown` component lists detailed timing statistics about low-level Lucene execution: [source,js] -------------------------------------------------- "breakdown": { "reduce": 0, "reduce\_count": 0, "build\_aggregation": 49765, "build\_aggregation\_count": 300, "initialize": 52785, "initialize\_count": 300, "reduce\_count": 0, "collect": 3155490036, "collect\_count": 1800 } -------------------------------------------------- // NOTCONSOLE Timings are listed in wall-clock nanoseconds and are not normalized at all. All caveats about the overall `time` apply here. The intention of the breakdown is to give you a feel for A) what machinery in Elasticsearch is actually eating time, and B) the magnitude of differences in times between the various components. Like the overall time, the breakdown is inclusive of all children times. The meaning of the stats are as follows: [float] ==== All parameters: [horizontal] `initialise`:: This times how long it takes to create and initialise the aggregation before starting to collect documents. `collect`:: This represents the cumulative time spent in the collect phase of the aggregation. This is where matching documents are passed to the aggregation and the state of the aggregator is updated based on the information contained in the documents. `build\_aggregation`:: This represents the time spent creating the shard level results of the aggregation ready to pass back to the reducing node after the collection of documents is finished. `reduce`:: This is not currently used and will always report `0`. Currently aggregation profiling only times the shard level parts of the aggregation execution. Timing of the reduce phase will be added later. `\*\_count`:: Records the number of invocations of the particular method. For example, `"collect\_count": 2,` means the `collect()` method was called on two different documents. === Profiling Considerations ==== Performance Notes Like any profiler, the Profile API introduces a non-negligible overhead to search execution. The act of instrumenting low-level method calls such as `collect`, `advance` and `next\_doc` can be fairly expensive, since these methods are called in tight loops. Therefore, profiling should not be enabled in production settings by default, and should not be compared against non-profiled query times. Profiling is just a diagnostic tool. There are also cases where special Lucene optimizations are disabled, since they are not amenable to profiling. This could cause some queries to report larger relative times than their non-profiled counterparts, but in general should not have a drastic effect compared to other components in the profiled query. ==== Limitations - Profiling statistics are currently not available for suggestions, highlighting, `dfs\_query\_then\_fetch` - Profiling of the reduce phase of aggregation is currently not available - The Profiler is still highly experimental. The Profiler is instrumenting parts of Lucene that were never designed to be exposed in this manner, and so all results should be viewed as a best effort to provide detailed diagnostics. We hope to improve this over time. If you find obviously wrong numbers, strange query structures or other bugs, please report them!
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/profile.asciidoc
6.2
elasticsearch-6-2
[ -0.03925720974802971, 0.016497936099767685, 0.043388482183218, 0.09052757173776627, 0.03337234631180763, -0.030451901257038116, 0.022042350843548775, 0.004409493412822485, 0.11479238420724869, -0.013797388412058353, 0.02351708896458149, -0.04714052751660347, -0.010620773769915104, 0.01822548918426037, -0.010853544808924198, 0.0032822107896208763, -0.042496487498283386, -0.03852630406618118, -0.13362056016921997, -0.07645975798368454, 0.011975406669080257, 0.030671408399939537, 0.02429008297622204, -0.03848815709352493, -0.0071074771694839, -0.03972760960459709, -0.08310584723949432, 0.039809197187423706, 0.09568395465612411, 0.007757768966257572, 0.06179631128907204, 0.10105256736278534, -0.07749020308256149, 0.022118542343378067, 0.0004895950551144779, 0.08197169005870819, 0.08194064348936081, -0.019755536690354347, -0.06200078874826431, -0.04107530415058136, 0.10895556956529617, -0.013828485272824764, -0.023984501138329506, -0.03285003453493118, 0.008428298868238926, 0.006228052545338869, -0.0018701963126659393, -0.01114831492304802, -0.13911627233028412, -0.022706864401698112, -0.054252516478300095, -0.05066505819559097, -0.04903184622526169, 0.02334095723927021, 0.035675760358572006, 0.059795841574668884, -0.01995248720049858, -0.0069146170280873775, 0.002640423597767949, -0.06322389096021652, -0.03610473871231079, -0.11224065721035004, -0.03295552358031273, -0.036935240030288696, 0.03302716836333275, -0.028800034895539284, 0.022826725617051125, 0.004820181056857109, -0.014915966428816319, 0.035642337054014206, -0.016127483919262886, -0.010365939699113369, -0.03875630721449852, 0.060635149478912354, 0.05884925648570061, 0.12620048224925995, -0.041546232998371124, -0.019334467127919197, 0.08519706130027771, -0.09479957818984985, -0.003005760023370385, -0.02212720364332199, 0.03297454118728638, -0.011606017127633095, 0.030685365200042725, -0.012279889546334743, 0.017594873905181885, -0.05734926089644432, 0.048730991780757904, -0.01287619024515152, -0.03358936309814453, -0.06859685480594635, 0.025733068585395813, 0.016323650255799294, -0.02035708725452423, 0.01590154878795147, -0.010651686228811741, -0.00441910931840539, 0.06923730671405792, 0.06801353394985199, -0.001199553720653057, 0.057662855833768845, 0.02846813201904297, 0.05283938720822334, -0.04107710346579552, 0.011579429730772972, -0.08827853947877884, 0.09023261815309525, -0.08861909806728363, 0.02583775483071804, 0.035408131778240204, 0.04042763635516167, 0.02902597188949585, 0.009195022284984589, 0.020030435174703598, 0.03026430495083332, 0.031016429886221886, -0.011342806741595268, 0.010537471622228622, 0.02233557589352131, 0.10973884910345078, 0.026812804862856865, 0.02388419769704342, 0.008393530733883381, 0.015705369412899017, 0.007623093668371439, -0.00967800710350275, 2.3369823191125428e-33, 0.08692745864391327, 0.004976358264684677, 0.017194898799061775, -0.02237681671977043, -0.002006643684580922, 0.07388944178819656, -0.016480762511491776, 0.0815751701593399, -0.002244099974632263, 0.09601163864135742, -0.05701686441898346, 0.028495537117123604, -0.010883214883506298, -0.03508071228861809, 0.03323870897293091, -0.006703495047986507, 0.05413411185145378, 0.02291867323219776, -0.031230030581355095, -0.0014632270904257894, 0.0554531067609787, 0.012998867779970169, -0.056416433304548264, -0.004941609688103199, 0.03890260308980942, -0.02336996980011463, -0.016767900437116623, -0.04447011277079582, -0.0837874561548233, -0.02004196308553219, -0.0017787523102015257, 0.021260421723127365, -0.008101348765194416, -0.002138155745342374, 0.06209319457411766, 0.00651464331895113, 0.04957767203450203, -0.041300419718027115, -0.09049221128225327, -0.020481176674365997, 0.030102357268333435, 0.017652124166488647, 0.011976070702075958, -0.04506111517548561, -0.1176416352391243, -0.08905204385519028, -0.03872489184141159, 0.02154497057199478, 0.006575362756848335, 0.056936219334602356, -0.00175513606518507, 0.0019714292138814926, 0.04207918047904968, -0.018433574587106705, -0.0047755674459040165, 0.04276391118764877, -0.03533308953046799, 0.03547083958983421, -0.031753938645124435, 0.015523207373917103, 0.056058526039123535, -0.05578327178955078, -0.041938476264476776, 0.007064962759613991, -0.03272232040762901, 0.02121157757937908, -0.0016804801998659968, 0.02175544761121273, 0.08005323261022568, 0.09082648158073425, 0.02052263543009758, 0.16498129069805145, -0.06336396187543869, -0.012616830877959728, 0.023117173463106155, -0.17738313972949982, 0.0077463616617023945, -0.006550718564540148, -0.04894060268998146, 0.0012353574857115746, 0.0057982103899121284, 0.02017679065465927, -0.07763750851154327, 0.01897260919213295, -0.10500720888376236, 0.026195194572210312, 0.011507667601108551, -0.09124933928251266, -0.09457602351903915, -0.13378892838954926, 0.001302968361414969, -0.03367186337709427, -0.0030953101813793182, -0.06601423025131226, -0.10507715493440628, -3.0368494314020626e-33, 0.0848141461610794, -0.08501455187797546, -0.00432685436680913, 0.029113469645380974, 0.084871806204319, -0.06431545317173004, 0.06296063959598541, 0.08344999700784683, -0.03674806281924248, -0.05792388692498207, 0.0036507919430732727, 0.014827062375843525, 0.017162049189209938, -0.0025211547035723925, 0.05763937532901764, 0.03357381001114845, -0.03876414895057678, -0.15103618800640106, 0.10587333142757416, 0.007315973751246929, -0.032675500959157944, 0.09922125935554504, -0.004931088071316481, 0.04006355255842209, -0.038746029138565063, -0.03745655342936516, 0.01538683008402586, -0.024826563894748688, -0.06034637242555618, 0.055501509457826614, 0.030344605445861816, -0.021553318947553635, -0.1170339584350586, 0.006381429731845856, -0.08736082911491394, -0.05877844616770744, -0.030521661043167114, 0.00991776306182146, -0.04287983477115631, 0.036898739635944366, 0.04555223509669304, 0.09165336191654205, -0.08372779190540314, 0.0401209257543087, -0.023633889853954315, 0.07272952795028687, 0.04215892404317856, 0.020098865032196045, 0.051502734422683716, -0.07692015171051025, 0.028536725789308548, -0.020576579496264458, 0.027936287224292755, 0.1516241431236267, -0.008326948620378971, -0.0035523632541298866, 0.009396351873874664, -0.06533096730709076, -0.08720491826534271, -0.049213018268346786, 0.016585227102041245, 0.012243437580764294, -0.03987324237823486, -0.0021883798763155937, 0.046975765377283096, -0.005932345520704985, -0.02349150739610195, -0.09728113561868668, 0.02035253867506981, -0.07730968296527863, -0.011526817455887794, -0.02965366281569004, -0.04525896906852722, -0.00801597535610199, 0.005716938525438309, -0.001659159199334681, -0.0038180078845471144, -0.00826228316873312, 0.05338175594806671, 0.04486174136400223, -0.1151401549577713, 0.011423016898334026, -0.029240544885396957, 0.0583769753575325, -0.07522037625312805, -0.04129083454608917, 0.02932782471179962, 0.1620115041732788, -0.023359740152955055, 0.03418247401714325, 0.001984206261113286, 0.03576432913541794, -0.03180965408682823, 0.05337372422218323, 0.03284769132733345, -5.036353201148813e-8, -0.008690199814736843, 0.018511811271309853, -0.11771465837955475, 0.02838621661067009, -0.01561460830271244, -0.0002976295363623649, 0.02130003087222576, 0.018274320289492607, 0.006611726712435484, 0.004848444368690252, -0.011368111707270145, 0.004994389601051807, -0.029748843982815742, -0.06369669735431671, 0.010978665202856064, -0.014794670976698399, -0.014993317425251007, 0.04389328882098198, -0.0823112353682518, -0.009299076162278652, -0.03684146702289581, 0.06332550942897797, -0.004951355047523975, -0.06901033967733383, -0.035404033958911896, 0.05982955917716026, 0.016388116404414177, 0.022611461579799652, -0.04041808843612671, 0.002820685040205717, -0.008235955610871315, 0.007440284360200167, 0.015995902940630913, -0.023126916959881783, -0.022544313222169876, 0.07122550159692764, -0.07506748288869858, 0.01527777686715126, 0.03330571949481964, 0.08469150960445404, 0.04092194512486458, -0.009693004190921783, 0.00657288683578372, 0.04283694922924042, 0.0023522144183516502, -0.05658502131700516, 0.008966745808720589, 0.012228457257151604, 0.07374925911426544, 0.015453997999429703, -0.0035923272371292114, -0.021256500855088234, -0.06469541043043137, -0.016736486926674843, 0.007771965116262436, -0.036209892481565475, 0.05548049136996269, -0.028463417664170265, 0.011682591401040554, 0.050399549305438995, 0.06899657845497131, -0.08643625676631927, -0.0261159036308527, -0.033239156007766724 ]
0.02612
you find obviously wrong numbers, strange query structures or other bugs, please report them!
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/profile.asciidoc
6.2
elasticsearch-6-2
[ 0.008072896860539913, -0.016777565702795982, -0.0189801175147295, 0.05406387522816658, -0.0834919735789299, -0.00472819060087204, -0.027992552146315575, -0.007036272902041674, -0.0019538733176887035, 0.007574888411909342, 0.03264335170388222, -0.059039484709501266, 0.06193101778626442, -0.0017546191811561584, -0.1045621782541275, -0.008131283335387707, -0.07266508042812347, -0.05863757058978081, -0.029700661078095436, -0.005098334979265928, -0.04723800718784332, 0.0611240491271019, -0.01884368248283863, 0.010489748790860176, 0.09644511342048645, -0.05220668762922287, -0.07394641637802124, -0.027354903519153595, -0.0034350280184298754, -0.07466503232717514, -0.06682378798723221, 0.14176045358181, 0.020232582464814186, 0.028277050703763962, 0.028501184657216072, -0.04869070649147034, -0.005071017425507307, -0.08134431391954422, -0.011991961859166622, 0.002053400268778205, -0.006788633763790131, -0.038961704820394516, 0.08223144710063934, 0.04234824329614639, -0.03284023329615593, 0.05645158886909485, -0.10795644670724869, 0.07932774722576141, 0.0622679777443409, 0.058885328471660614, -0.11916394531726837, 0.06747138500213623, -0.02928258664906025, 0.0676233172416687, -0.015248714946210384, -0.008200530894100666, -0.11657655239105225, -0.00029677379643544555, 0.00803691428154707, 0.08686322718858719, 0.040868375450372696, 0.024528566747903824, 0.006801317911595106, -0.03773293271660805, 0.025568151846528053, -0.03030439466238022, -0.015037493780255318, -0.1323346048593521, -0.02904365211725235, -0.018505724146962166, 0.040351178497076035, 0.04736079275608063, -0.061325110495090485, 0.10508349537849426, -0.008870026096701622, 0.0657762810587883, -0.05606573820114136, -0.029599428176879883, -0.00048358910134993494, -0.016294920817017555, -0.046068668365478516, -0.023402243852615356, -0.06508555263280869, 0.023863576352596283, 0.13657116889953613, -0.03753294050693512, 0.07911066710948944, -0.01652013324201107, 0.023100771009922028, 0.02089885249733925, 0.05752602592110634, 0.05186692252755165, 0.030046284198760986, 0.03276323899626732, -0.04247605428099632, 0.03839791193604469, 0.05474141240119934, 0.055876243859529495, 0.003778409445658326, 0.06887009739875793, -0.031783029437065125, 0.033929016441106796, -0.04012197628617287, 0.01624394580721855, -0.08250625431537628, 0.00456700474023819, 0.0631379783153534, 0.056900471448898315, -0.014420900493860245, -0.04290410876274109, -0.027619045227766037, -0.010916785337030888, 0.01230649184435606, -0.09492821991443634, 0.0024899516720324755, -0.06312818825244904, 0.03577409312129021, 0.021503834053874016, -0.02098708786070347, 0.020669041201472282, 0.035994965583086014, 0.07474970072507858, 0.009221827611327171, -0.02441941574215889, -0.03770050033926964, 0.04064272716641426, -0.06665768474340439, -1.6767747331808362e-33, 0.0069718980230391026, -0.07316608726978302, 0.07928033173084259, 0.03973546624183655, -0.033021945506334305, -0.001095604500733316, -0.07480692118406296, 0.07638826966285706, 0.003068717196583748, 0.045213110744953156, 0.008000118657946587, -0.03159470483660698, 0.056614115834236145, -0.024716781452298164, 0.03387908637523651, 0.058488164097070694, 0.04891364648938179, 0.05699102580547333, -0.03780515119433403, 0.008908739313483238, 0.09583419561386108, -0.05513940379023552, 0.02825297601521015, -0.028910543769598007, 0.04737791046500206, 0.17457892000675201, -0.046502962708473206, -0.009681915864348412, 0.08486021310091019, 0.023730529472231865, -0.0258901659399271, -0.03164978697896004, -0.015441919676959515, 0.00228001456707716, 0.012013751082122326, 0.04399748891592026, 0.041074901819229126, 0.0030718387570232153, -0.017137886956334114, -0.03489110991358757, -0.06914972513914108, 0.02995753288269043, -0.0395558625459671, -0.0262056365609169, 0.004027724266052246, -0.04416222497820854, 0.02388625591993332, 0.006424973253160715, 0.023077215999364853, 0.02846374362707138, -0.13716287910938263, 0.017197836190462112, 0.00006575596489710733, 0.051534172147512436, -0.016688453033566475, -0.06673984229564667, 0.03139439597725868, 0.061860475689172745, -0.03160429745912552, 0.03181968256831169, 0.003092563711106777, 0.032534435391426086, 0.0052577899768948555, -0.13338029384613037, -0.0438399538397789, 0.004780155140906572, -0.00455948431044817, 0.016112808138132095, 0.06567975878715515, 0.06462131440639496, 0.03907421976327896, 0.05673886835575104, 0.0720553770661354, 0.01501716673374176, 0.018901120871305466, -0.06933855265378952, 0.014104284346103668, -0.0534149594604969, -0.00824892707169056, 0.04533190280199051, 0.05548587068915367, -0.027288421988487244, -0.0023668669164180756, 0.01445958111435175, -0.03424306586384773, -0.0037463463377207518, 0.014260298572480679, 0.01899602636694908, -0.038370098918676376, 0.016907067969441414, 0.10593371093273163, 0.03389739245176315, 0.03432389348745346, -0.01220128033310175, -0.03924513980746269, -1.236482579327298e-33, -0.12004632502794266, 0.02502286061644554, -0.05545834079384804, -0.05970601364970207, -0.01722273789346218, -0.0594475232064724, 0.05393528193235397, 0.015596098266541958, 0.012499029748141766, 0.020953815430402756, 0.04317213594913483, -0.029488563537597656, -0.07625655829906464, -0.026259535923600197, 0.020747128874063492, 0.029484055936336517, 0.004629075527191162, -0.009930950589478016, -0.03881174698472023, 0.015084614977240562, -0.031667232513427734, 0.20831157267093658, -0.1156342625617981, 0.06237854063510895, -0.01599760726094246, 0.062207628041505814, 0.038331352174282074, -0.058135997503995895, 0.0027848093304783106, 0.01981203630566597, 0.013524841517210007, -0.03273409977555275, -0.07224289327859879, 0.007894891314208508, 0.003749901195988059, -0.06803469359874725, -0.01913425326347351, -0.04672089219093323, 0.015285056084394455, -0.0015360997058451176, 0.027133500203490257, -0.013008689507842064, 0.05545533448457718, 0.05709929019212723, 0.005380235146731138, -0.019534548744559288, 0.02643108181655407, 0.024800598621368408, -0.00862849224358797, -0.04024636000394821, -0.009673806838691235, -0.049540143460035324, -0.04120450094342232, -0.007752194069325924, 0.048261165618896484, 0.03866881504654884, -0.04758840054273605, 0.054213181138038635, 0.028284825384616852, 0.018048061057925224, -0.03442521393299103, 0.12018338590860367, -0.038297466933727264, -0.021456502377986908, -0.018028968945145607, -0.039044614881277084, -0.04926871508359909, 0.0013589684385806322, -0.023323260247707367, -0.07206404209136963, -0.05003708600997925, 0.011172518134117126, -0.017204012721776962, -0.030247358605265617, -0.031729668378829956, 0.030435549095273018, -0.01931181363761425, 0.11760295927524567, 0.023633643984794617, 0.08102647960186005, 0.05360874906182289, 0.06388050317764282, 0.08644898235797882, 0.001969940960407257, -0.039863355457782745, -0.010647010058164597, 0.05976269766688347, 0.03783779963850975, -0.0471591055393219, -0.009130542166531086, -0.016218548640608788, -0.014985280111432076, -0.04505443945527077, 0.016821760684251785, 0.038039855659008026, -2.391778863852778e-8, 0.008777101524174213, -0.0011294357245787978, -0.03963281959295273, 0.016339825466275215, 0.09301356226205826, -0.056998077780008316, -0.026500392705202103, 0.10952609032392502, -0.04290805011987686, -0.031129449605941772, -0.03944210708141327, -0.04408926144242287, -0.020859964191913605, -0.06693415343761444, 0.06393532454967499, -0.14668679237365723, -0.06093178689479828, 0.03959563001990318, -0.06178060546517372, -0.14338365197181702, -0.053833745419979095, 0.007284179795533419, 0.01851850561797619, -0.06863148510456085, -0.00999552570283413, -0.004123886115849018, -0.009647874161601067, 0.12146203219890594, -0.0026415407191962004, -0.02603771910071373, 0.01159473042935133, -0.028494326397776604, -0.01897292211651802, -0.044572245329618454, -0.040511470288038254, 0.004966886714100838, -0.005006205756217241, 0.01660959981381893, -0.04757024720311165, -0.10302511602640152, 0.029562240466475487, -0.054910797625780106, 0.011885231360793114, 0.04904569685459137, -0.04600618779659271, 0.028973795473575592, -0.0032909109722822905, -0.00021888993796892464, 0.0765625387430191, -0.12291326373815536, -0.023254215717315674, -0.0367756225168705, 0.031324610114097595, 0.00852170865982771, 0.03564891964197159, -0.014736725017428398, -0.016155481338500977, -0.03466357663273811, 0.006486464757472277, 0.0056253597140312195, 0.06377643346786499, -0.07181790471076965, -0.05814487859606743, 0.057361382991075516 ]
0.058277
[[search-rank-eval]] == Ranking Evaluation API experimental["The ranking evaluation API is experimental and may be changed or removed completely in a future release, as well as change in non-backwards compatible ways on minor versions updates. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features."] The ranking evaluation API allows to evaluate the quality of ranked search results over a set of typical search queries. Given this set of queries and a list of manually rated documents, the `\_rank\_eval` endpoint calculates and returns typical information retrieval metrics like \_mean reciprocal rank\_, \_precision\_ or \_discounted cumulative gain\_. [float] === Overview Search quality evaluation starts with looking at the users of your search application, and the things that they are searching for. Users have a specific \_information need\_, e.g. they are looking for gift in a web shop or want to book a flight for their next holiday. They usually enters some search terms into a search box or some other web form. All of this information, together with meta information about the user (e.g. the browser, location, earlier preferences etc...) then gets translated into a query to the underlying search system. The challenge for search engineers is to tweak this translation process from user entries to a concrete query in such a way, that the search results contain the most relevant information with respect to the users information need. This can only be done if the search result quality is evaluated constantly across a representative test suite of typical user queries, so that improvements in the rankings for one particular query doesn't negatively effect the ranking for other types of queries. In order to get started with search quality evaluation, three basic things are needed: . a collection of documents you want to evaluate your query performance against, usually one or more indices . a collection of typical search requests that users enter into your system . a set of document ratings that judge the documents relevance with respect to a search request+ It is important to note that one set of document ratings is needed per test query, and that the relevance judgements are based on the information need of the user that entered the query. The ranking evaluation API provides a convenient way to use this information in a ranking evaluation request to calculate different search evaluation metrics. This gives a first estimation of your overall search quality and give you a measurement to optimize against when fine-tuning various aspect of the query generation in your application. [float] === Ranking evaluation request structure In its most basic form, a request to the `\_rank\_eval` endpoint has two sections: [source,js] ----------------------------- GET /my\_index/\_rank\_eval { "requests": [ ... ], <1> "metric": { <2> "mean\_reciprocal\_rank": { ... } <3> } } ----------------------------- // NOTCONSOLE <1> a set of typical search requests, together with their provided ratings <2> definition of the evaluation metric to calculate <3> a specific metric and its parameters The request section contains several search requests typical to your application, along with the document ratings for each particular search request, e.g. [source,js] ----------------------------- "requests": [ { "id": "amsterdam\_query", <1> "request": { <2> "query": { "match": { "text": "amsterdam" }} }, "ratings": [ <3> { "\_index": "my\_index", "\_id": "doc1", "rating": 0 }, { "\_index": "my\_index", "\_id": "doc2", "rating": 3}, { "\_index": "my\_index", "\_id": "doc3", "rating": 1 } ] }, { "id": "berlin\_query", "request": { "query": { "match": { "text": "berlin" }} }, "ratings": [ { "\_index": "my\_index", "\_id": "doc1", "rating": 1 } ] } ] ----------------------------- // NOTCONSOLE
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/rank-eval.asciidoc
6.2
elasticsearch-6-2
[ -0.03631611540913582, 0.03624378889799118, -0.03735411539673805, 0.05568678304553032, 0.03612878918647766, -0.000032651634683134034, 0.03397156298160553, 0.05092537775635719, 0.011398867703974247, 0.0013347917702049017, -0.04556511342525482, 0.01003349106758833, 0.0709424540400505, 0.008502201177179813, -0.046618442982435226, -0.031064260751008987, 0.0632549375295639, -0.03579007089138031, -0.07399384677410126, -0.022632386535406113, 0.09009148180484772, 0.04686477407813072, 0.06024030223488808, -0.06165265291929245, 0.003225747961550951, -0.07234236598014832, -0.10772501677274704, 0.042891766875982285, 0.011289493180811405, -0.03259098902344704, 0.006840678863227367, 0.04713829234242439, 0.04482647031545639, 0.03782588988542557, -0.09222918748855591, -0.0035473310854285955, -0.04315555468201637, -0.11057279258966446, 0.029815085232257843, 0.013004761189222336, -0.02032473310828209, -0.006591477897018194, -0.052395500242710114, -0.02914903312921524, 0.051626354455947876, -0.055600203573703766, -0.016904182732105255, -0.0992172509431839, -0.05732938274741173, 0.06055835634469986, -0.0778142660856247, 0.035167984664440155, -0.058976322412490845, -0.018877074122428894, -0.0031791897490620613, 0.05717845633625984, -0.07632114738225937, -0.07300344854593277, -0.02384493686258793, -0.06801018118858337, 0.023682616651058197, -0.07543350756168365, -0.010820513591170311, -0.023275325074791908, 0.02653689682483673, -0.07708806544542313, 0.03443756327033043, -0.08365848660469055, 0.00553674902766943, -0.08012967556715012, -0.03861555457115173, -0.006197977811098099, -0.029197856783866882, 0.00906381569802761, 0.038015056401491165, 0.061163149774074554, -0.0463172011077404, 0.019579272717237473, 0.026048367843031883, 0.040200408548116684, 0.028355898335576057, -0.017666218802332878, -0.009677700698375702, 0.05249717831611633, 0.03304426744580269, -0.06714138388633728, 0.07909994572401047, -0.10073043406009674, 0.05107998102903366, 0.03750939294695854, 0.04709642007946968, -0.09542512893676758, -0.0044486564584076405, 0.005792273208498955, 0.0646369680762291, 0.004810725804418325, -0.05079632252454758, -0.0911862701177597, 0.031223824247717857, 0.02436879090964794, 0.03820231184363365, 0.024019582197070122, -0.015073606744408607, -0.06179150938987732, 0.003813333110883832, 0.002468966646119952, 0.015739284455776215, 0.08994214236736298, -0.008336709812283516, -0.02969658002257347, -0.042863618582487106, 0.03957529366016388, -0.00972797255963087, -0.0289619117975235, -0.012261559255421162, 0.09129849076271057, 0.030043143779039383, 0.02849201112985611, 0.08298562467098236, 0.0625896006822586, 0.09118398278951645, -0.013810776174068451, 0.11046537756919861, -0.02698546089231968, 0.0037289701867848635, 0.098975770175457, -0.017176887020468712, 5.47575206984769e-33, 0.04355551302433014, 0.006897157058119774, 0.0010417704470455647, -0.023524951189756393, -0.05557936802506447, 0.05014808475971222, 0.02350825071334839, 0.029400814324617386, -0.06756175309419632, -0.03218365088105202, -0.09142565727233887, 0.17874224483966827, 0.0036777846980839968, 0.04066552221775055, 0.06952694803476334, 0.0573570542037487, -0.017878802493214607, 0.07273861020803452, -0.02874797210097313, -0.015202515758574009, 0.1127861887216568, 0.001208909205161035, 0.04951974377036095, -0.07045436650514603, 0.03098037652671337, -0.03625549003481865, -0.09213084727525711, -0.05328884348273277, -0.09258200228214264, 0.006077728234231472, -0.012003598734736443, -0.048618193715810776, 0.02967650443315506, -0.0007955250330269337, -0.008878105320036411, 0.04961453005671501, -0.05335509777069092, 0.052715085446834564, 0.01820267364382744, -0.008796228095889091, -0.04479222744703293, -0.002634664997458458, -0.011448624543845654, -0.018253065645694733, -0.09439041465520859, -0.006871670018881559, -0.07110574096441269, -0.0011041734833270311, 0.04452299326658249, 0.02518988959491253, -0.039631929248571396, -0.002106189029291272, 0.015711016952991486, 0.0338459387421608, -0.006089772563427687, 0.017228173092007637, 0.05264640226960182, 0.0810079276561737, -0.04772894084453583, -0.03501337766647339, -0.005892970599234104, -0.005987747106701136, 0.0036243260838091373, -0.03844372555613518, -0.038014091551303864, -0.013332960195839405, 0.01314049307256937, -0.03936261311173439, 0.07022455334663391, 0.043569114059209824, 0.008117279037833214, 0.03670112416148186, 0.0475916750729084, -0.02155347168445587, 0.00005286254236125387, -0.04939458519220352, 0.002978839911520481, -0.035439811646938324, 0.07424916326999664, -0.029636841267347336, 0.012463205493986607, -0.03412213549017906, -0.004955641459673643, -0.05519596114754677, -0.07290202379226685, 0.0024256925098598003, -0.013277602382004261, -0.05084912106394768, -0.017028015106916428, -0.07892747968435287, -0.01301709283143282, 0.03922957181930542, -0.09902343153953552, 0.0057379258796572685, -0.02892092987895012, -6.094868046694496e-33, 0.0022757474798709154, -0.01778285577893257, 0.014674370177090168, 0.0974821224808693, -0.0241912379860878, -0.02109786495566368, 0.038087397813797, -0.03151886537671089, -0.041337378323078156, -0.008283392526209354, -0.007971853949129581, -0.007451541721820831, -0.004947705660015345, -0.008555158041417599, 0.021861400455236435, 0.05004206672310829, -0.04718831554055214, -0.111420638859272, 0.01819777302443981, 0.019518477842211723, 0.02279621548950672, 0.10858224332332611, -0.045533861964941025, 0.04525134339928627, 0.013245812617242336, -0.04475918412208557, 0.04714275524020195, -0.04253935068845749, -0.060405291616916656, -0.07778368145227432, 0.06323522329330444, -0.03072773478925228, -0.023672450333833694, 0.044768817722797394, -0.04760214686393738, -0.034330423921346664, 0.10125244408845901, -0.06758178770542145, -0.04351196065545082, 0.0851372554898262, 0.005555318668484688, 0.046661920845508575, 0.014258495531976223, -0.03235587477684021, 0.06296670436859131, 0.013926317915320396, -0.06738866865634918, 0.05719219520688057, 0.019510814920067787, -0.058090779930353165, 0.07079603523015976, 0.04005351662635803, -0.0689074695110321, 0.06808589398860931, -0.07471951842308044, -0.020938174799084663, -0.08899868279695511, 0.008799825794994831, -0.08432748913764954, 0.07814733684062958, 0.05039332062005997, 0.07100652158260345, -0.009488564915955067, 0.019288647919893265, -0.02766089141368866, -0.021585755050182343, -0.012728502973914146, -0.0734935998916626, -0.09239280968904495, 0.0027536707930266857, -0.0161907896399498, -0.09392789751291275, 0.04221203923225403, -0.050337180495262146, -0.0009184283553622663, 0.0696919858455658, 0.032977454364299774, -0.007594782393425703, -0.0006852196529507637, -0.06604403257369995, -0.0372905433177948, 0.05678986385464668, 0.053233396261930466, 0.02791578322649002, -0.035548388957977295, 0.051191363483667374, 0.034850358963012695, 0.08823062479496002, -0.023475002497434616, 0.01288032066076994, -0.04378259554505348, -0.10007224231958389, -0.09401851892471313, -0.007987657561898232, 0.001021794741973281, -5.9211902936340266e-8, -0.061355363577604294, 0.009964745491743088, -0.05256515368819237, 0.1059943437576294, -0.032972000539302826, 0.07325301319360733, 0.015582595951855183, 0.08031508326530457, -0.010068410076200962, -0.0716090276837349, 0.05680825561285019, -0.0152110131457448, -0.11921926587820053, 0.05418536067008972, 0.07048681378364563, 0.08865176141262054, 0.0019293058430776, 0.09563403576612473, -0.027372226119041443, -0.06784722954034805, 0.0019173531327396631, 0.05270501226186752, 0.041087161749601364, -0.07332707941532135, 0.03255366161465645, 0.02145782671868801, -0.023406904190778732, 0.07455446571111679, 0.019099263474345207, 0.0005574847455136478, 0.03208373486995697, -0.025548061355948448, 0.06498824059963226, -0.02211562730371952, 0.04739932343363762, 0.04442308843135834, -0.034958112984895706, -0.03196180984377861, -0.05549487844109535, 0.11180014163255692, 0.03496462479233742, 0.05735917016863823, 0.018059449270367622, 0.03232477232813835, 0.036593247205019, -0.00351216783747077, -0.024211080744862556, -0.00039308881969191134, 0.06299582123756409, 0.004908716306090355, 0.08050164580345154, -0.14606651663780212, -0.08001480251550674, 0.0457100011408329, 0.006152481306344271, -0.03236079588532448, -0.029294321313500404, -0.018982073292136192, 0.04801752045750618, 0.045784156769514084, 0.09938903898000717, -0.041415464133024216, -0.02349279075860977, 0.028898505493998528 ]
0.104111
"doc1", "rating": 0 }, { "\_index": "my\_index", "\_id": "doc2", "rating": 3}, { "\_index": "my\_index", "\_id": "doc3", "rating": 1 } ] }, { "id": "berlin\_query", "request": { "query": { "match": { "text": "berlin" }} }, "ratings": [ { "\_index": "my\_index", "\_id": "doc1", "rating": 1 } ] } ] ----------------------------- // NOTCONSOLE <1> the search requests id, used to group result details later <2> the query that is being evaluated <3> a list of document ratings, each entry containing the documents `\_index` and `\_id` together with the rating of the documents relevance with regards to this search request A document `rating` can be any integer value that expresses the relevance of the document on a user defined scale. For some of the metrics, just giving a binary rating (e.g. `0` for irrelevant and `1` for relevant) will be sufficient, other metrics can use a more fine grained scale. NOTE: To use the ranking evaluation API with indices that use multiple types, you should add a filter on the `\_type` field to the query in the request. Otherwise, if your index uses multiple types with the same id, the provided document rating might be ambiguous. [float] === Template based ranking evaluation As an alternative to having to provide a single query per test request, it is possible to specify query templates in the evaluation request and later refer to them. Queries with similar structure that only differ in their parameters don't have to be repeated all the time in the `requests` section this way. In typical search systems where user inputs usually get filled into a small set of query templates, this helps making the evaluation request more succinct. [source,js] -------------------------------- GET /my\_index/\_rank\_eval { [...] "templates": [ { "id": "match\_one\_field\_query", <1> "template": { <2> "inline": { "query": { "match": { "{{field}}": { "query": "{{query\_string}}" }} } } } } ], "requests": [ { "id": "amsterdam\_query", "ratings": [ ... ], "template\_id": "match\_one\_field\_query", <3> "params": { <4> "query\_string": "amsterdam", "field": "text" } }, [...] } -------------------------------- // NOTCONSOLE <1> the template id <2> the template definition to use <3> a reference to a previously defined temlate <4> the parameters to use to fill the template [float] === Available evaluation metrics The `metric` section determines which of the available evaluation metrics is going to be used. Currently, the following metrics are supported: [float] [[k-precision]] ==== Precision at K (P@k) This metric measures the number of relevant results in the top k search results. Its a form of the well known https://en.wikipedia.org/wiki/Information\_retrieval#Precision[Precision] metric that only looks at the top k documents. It is the fraction of relevant documents in those first k search. A precision at 10 (P@10) value of 0.6 then means six out of the 10 top hits are relevant with respect to the users information need. P@k works well as a simple evaluation metric that has the benefit of being easy to understand and explain. Documents in the collection need to be rated either as relevant or irrelevant with respect to the current query. P@k does not take into account where in the top k results the relevant documents occur, so a ranking of ten results that contains one relevant result in position 10 is equally good as a ranking of ten results that contains one relevant result in position 1. [source,js] -------------------------------- GET /twitter/\_rank\_eval { "requests": [ { "id": "JFK query", "request": { "query": { "match\_all": {}}}, "ratings": [] }], "metric": { "precision": { "k" : 20, "relevant\_rating\_threshold": 1, "ignore\_unlabeled": false } } } -------------------------------- // CONSOLE // TEST[setup:twitter] The `precision` metric takes the following optional parameters [cols="<,<",options="header",] |======================================================================= |Parameter |Description |`k` |sets
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/rank-eval.asciidoc
6.2
elasticsearch-6-2
[ -0.03550811856985092, 0.14460095763206482, -0.020441392436623573, 0.09510235488414764, 0.008237685076892376, 0.09213332831859589, 0.040223944932222366, 0.05315250903367996, 0.04292887821793556, -0.014483419246971607, -0.02234615758061409, -0.060647424310445786, 0.0703500434756279, 0.004081424791365862, -0.015183569863438606, 0.050625670701265335, -0.06168428063392639, 0.006123451981693506, -0.07017962634563446, -0.03932700678706169, 0.04654121398925781, 0.09929509460926056, 0.04771048203110695, -0.08480113744735718, -0.027659431099891663, 0.04805201664566994, -0.022945694625377655, -0.020517155528068542, -0.02228507027029991, 0.06455545127391815, -0.014076441526412964, -0.00779585400596261, -0.009914982132613659, 0.04755735397338867, -0.014855778776109219, -0.03421587869524956, 0.005625630728900433, -0.12098133563995361, 0.02411705069243908, 0.01507432572543621, 0.05450635775923729, 0.05187905952334404, -0.04274773225188255, -0.053504083305597305, 0.06370572745800018, -0.030734656378626823, -0.025622904300689697, -0.013960189186036587, -0.02772611565887928, 0.044932905584573746, -0.09424348920583725, -0.02303851768374443, -0.05218871310353279, 0.02766735851764679, 0.0721062496304512, 0.028137944638729095, -0.11010171473026276, -0.03360111266374588, -0.015426029451191425, -0.11406417191028595, 0.09297600388526917, -0.12229988723993301, 0.014378904365003109, -0.026996765285730362, -0.04472646117210388, -0.10243033617734909, 0.03493920713663101, 0.003702363232150674, 0.045170724391937256, 0.008576939813792706, 0.008856823667883873, 0.0538627989590168, 0.015572297386825085, -0.044160377234220505, 0.011351559311151505, 0.046166203916072845, -0.056866541504859924, -0.0784393846988678, 0.0034756502136588097, -0.0064932857640087605, -0.052145905792713165, -0.04508738964796066, -0.018934447318315506, -0.0014656189596280456, -0.024151571094989777, -0.11970757693052292, 0.03229748085141182, -0.10264996439218521, 0.0025373350363224745, -0.03478153795003891, -0.06312771141529083, -0.02888011559844017, -0.027919696643948555, -0.00218552746810019, 0.0858507826924324, 0.04678893834352493, 0.03154521808028221, -0.01800731010735035, 0.0938337966799736, 0.030790451914072037, 0.04669618979096413, 0.012600830756127834, -0.023926781490445137, -0.09440568834543228, -0.013129822909832, 0.030560731887817383, -0.026612581685185432, -0.00015938570140860975, -0.10036551207304001, -0.02659694291651249, -0.03695898503065109, 0.03028980642557144, -0.017610833048820496, 0.013002162799239159, -0.037484556436538696, 0.032607462257146835, 0.10920637100934982, 0.026569165289402008, 0.0491851307451725, 0.0951169952750206, 0.10154718905687332, 0.010808393359184265, -0.008148133754730225, -0.040790535509586334, -0.00048058267566375434, 0.018819421529769897, 0.02079015225172043, 1.0169917945833642e-33, 0.08001068979501724, -0.09357728809118271, -0.06690066307783127, -0.0375247560441494, -0.015764249488711357, 0.030373111367225647, 0.04133038595318794, 0.07352030277252197, -0.05616496130824089, -0.022722147405147552, -0.09808959066867828, 0.09213121980428696, -0.0012917184503749013, -0.04025501385331154, -0.0016213672934100032, -0.010956957004964352, -0.014267529360949993, 0.06385292857885361, -0.002419952768832445, -0.028537224978208542, 0.05077088251709938, -0.0021796715445816517, 0.012200516648590565, 0.01597817800939083, 0.03672055900096893, -0.040139924734830856, -0.0028702684212476015, -0.11047743260860443, -0.09103689342737198, -0.031184731051325798, -0.018551407381892204, 0.01857147179543972, -0.03174930065870285, -0.06687017530202866, -0.005025407765060663, 0.08160798996686935, -0.011331604793667793, 0.01886710524559021, -0.029765203595161438, -0.0011156187392771244, -0.013232625089585781, 0.014142544008791447, -0.0051408023573458195, -0.08778601139783859, -0.03949994221329689, 0.017058895900845528, -0.0747000053524971, -0.039813920855522156, -0.010355645790696144, 0.03783697634935379, -0.051920633763074875, -0.01418741699308157, -0.027882691472768784, 0.018451862037181854, 0.03901921585202217, -0.024294177070260048, -0.00791443046182394, 0.1222928985953331, -0.028116436675190926, -0.015260828658938408, -0.0651053935289383, 0.03262580931186676, 0.03389201685786247, 0.03588419035077095, 0.021911872550845146, 0.01475998293608427, 0.03994281589984894, 0.1362159550189972, 0.02198117785155773, -0.0034688988234847784, 0.00852458830922842, 0.04601435363292694, 0.037851978093385696, -0.05338354408740997, 0.021926693618297577, -0.04113641381263733, -0.0032932499889284372, -0.01822848990559578, -0.05529534071683884, -0.02091919258236885, -0.011562397703528404, -0.04631979763507843, 0.010015171021223068, -0.017423029989004135, -0.03577421233057976, 0.14275765419006348, -0.011326120235025883, -0.003772478085011244, -0.01585846021771431, -0.10358228534460068, -0.022394757717847824, 0.06386054307222366, -0.06529101729393005, -0.07543113827705383, -0.00034597754711285233, -2.100206900130225e-33, 0.05001114681363106, -0.0925230160355568, 0.039665620774030685, -0.024550698697566986, 0.023511512205004692, -0.043242476880550385, 0.026980172842741013, -0.049780379980802536, -0.01958310976624489, 0.024838270619511604, 0.019238829612731934, -0.09203865379095078, 0.04010644927620888, -0.05287833884358406, -0.017872745171189308, 0.05585871636867523, -0.03919072449207306, -0.014229760505259037, 0.020678583532571793, 0.022159239277243614, 0.013856926001608372, 0.02869715355336666, 0.020695168524980545, 0.10422785580158234, -0.05349123477935791, -0.07405144721269608, 0.006246622651815414, -0.07264389097690582, -0.04396212100982666, 0.047690507024526596, 0.07411051541566849, -0.03760660067200661, -0.014732630923390388, 0.07291129231452942, 0.027967769652605057, -0.020277978852391243, 0.03479200601577759, -0.0008310273406095803, -0.05921745300292969, 0.09426945447921753, 0.006261037662625313, 0.07935871928930283, -0.02572019025683403, 0.053047824651002884, 0.016702502965927124, -0.04248057305812836, 0.016052622348070145, 0.05896889045834541, -0.06421791017055511, -0.0408533550798893, 0.023368872702121735, -0.010064944624900818, -0.012592127546668053, 0.04961728677153587, -0.040385179221630096, -0.056973569095134735, -0.0496407188475132, -0.08442384004592896, -0.0570945218205452, 0.0549868606030941, 0.025238486006855965, 0.05353735387325287, -0.03630632534623146, 0.019322270527482033, 0.07376497238874435, -0.06269150972366333, -0.05627645179629326, -0.0576726496219635, -0.018573321402072906, 0.025410877540707588, 0.027842920273542404, -0.055586718022823334, 0.07748597860336304, 0.023484863340854645, 0.08215931057929993, 0.02513224631547928, 0.0595955066382885, 0.008175953291356564, 0.0024338720832020044, 0.036507926881313324, 0.00841014739125967, 0.04648011177778244, 0.046636831015348434, 0.06453201919794083, -0.07272066175937653, 0.0035670131910592318, 0.01270650327205658, 0.10547676682472229, -0.0749029666185379, 0.001844348618760705, 0.0015953247202560306, -0.05568474158644676, -0.0016932578291743994, -0.08476211130619049, 0.041186269372701645, -3.816557025970724e-8, -0.1006121039390564, 0.038246627897024155, -0.06852235645055771, 0.06785397231578827, -0.012700038962066174, 0.039319563657045364, 0.02824670821428299, 0.09063206613063812, -0.06479044258594513, -0.06356268376111984, 0.08598650991916656, -0.01379526685923338, -0.0875372588634491, -0.028637241572141647, -0.020993703976273537, 0.0035245472099632025, -0.036491308361291885, 0.029089955613017082, 0.010608085431158543, 0.030690524727106094, 0.06143148988485336, 0.007838788442313671, 0.03078106977045536, -0.01223980076611042, 0.08807019889354706, 0.08653534948825836, 0.023285025730729103, 0.011015701107680798, 0.010178133845329285, 0.0372433103621006, -0.06427118927240372, -0.019878312945365906, -0.013392182998359203, 0.03346617892384529, 0.04889702796936035, -0.01832089200615883, 0.04167322441935539, 0.036420468240976334, -0.09411447495222092, 0.024882515892386436, 0.05017179250717163, 0.036928605288267136, -0.019253360107541084, 0.05768021568655968, 0.04169192537665367, -0.0825764611363411, -0.0302963238209486, 0.016594190150499344, 0.08975917100906372, -0.02582741156220436, 0.001686295261606574, -0.12255174666643143, 0.026395317167043686, 0.0037586172111332417, -0.09448780864477158, 0.017602667212486267, 0.03527893126010895, 0.05084607005119324, 0.0026721064932644367, 0.004583402536809444, 0.08762355893850327, -0.01955709606409073, -0.027452655136585236, 0.07525087893009186 ]
0.076196
/twitter/\_rank\_eval { "requests": [ { "id": "JFK query", "request": { "query": { "match\_all": {}}}, "ratings": [] }], "metric": { "precision": { "k" : 20, "relevant\_rating\_threshold": 1, "ignore\_unlabeled": false } } } -------------------------------- // CONSOLE // TEST[setup:twitter] The `precision` metric takes the following optional parameters [cols="<,<",options="header",] |======================================================================= |Parameter |Description |`k` |sets the maximum number of documents retrieved per query. This value will act in place of the usual `size` parameter in the query. Defaults to 10. |`relevant\_rating\_threshold` |sets the rating threshold above which documents are considered to be "relevant". Defaults to `1`. |`ignore\_unlabeled` |controls how unlabeled documents in the search results are counted. If set to 'true', unlabeled documents are ignored and neither count as relevant or irrelevant. Set to 'false' (the default), they are treated as irrelevant. |======================================================================= [float] ==== Mean reciprocal rank For every query in the test suite, this metric calculates the reciprocal of the rank of the first relevant document. For example finding the first relevant result in position 3 means the reciprocal rank is 1/3. The reciprocal rank for each query is averaged across all queries in the test suite to give the https://en.wikipedia.org/wiki/Mean\_reciprocal\_rank[mean reciprocal rank]. [source,js] -------------------------------- GET /twitter/\_rank\_eval { "requests": [ { "id": "JFK query", "request": { "query": { "match\_all": {}}}, "ratings": [] }], "metric": { "mean\_reciprocal\_rank": { "k" : 20, "relevant\_rating\_threshold" : 1 } } } -------------------------------- // CONSOLE // TEST[setup:twitter] The `mean\_reciprocal\_rank` metric takes the following optional parameters [cols="<,<",options="header",] |======================================================================= |Parameter |Description |`k` |sets the maximum number of documents retrieved per query. This value will act in place of the usual `size` parameter in the query. Defaults to 10. |`relevant\_rating\_threshold` |Sets the rating threshold above which documents are considered to be "relevant". Defaults to `1`. |======================================================================= [float] ==== Discounted cumulative gain (DCG) In contrast to the two metrics above, https://en.wikipedia.org/wiki/Discounted\_cumulative\_gain[discounted cumulative gain] takes both, the rank and the rating of the search results, into account. The assumption is that highly relevant documents are more useful for the user when appearing at the top of the result list. Therefore, the DCG formula reduces the contribution that high ratings for documents on lower search ranks have on the overall DCG metric. [source,js] -------------------------------- GET /twitter/\_rank\_eval { "requests": [ { "id": "JFK query", "request": { "query": { "match\_all": {}}}, "ratings": [] }], "metric": { "dcg": { "k" : 20, "normalize": false } } } -------------------------------- // CONSOLE // TEST[setup:twitter] The `dcg` metric takes the following optional parameters: [cols="<,<",options="header",] |======================================================================= |Parameter |Description |`k` |sets the maximum number of documents retrieved per query. This value will act in place of the usual `size` parameter in the query. Defaults to 10. |`normalize` | If set to `true`, this metric will calculate the https://en.wikipedia.org/wiki/Discounted\_cumulative\_gain#Normalized\_DCG[Normalized DCG]. |======================================================================= [float] === Response format The response of the `\_rank\_eval` endpoint contains the overall calculated result for the defined quality metric, a `details` section with a breakdown of results for each query in the test suite and an optional `failures` section that shows potential errors of individual queries. The response has the following format: [source,js] -------------------------------- { "rank\_eval": { "quality\_level": 0.4, <1> "details": { "my\_query\_id1": { <2> "quality\_level": 0.6, <3> "unknown\_docs": [ <4> { "\_index": "my\_index", "\_id": "1960795" }, [...] ], "hits": [ { "hit": { <5> "\_index": "my\_index", "\_type": "page", "\_id": "1528558", "\_score": 7.0556192 }, "rating": 1 }, [...] ], "metric\_details": { <6> "relevant\_docs\_retrieved": 6, "docs\_retrieved": 10 } }, "my\_query\_id2" : { [...] } }, "failures": { [...] } } } -------------------------------- // NOTCONSOLE <1> the overall evaluation quality calculated by the defined metric <2> the `details` section contains one entry for every query in the original `requests` section, keyed by the search
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/rank-eval.asciidoc
6.2
elasticsearch-6-2
[ 0.002754698507487774, 0.03012268804013729, -0.05794487148523331, 0.0534457266330719, -0.05104446783661842, 0.013241218402981758, 0.02544434554874897, 0.039356838911771774, 0.006075053010135889, -0.0020819439087063074, -0.03587694093585014, -0.0684080421924591, 0.03791826218366623, 0.004089742433279753, -0.021530477330088615, 0.008989253081381321, 0.02502327971160412, -0.04367081820964813, -0.07717593759298325, -0.14317841827869415, -0.019989054650068283, 0.03400783985853195, 0.04118936508893967, 0.0066486140713095665, 0.028543658554553986, -0.026679079979658127, -0.08724639564752579, 0.0579373873770237, 0.022805405780673027, -0.004345428664237261, -0.039839498698711395, 0.008286941796541214, -0.001873225555755198, 0.04673504829406738, -0.006307140924036503, 0.005457981023937464, -0.1213991567492485, -0.053761448711156845, 0.05617811158299446, 0.01229330524802208, 0.0452561229467392, -0.054290950298309326, -0.035443056374788284, -0.015992021188139915, -0.029595080763101578, 0.01066398061811924, -0.05464756861329079, 0.0015986462822183967, -0.07301364839076996, 0.04718543961644173, -0.09319620579481125, 0.040897857397794724, 0.011943104676902294, 0.012953606434166431, 0.03019041381776333, 0.01921996846795082, -0.13430868089199066, -0.029382795095443726, 0.06369390338659286, -0.05439212918281555, -0.022932741791009903, -0.06874479353427887, 0.03565141186118126, -0.010319232940673828, 0.018555747345089912, -0.027497844770550728, -0.03387129679322243, 0.038907863199710846, -0.010420044884085655, 0.08727999031543732, 0.03982781991362572, 0.029749494045972824, -0.0175369530916214, 0.023295382037758827, 0.028161201626062393, 0.04846564680337906, -0.020926788449287415, -0.03745714947581291, 0.011501738801598549, 0.07486649602651596, -0.045035261660814285, -0.04763391241431236, -0.039671409875154495, 0.036644380539655685, 0.0015347966691479087, -0.04243282973766327, 0.029971018433570862, -0.06369400024414062, 0.031043756753206253, 0.02032412402331829, 0.005336695816367865, 0.006882963702082634, -0.038309019058942795, 0.03728320077061653, -0.02013513632118702, 0.054509237408638, -0.10125342011451721, -0.06633729487657547, 0.0006037132698111236, 0.06838765740394592, -0.056137584149837494, -0.04271283000707626, 0.0006797932437621057, -0.029236244037747383, -0.007466099690645933, -0.06665906310081482, 0.025328829884529114, 0.059522051364183426, 0.06313057243824005, 0.012156502343714237, 0.026730578392744064, 0.06247595325112343, -0.03200111910700798, -0.01720665767788887, 0.003457210725173354, 0.010884547606110573, 0.10810127854347229, -0.0032642807345837355, 0.08354831486940384, 0.004087424837052822, 0.03119136579334736, 0.010657679289579391, -0.05227910354733467, -0.062362078577280045, 0.02698686718940735, 0.12863630056381226, 0.08051174879074097, 5.1055205731646104e-33, 0.08578310906887054, -0.034874070435762405, 0.03682958334684372, -0.08116339147090912, -0.022754309698939323, 0.022665176540613174, -0.019267847761511803, -0.0011103645665571094, -0.09301065653562546, 0.0031283539719879627, -0.05962426960468292, 0.05465064197778702, -0.023158494383096695, -0.0519295409321785, 0.0107793640345335, -0.016785167157649994, 0.030637945979833603, 0.09498926997184753, -0.05836104601621628, -0.043720971792936325, 0.06913820654153824, -0.003950972575694323, -0.010414388962090015, -0.012314810417592525, 0.02116973139345646, 0.0047965580597519875, -0.024793611839413643, -0.030525801703333855, -0.10274163633584976, 0.0026498627848923206, -0.064768485724926, 0.04633459076285362, -0.01840139552950859, 0.04138292744755745, 0.09167875349521637, -0.04285998269915581, 0.009139923378825188, 0.09412907063961029, -0.003924075048416853, -0.01937323436141014, -0.04068303108215332, 0.02470492571592331, -0.05396774038672447, -0.05300622433423996, -0.05817583203315735, -0.0010759268188849092, -0.028047241270542145, -0.009835758246481419, 0.006898044608533382, -0.0329936258494854, -0.06899435073137283, 0.02573292888700962, 0.010788788087666035, 0.014280443079769611, -0.004334207158535719, -0.07781817764043808, 0.05003120005130768, 0.09041931480169296, 0.0648709312081337, -0.008539849892258644, -0.048894885927438736, 0.03096403367817402, 0.04290875047445297, -0.03782201185822487, 0.07987614721059799, -0.011896931566298008, 0.004726285580545664, 0.030437016859650612, 0.03405800461769104, 0.04102837294340134, 0.054256848990917206, 0.05049626901745796, 0.013178909197449684, -0.030112450942397118, 0.0019767973572015762, -0.07020197808742523, 0.05162499099969864, -0.004212845582515001, 0.05809704586863518, 0.002233726205304265, 0.051698822528123856, -0.05036034807562828, 0.016265403479337692, -0.05245141312479973, -0.008767150342464447, -0.03094054013490677, -0.010331285186111927, -0.012874232605099678, -0.06505380570888519, -0.027623610571026802, -0.052355095744132996, 0.0506393238902092, -0.05249391496181488, -0.04748881980776787, -0.09266908466815948, -5.8425077766721825e-33, 0.016403863206505775, -0.01388293132185936, 0.07730302959680557, 0.07703914493322372, 0.0186143945902586, -0.02001822181046009, 0.009244325570762157, -0.0002457989612594247, -0.010434598661959171, 0.06910981237888336, 0.06741251796483994, -0.04989350214600563, -0.08084742724895477, -0.0649169385433197, 0.0697951465845108, 0.008379478007555008, -0.1069229394197464, -0.052138976752758026, -0.037245482206344604, -0.0265753585845232, 0.002691681496798992, 0.07835303246974945, -0.09397918730974197, 0.13806293904781342, -0.010353712365031242, -0.040879566222429276, 0.05920839309692383, 0.01754271239042282, -0.029773369431495667, -0.04418496787548065, 0.011797103099524975, -0.04757016897201538, -0.05255502834916115, 0.06822448968887329, -0.023981407284736633, -0.05535442382097244, 0.0593625083565712, -0.005472148768603802, 0.026885410770773888, 0.1332869529724121, 0.05883673578500748, -0.019576871767640114, -0.10764732211828232, 0.028536293655633926, -0.00667355814948678, -0.030267728492617607, 0.03424561023712158, 0.009306937456130981, -0.047188665717840195, -0.08756961673498154, 0.05920550227165222, 0.02437259629368782, -0.009759207256138325, 0.0982658639550209, -0.051675599068403244, -0.08261344581842422, -0.09490668773651123, -0.025810929015278816, -0.01590399444103241, 0.006395237985998392, 0.014567852020263672, 0.004019879270344973, 0.0009293867042288184, 0.00825527124106884, 0.08607973903417587, -0.06528285890817642, 0.006262604612857103, -0.021385719999670982, -0.08345688879489899, 0.01576930843293667, -0.006372873671352863, -0.041924670338630676, 0.0759722962975502, -0.03162132576107979, 0.0563119538128376, -0.0582120455801487, 0.0027279192581772804, 0.06233299523591995, 0.07666773349046707, 0.011033107526600361, -0.015725543722510338, 0.07747594267129898, 0.04972084239125252, 0.04712846130132675, -0.008848798461258411, 0.0054740337654948235, 0.04714319854974747, 0.14227017760276794, -0.0026476618368178606, 0.05851447954773903, 0.014007053337991238, -0.0822576954960823, -0.01589045114815235, 0.01850365474820137, -0.07881126552820206, -6.039090294507332e-8, -0.1182393804192543, 0.004878065548837185, -0.128850519657135, 0.10021024942398071, 0.012330462224781513, 0.06295176595449448, 0.06444960832595825, 0.0648055225610733, 0.007656398694962263, 0.02971775270998478, 0.07788533717393875, 0.03860991820693016, -0.050419293344020844, -0.01611117273569107, -0.02307855896651745, -0.11173693835735321, -0.11934945732355118, 0.06335457414388657, -0.019058430567383766, 0.025419967249035835, -0.030591167509555817, 0.059644073247909546, -0.02839680016040802, -0.0577431321144104, 0.07903328537940979, 0.015931859612464905, -0.050122521817684174, 0.0793505609035492, 0.021908922120928764, 0.051395807415246964, -0.01934770867228508, -0.06693478673696518, 0.03691723942756653, -0.028942160308361053, -0.004770544823259115, 0.055453184992074966, -0.061473362147808075, -0.030112268403172493, -0.06353630870580673, -0.018019214272499084, -0.021357208490371704, 0.0168245080858469, -0.0808662548661232, 0.03120247647166252, -0.02560332976281643, -0.0235039871186018, -0.018054861575365067, 0.06417988240718842, 0.04674863442778587, -0.025474976748228073, -0.015001700259745121, -0.07115750759840012, -0.024179775267839432, 0.0026670878287404776, -0.03554190695285797, -0.07214835286140442, 0.02957795187830925, 0.01585952192544937, -0.015081058256328106, -0.034357208758592606, 0.14312662184238434, -0.07622883468866348, -0.062470681965351105, 0.05591268092393875 ]
-0.029618
"relevant\_docs\_retrieved": 6, "docs\_retrieved": 10 } }, "my\_query\_id2" : { [...] } }, "failures": { [...] } } } -------------------------------- // NOTCONSOLE <1> the overall evaluation quality calculated by the defined metric <2> the `details` section contains one entry for every query in the original `requests` section, keyed by the search request id <3> the `quality\_level` in the `details` section shows the contribution of this query to the global quality score <4> the `unknown\_docs` section contains an `\_index` and `\_id` entry for each document in the search result for this query that didn't have a ratings value. This can be used to ask the user to supply ratings for these documents <5> the `hits` section shows a grouping of the search results with their supplied rating <6> the `metric\_details` give additional information about the calculated quality metric (e.g. how many of the retrieved documents where relevant). The content varies for each metric but allows for better interpretation of the results
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/rank-eval.asciidoc
6.2
elasticsearch-6-2
[ -0.08199232816696167, 0.0765090137720108, -0.05111721530556679, 0.11049934476613998, 0.02418408915400505, 0.008850431069731712, 0.03760984167456627, 0.06229439750313759, 0.03343527391552925, -0.020717894658446312, -0.01505668368190527, -0.06435512751340866, 0.14190274477005005, -0.04146944358944893, -0.08100122958421707, 0.04022455960512161, -0.0046638865023851395, -0.03246721997857094, -0.07994069159030914, -0.00925087183713913, 0.023864053189754486, 0.14296332001686096, 0.06596498936414719, -0.03718767315149307, -0.018522970378398895, -0.01939133182168007, -0.11368517577648163, 0.0165728610008955, 0.007944519631564617, 0.03423907235264778, -0.00294702872633934, 0.08700722455978394, -0.007335568778216839, 0.05081811919808388, 0.013832181692123413, 0.0016398761654272676, 0.022021746262907982, -0.10762959718704224, 0.025688134133815765, -0.008434979245066643, 0.03955768793821335, 0.02409963682293892, -0.01178592350333929, 0.03127181902527809, -0.015531977638602257, -0.008509686216711998, -0.058309730142354965, -0.0651310384273529, -0.057813409715890884, 0.04591575264930725, -0.143344447016716, 0.040164824575185776, -0.033267565071582794, -0.027069097384810448, 0.059360649436712265, 0.02878250926733017, -0.10096177458763123, 0.007628005929291248, -0.06747302412986755, -0.06710444390773773, 0.03982271999120712, -0.042538322508335114, -0.018751883879303932, -0.01597287319600582, 0.012210587970912457, -0.06798411160707474, -0.020367683842778206, -0.023748211562633514, 0.018916791304945946, 0.038947947323322296, -0.04897291958332062, 0.029946181923151016, -0.02013181708753109, 0.018918609246611595, 0.024961356073617935, 0.07007494568824768, -0.0738513395190239, -0.06825338304042816, -0.012201735749840736, -0.017659468576312065, -0.047742992639541626, -0.023684099316596985, 0.019596591591835022, -0.020687216892838478, 0.01797904446721077, -0.09049217402935028, 0.13509607315063477, -0.07850020378828049, 0.0582149438560009, 0.03423594683408737, -0.00610567070543766, -0.05604768916964531, -0.021242544054985046, 0.023283183574676514, 0.0744028389453888, 0.05814827233552933, 0.027093391865491867, -0.048167336732149124, 0.06961019337177277, 0.02889014221727848, 0.03274892643094063, 0.009506778791546822, -0.005860048811882734, -0.12282303720712662, -0.025533203035593033, 0.02044159732758999, -0.028547458350658417, 0.06978464126586914, -0.028059115633368492, -0.037665367126464844, -0.04484989121556282, 0.02518736757338047, -0.013461288996040821, -0.08327747881412506, 0.02425474114716053, 0.04532579705119133, 0.06457793712615967, 0.020555876195430756, 0.018365196883678436, 0.059845421463251114, 0.045416612178087234, -0.0018223596271127462, 0.06186935678124428, -0.06481972336769104, -0.049960870295763016, 0.031619053333997726, -0.014498387463390827, -2.1303866155616334e-33, 0.06401602923870087, -0.06646163016557693, -0.04042302444577217, -0.008861508220434189, -0.056381985545158386, 0.04725843667984009, -0.004230416379868984, 0.04723884165287018, -0.022186949849128723, -0.04031391069293022, -0.09578502178192139, 0.11806691437959671, -0.02418658509850502, 0.026059221476316452, 0.048650722950696945, 0.03837795928120613, 0.0332229919731617, 0.08034798502922058, 0.01784263737499714, -0.015807826071977615, 0.06688547879457474, -0.008381889201700687, 0.006456193048506975, -0.02177952416241169, 0.043365806341171265, 0.04500493407249451, 0.0081563675776124, -0.03645392507314682, -0.078191377222538, -0.021761463955044746, -0.023573849350214005, -0.007921376265585423, -0.014220403507351875, -0.08733464777469635, 0.019890308380126953, 0.06099154055118561, -0.03933189809322357, 0.06865500658750534, -0.026309406384825706, -0.01960121840238571, -0.030517669394612312, 0.017738111317157745, -0.007549833506345749, -0.027262207120656967, -0.05139480531215668, -0.020835423842072487, -0.06699062883853912, -0.045974019914865494, -0.0005443773115985096, 0.004311061929911375, -0.036325376480817795, -0.011921385303139687, 0.04263918474316597, 0.07259637862443924, 0.002054912969470024, -0.03606664389371872, 0.0022500574123114347, 0.05725811794400215, -0.0416494645178318, -0.02102336473762989, 0.005206029862165451, 0.0065598152577877045, 0.007429862394928932, -0.06494282931089401, -0.020737724378705025, 0.03164104372262955, 0.05835710093379021, 0.06290299445390701, 0.02055191621184349, 0.0219461377710104, -0.011640327051281929, 0.02521754428744316, -0.01763308048248291, -0.06991665065288544, 0.02439689263701439, -0.07213417440652847, 0.00968730915337801, -0.03512305021286011, 0.01513626053929329, -0.04713840410113335, -0.011251541785895824, -0.04327511042356491, 0.014300215058028698, -0.07595847547054291, -0.02461288310587406, 0.06107175722718239, 0.014431416057050228, -0.010080893523991108, -0.03152155503630638, -0.056656766682863235, -0.004042546730488539, 0.012102453038096428, -0.11707482486963272, -0.08027759194374084, 0.004189947620034218, -1.2442498419213485e-33, -0.018960241228342056, -0.0668535903096199, -0.012904876843094826, 0.04284507781267166, -0.027710214257240295, -0.0417112372815609, 0.0261846836656332, -0.04931698739528656, 0.051215071231126785, 0.0022003836929798126, 0.018795093521475792, -0.07904915511608124, 0.01012090127915144, -0.056934088468551636, -0.03798890486359596, 0.05908256769180298, -0.09381534904241562, -0.04096853733062744, -0.011027461849153042, 0.03482994809746742, 0.03951463848352432, 0.11607004702091217, -0.02084437571465969, 0.10308897495269775, -0.04947179928421974, 0.012005522847175598, -0.003911110572516918, -0.0689278170466423, -0.03153994679450989, -0.024630488827824593, 0.098812535405159, -0.05162939801812172, -0.07320687919855118, 0.08304493129253387, 0.03009314462542534, -0.07209506630897522, 0.02794843353331089, -0.03646954521536827, -0.05489411950111389, 0.11035776138305664, 0.05814749374985695, 0.09706605970859528, -0.027359338477253914, 0.06071901693940163, -0.0319155752658844, -0.031639233231544495, 0.015023541636765003, 0.017010129988193512, -0.026883017271757126, -0.051903512328863144, 0.02834210731089115, -0.04906754568219185, -0.0003797397657763213, 0.07997828722000122, -0.05623512715101242, -0.0011373034212738276, -0.06598718464374542, -0.004676054231822491, -0.01692388579249382, 0.08868339657783508, 0.04302780702710152, 0.10282347351312637, -0.1276053637266159, 0.0072310855612158775, 0.004478278569877148, -0.027434980496764183, -0.030539806932210922, -0.00548726599663496, -0.03639228269457817, 0.04745371267199516, 0.02500326931476593, -0.043006494641304016, 0.07294107228517532, -0.06269405037164688, 0.041468992829322815, 0.0640348419547081, 0.004842481110244989, 0.007699567824602127, -0.015435193665325642, -0.011550772935152054, 0.01676717773079872, 0.07388529181480408, 0.044624801725149155, 0.00022678819368593395, -0.02583661675453186, -0.037546053528785706, 0.03270834684371948, 0.0636855959892273, -0.03943423926830292, -0.006152158137410879, -0.009736958891153336, -0.026936577633023262, -0.07016471773386002, -0.02156319096684456, 0.015959803014993668, -5.448327655699359e-8, -0.04471789672970772, 0.025682849809527397, -0.0897710919380188, 0.061654191464185715, 0.011969950050115585, 0.030483383685350418, -0.06179550662636757, 0.11781979352235794, -0.047371815890073776, -0.025538770481944084, 0.11513691395521164, -0.062088727951049805, -0.13194049894809723, -0.06426917761564255, 0.025336287915706635, -0.04905068129301071, -0.004255226813256741, 0.09215304255485535, -0.03690500184893608, -0.05368976667523384, 0.018883710727095604, 0.029888862743973732, 0.03496601805090904, -0.0573628768324852, 0.0179685540497303, 0.0801917240023613, 0.05041281133890152, 0.018427692353725433, -0.011397057212889194, -0.020949900150299072, 0.01773044839501381, -0.016636664047837257, 0.02143874205648899, -0.017076289281249046, 0.07203146070241928, 0.11466720700263977, -0.028567174449563026, 0.009294441901147366, -0.11035263538360596, 0.020198818296194077, 0.027412939816713333, 0.03362753614783287, 0.007215164601802826, 0.06963673233985901, 0.03555339202284813, -0.06604879349470139, -0.032159361988306046, 0.04752470552921295, 0.06496346741914749, -0.045639846473932266, -0.0006887299823574722, -0.09861752390861511, 0.0010343010071665049, 0.0556977353990078, -0.07144030928611755, -0.020591463893651962, 0.03648938611149788, 0.0698029100894928, -0.004525192081928253, -0.009594225324690342, 0.09170770645141602, -0.02811451442539692, -0.005343426018953323, 0.08847948908805847 ]
0.104157
[[search-explain]] == Explain API The explain api computes a score explanation for a query and a specific document. This can give useful feedback whether a document matches or didn't match a specific query. The `index` and `type` parameters expect a single index and a single type respectively. [float] === Usage Full query example: [source,js] -------------------------------------------------- GET /twitter/\_doc/0/\_explain { "query" : { "match" : { "message" : "elasticsearch" } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] This will yield the following result: [source,js] -------------------------------------------------- { "\_index": "twitter", "\_type": "\_doc", "\_id": "0", "matched": true, "explanation": { "value": 1.6943599, "description": "weight(message:elasticsearch in 0) [PerFieldSimilarity], result of:", "details": [ { "value": 1.6943599, "description": "score(doc=0,freq=1.0 = termFreq=1.0\n), product of:", "details": [ { "value": 1.3862944, "description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:", "details": [ { "value": 1.0, "description": "docFreq", "details": [] }, { "value": 5.0, "description": "docCount", "details": [] } ] }, { "value": 1.2222223, "description": "tfNorm, computed as (freq \* (k1 + 1)) / (freq + k1 \* (1 - b + b \* fieldLength / avgFieldLength)) from:", "details": [ { "value": 1.0, "description": "termFreq=1.0", "details": [] }, { "value": 1.2, "description": "parameter k1", "details": [] }, { "value": 0.75, "description": "parameter b", "details": [] }, { "value": 5.4, "description": "avgFieldLength", "details": [] }, { "value": 3.0, "description": "fieldLength", "details": [] } ] } ] } ] } } -------------------------------------------------- // TESTRESPONSE There is also a simpler way of specifying the query via the `q` parameter. The specified `q` parameter value is then parsed as if the `query\_string` query was used. Example usage of the `q` parameter in the explain api: [source,js] -------------------------------------------------- GET /twitter/\_doc/0/\_explain?q=message:search -------------------------------------------------- // CONSOLE // TEST[setup:twitter] This will yield the same result as the previous request. [float] === All parameters: [horizontal] `\_source`:: Set to `true` to retrieve the `\_source` of the document explained. You can also retrieve part of the document by using `\_source\_include` & `\_source\_exclude` (see <> for more details) `stored\_fields`:: Allows to control which stored fields to return as part of the document explained. `routing`:: Controls the routing in the case the routing was used during indexing. `parent`:: Same effect as setting the routing parameter. `preference`:: Controls on which shard the explain is executed. `source`:: Allows the data of the request to be put in the query string of the url. `q`:: The query string (maps to the query\_string query). `df`:: The default field to use when no field prefix is defined within the query. Defaults to \_all field. `analyzer`:: The analyzer name to be used when analyzing the query string. Defaults to the analyzer of the \_all field. `analyze\_wildcard`:: Should wildcard and prefix queries be analyzed or not. Defaults to false. `lenient`:: If set to true will cause format based failures (like providing text to a numeric field) to be ignored. Defaults to false. `default\_operator`:: The default operator to be used, can be AND or OR. Defaults to OR.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/explain.asciidoc
6.2
elasticsearch-6-2
[ -0.0771942287683487, 0.11498221755027771, 0.007714399602264166, 0.12596659362316132, 0.07628674805164337, -0.020350882783532143, 0.05144147574901581, 0.025286216288805008, 0.08988915383815765, -0.05948454886674881, -0.046612612903118134, -0.07868688553571701, 0.038760002702474594, -0.025875283405184746, 0.02420187182724476, 0.025180920958518982, -0.0275577362626791, -0.035509057343006134, -0.04763304069638252, -0.06648986041545868, 0.07292094826698303, 0.05708743631839752, 0.00808026734739542, 0.0051894099451601505, -0.017168894410133362, -0.016270844265818596, -0.08025015145540237, -0.05030538886785507, 0.054396990686655045, 0.0744914561510086, -0.04635479673743248, 0.03945538401603699, -0.08869409561157227, 0.08460598438978195, -0.049099553376436234, 0.025119109079241753, -0.07175340503454208, -0.024893227964639664, 0.06314625591039658, 0.019571930170059204, 0.021742800250649452, 0.002919292077422142, -0.040271393954753876, -0.08422684669494629, 0.007619037292897701, -0.060549668967723846, -0.04197780787944794, 0.0012941720196977258, -0.07014608383178711, 0.021126657724380493, -0.12256678193807602, -0.028905920684337616, -0.09688401222229004, -0.0440613254904747, 0.039206281304359436, 0.03420454263687134, -0.1300843209028244, 0.051875319331884384, 0.03472327068448067, -0.058676399290561676, 0.011726739816367626, -0.05793888866901398, 0.034010257571935654, 0.004214046522974968, 0.07720623165369034, -0.02413504384458065, -0.0502605177462101, 0.007536265999078751, 0.0029637133702635765, -0.032081250101327896, -0.001485714572481811, 0.017130287364125252, -0.004775666631758213, -0.0022560367360711098, 0.03365393355488777, 0.0188965555280447, -0.0158129520714283, -0.01343259122222662, -0.0026620591524988413, 0.10365509241819382, -0.07826215028762817, -0.14311662316322327, -0.0385599210858345, 0.044910743832588196, 0.061347853392362595, -0.06250328570604324, 0.05793743208050728, -0.07689008861780167, 0.0842665582895279, -0.00849425233900547, -0.052555955946445465, -0.0662468820810318, -0.009545717388391495, 0.01210711058229208, 0.11975420266389847, 0.09026119858026505, -0.0560094378888607, -0.05373353138566017, 0.053999826312065125, 0.046585094183683395, 0.0019634857308119535, -0.004689239896833897, 0.03429799526929855, -0.04152989387512207, -0.019149139523506165, 0.0011147441109642386, 0.03576621413230896, 0.046813059598207474, 0.02374599128961563, -0.024030644446611404, -0.037250179797410965, 0.06179367005825043, -0.016392776742577553, -0.021708855405449867, -0.014716459438204765, 0.033310603350400925, 0.05790795385837555, -0.06232396513223648, 0.057709164917469025, 0.08248241245746613, 0.09118292480707169, 0.06213681772351265, 0.000023167795006884262, -0.038270749151706696, 0.030464572831988335, 0.0799950584769249, -0.01643943414092064, 1.5968113626241655e-33, 0.057197533547878265, -0.021560078486800194, -0.0040606907568871975, -0.03432657942175865, -0.011309493333101273, 0.07202529162168503, -0.015398829244077206, 0.06511348485946655, -0.0750422552227974, 0.018696710467338562, -0.09812530875205994, 0.11911752074956894, -0.045058272778987885, -0.029421517625451088, -0.012632401660084724, 0.02467971481382847, 0.0004761671298183501, 0.0587255097925663, -0.020811133086681366, -0.009341136552393436, 0.011308352462947369, 0.009750009514391422, -0.025693461298942566, -0.013893870636820793, -0.01802455261349678, -0.02116379700601101, -0.04305563122034073, -0.03922288119792938, -0.07915790379047394, -0.026404643431305885, -0.05334848165512085, -0.02619779296219349, -0.04387376084923744, -0.03137525916099548, 0.09848496317863464, 0.04250242933630943, -0.022251801565289497, 0.05807376652956009, -0.05649171769618988, -0.03359188511967659, -0.010408950038254261, 0.021977385506033897, 0.017426105216145515, -0.11193698644638062, -0.060551468282938004, -0.016708146780729294, -0.09461957961320877, -0.017165469005703926, 0.030462203547358513, -0.0041928039863705635, -0.047363393008708954, 0.07892200350761414, 0.0057617006823420525, -0.002681627869606018, 0.09099231660366058, -0.016080792993307114, 0.03457827493548393, 0.10273110866546631, 0.009763212874531746, 0.05939574912190437, 0.009494188241660595, -0.005367384757846594, 0.02694118022918701, -0.011906859464943409, -0.02486526593565941, 0.028503576293587685, -0.025431405752897263, 0.06870292872190475, 0.031418751925230026, 0.020644860342144966, 0.07058707624673843, 0.04723992198705673, 0.017476005479693413, -0.00872527901083231, -0.006402661558240652, -0.0912666842341423, -0.09628380835056305, -0.036250777542591095, -0.00963569525629282, 0.0034743333235383034, 0.013980107381939888, -0.04925618693232536, 0.014803726226091385, 0.013635654002428055, -0.07199698686599731, 0.04989584907889366, -0.03447794169187546, -0.07474303990602493, -0.004040874075144529, -0.07572215050458908, -0.020008020102977753, 0.02582300268113613, -0.1367083191871643, -0.12581904232501984, 0.013048975728452206, -4.781917631300789e-33, -0.03392018750309944, -0.028963785618543625, -0.02837279997766018, 0.008384810760617256, 0.036153655499219894, -0.02660207264125347, 0.031971510499715805, -0.036203235387802124, 0.08411119878292084, 0.07359694689512253, 0.04046042636036873, -0.009901531971991062, -0.06835402548313141, -0.07371477037668228, -0.024572188034653664, 0.042472317814826965, -0.09025352448225021, -0.06751949340105057, 0.00978347472846508, 0.021344831213355064, -0.04694956913590431, 0.0694814920425415, -0.062260571867227554, 0.07219161093235016, -0.038211844861507416, -0.013739224523305893, 0.05852978676557541, 0.05163947865366936, -0.06316745281219482, -0.0045357211492955685, -0.07782234996557236, -0.04996376857161522, -0.036282364279031754, 0.05642078444361687, -0.06475283205509186, 0.004031222313642502, 0.02815939486026764, 0.03930387645959854, 0.019001027569174767, 0.03692596033215523, 0.06630575656890869, -0.04164997115731239, 0.009243719279766083, 0.025656841695308685, -0.036842312663793564, 0.0004891551798209548, 0.05404214188456535, 0.04781722277402878, 0.039578501135110855, -0.05977553129196167, 0.07942143827676773, -0.005903409328311682, -0.005481303203850985, 0.0406915545463562, -0.07532407343387604, -0.089137963950634, -0.08910756558179855, 0.01216220948845148, -0.09225545078516006, 0.018506839871406555, -0.004308981820940971, 0.018385963514447212, -0.02614661492407322, 0.05489297956228256, -0.0026089875027537346, -0.11626327037811279, -0.06876470148563385, -0.04813555255532265, -0.030920078977942467, -0.017009437084197998, 0.026080425828695297, -0.10060228407382965, 0.11764354258775711, -0.018831592053174973, 0.050278931856155396, -0.016225911676883698, 0.03357614204287529, -0.00644361786544323, 0.0596124529838562, -0.0387478731572628, -0.008800966665148735, 0.03166230395436287, 0.04884978383779526, 0.028734633699059486, -0.020985184237360954, 0.04252823814749718, -0.055680807679891586, 0.11359278857707977, -0.07302699983119965, 0.04696869105100632, 0.004933388438075781, -0.006947887595742941, -0.050106022506952286, 0.007099118549376726, 0.012725241482257843, -5.982684569971752e-8, -0.06278087943792343, -0.007591274566948414, -0.12258385121822357, 0.04530468210577965, -0.021962422877550125, 0.059311915189027786, 0.030569901689887047, 0.041164569556713104, -0.04367224872112274, -0.01622183434665203, 0.0015747976722195745, 0.02282811887562275, -0.02534215897321701, 0.011610699817538261, -0.03707617148756981, -0.01984408125281334, -0.07084769755601883, -0.01801994815468788, -0.027589671313762665, -0.016567721962928772, -0.031174764037132263, 0.009880085475742817, -0.014530022628605366, -0.016905326396226883, 0.09614114463329315, 0.04616774246096611, -0.017279161140322685, 0.0618261881172657, 0.04849018156528473, 0.02589862048625946, -0.03646233677864075, 0.022676993161439896, -0.048540275543928146, -0.023680834099650383, 0.008185801096260548, 0.02694942057132721, 0.027294006198644638, -0.021193061023950577, -0.06293559074401855, 0.04327830299735069, 0.017266452312469482, 0.043106526136398315, -0.047621045261621475, 0.005637599620968103, 0.042238786816596985, 0.03660230711102486, -0.022224275395274162, -0.015046179294586182, 0.08466869592666626, -0.011822843924164772, 0.011602245271205902, -0.08284157514572144, -0.03640754893422127, 0.043259039521217346, -0.01691061072051525, -0.05634799227118492, 0.02144537679851055, 0.03235524147748947, 0.014041571877896786, 0.02511467970907688, 0.10385986417531967, -0.032842814922332764, 0.06602216511964798, 0.04661786928772926 ]
0.074458
[[search-template]] == Search Template The `/\_search/template` endpoint allows to use the mustache language to pre render search requests, before they are executed and fill existing templates with template parameters. [source,js] ------------------------------------------ GET \_search/template { "source" : { "query": { "match" : { "{{my\_field}}" : "{{my\_value}}" } }, "size" : "{{my\_size}}" }, "params" : { "my\_field" : "message", "my\_value" : "some message", "my\_size" : 5 } } ------------------------------------------ // CONSOLE // TEST[setup:twitter] For more information on how Mustache templating and what kind of templating you can do with it check out the http://mustache.github.io/mustache.5.html[online documentation of the mustache project]. NOTE: The mustache language is implemented in Elasticsearch as a sandboxed scripting language, hence it obeys settings that may be used to enable or disable scripts per type and context as described in the <> [float] ==== More template examples [float] ===== Filling in a query string with a single value [source,js] ------------------------------------------ GET \_search/template { "source": { "query": { "term": { "message": "{{query\_string}}" } } }, "params": { "query\_string": "search for these words" } } ------------------------------------------ // CONSOLE // TEST[setup:twitter] [float] ===== Converting parameters to JSON The `{{#toJson}}parameter{{/toJson}}` function can be used to convert parameters like maps and array to their JSON representation: [source,js] ------------------------------------------ GET \_search/template { "source": "{ \"query\": { \"terms\": {{#toJson}}statuses{{/toJson}} }}", "params": { "statuses" : { "status": [ "pending", "published" ] } } } ------------------------------------------ // CONSOLE which is rendered as: [source,js] ------------------------------------------ { "query": { "terms": { "status": [ "pending", "published" ] } } } ------------------------------------------ // NOTCONSOLE A more complex example substitutes an array of JSON objects: [source,js] ------------------------------------------ GET \_search/template { "source": "{\"query\":{\"bool\":{\"must\": {{#toJson}}clauses{{/toJson}} }}}", "params": { "clauses": [ { "term": { "user" : "foo" } }, { "term": { "user" : "bar" } } ] } } ------------------------------------------ // CONSOLE which is rendered as: [source,js] ------------------------------------------ { "query" : { "bool" : { "must" : [ { "term" : { "user" : "foo" } }, { "term" : { "user" : "bar" } } ] } } } ------------------------------------------ // NOTCONSOLE [float] ===== Concatenating array of values The `{{#join}}array{{/join}}` function can be used to concatenate the values of an array as a comma delimited string: [source,js] ------------------------------------------ GET \_search/template { "source": { "query": { "match": { "emails": "{{#join}}emails{{/join}}" } } }, "params": { "emails": [ "username@email.com", "lastname@email.com" ] } } ------------------------------------------ // CONSOLE which is rendered as: [source,js] ------------------------------------------ { "query" : { "match" : { "emails" : "username@email.com,lastname@email.com" } } } ------------------------------------------ // NOTCONSOLE The function also accepts a custom delimiter: [source,js] ------------------------------------------ GET \_search/template { "source": { "query": { "range": { "born": { "gte" : "{{date.min}}", "lte" : "{{date.max}}", "format": "{{#join delimiter='||'}}date.formats{{/join delimiter='||'}}" } } } }, "params": { "date": { "min": "2016", "max": "31/12/2017", "formats": ["dd/MM/yyyy", "yyyy"] } } } ------------------------------------------ // CONSOLE which is rendered as: [source,js] ------------------------------------------ { "query" : { "range" : { "born" : { "gte" : "2016", "lte" : "31/12/2017", "format" : "dd/MM/yyyy||yyyy" } } } } ------------------------------------------ // NOTCONSOLE [float] ===== Default values A default value is written as `{{var}}{{^var}}default{{/var}}` for instance: [source,js] ------------------------------------------ { "source": { "query": { "range": { "line\_no": { "gte": "{{start}}", "lte": "{{end}}{{^end}}20{{/end}}" } } } }, "params": { ... } } ------------------------------------------ // NOTCONSOLE When `params` is `{ "start": 10, "end": 15 }` this query would be rendered as: [source,js] ------------------------------------------ { "range": { "line\_no": { "gte": "10", "lte": "15" } } } ------------------------------------------ // NOTCONSOLE But when `params` is `{ "start": 10 }` this query would use the default value for `end`: [source,js] ------------------------------------------ { "range": { "line\_no": { "gte": "10", "lte": "20" } } } ------------------------------------------ // NOTCONSOLE
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/search-template.asciidoc
6.2
elasticsearch-6-2
[ -0.01795561984181404, 0.1566663235425949, 0.044475436210632324, 0.08739203959703445, 0.01059146411716938, 0.06463109701871872, 0.015666194260120392, 0.04242096468806267, 0.08070597797632217, -0.07023945450782776, -0.03920111432671547, -0.008992671966552734, -0.010367271490395069, -0.012269195169210434, 0.04703288897871971, 0.04815712198615074, -0.01994173973798752, -0.016275228932499886, -0.0061210454441607, -0.044770143926143646, 0.043071944266557693, 0.06027039512991905, -0.018382610753178596, -0.0023185727186501026, -0.009646886959671974, 0.017570802941918373, -0.0644007995724678, -0.07511682063341141, 0.03882187604904175, 0.08513467013835907, 0.01632343977689743, -0.028227606788277626, 0.00043702960829250515, 0.12831659615039825, 0.002760721603408456, 0.030251378193497658, -0.03866468369960785, 0.01280123833566904, 0.02588648907840252, 0.03158070519566536, 0.008738149888813496, 0.014906666241586208, -0.09232807159423828, -0.07296290248632431, 0.013205734081566334, -0.07370498031377792, -0.017334839329123497, 0.027110470458865166, -0.09066756814718246, -0.07035063207149506, -0.10430246591567993, -0.08259635418653488, -0.05422922968864441, -0.0021475772373378277, 0.03876097500324249, 0.008714783005416393, -0.03244528919458389, -0.011342407204210758, 0.05224490538239479, -0.03314896672964096, 0.00004640691986423917, -0.054099272936582565, 0.03744138404726982, -0.0019137387862429023, 0.007368905004113913, -0.06221383810043335, -0.016338583081960678, 0.030948536470532417, 0.034483980387449265, 0.0130238588899374, 0.0036930134519934654, 0.015651153400540352, 0.026852650567889214, -0.007671448867768049, -0.00027155756833963096, 0.07359790802001953, -0.0048601157031953335, -0.029668737202882767, -0.022292055189609528, 0.052563656121492386, -0.04405951499938965, -0.09652462601661682, -0.04097814857959747, 0.005512246862053871, 0.05122610181570053, -0.04509055241942406, -0.03376181796193123, -0.03360844403505325, 0.08426903188228607, -0.04193638265132904, -0.05274444818496704, -0.0624602809548378, -0.06690045446157455, -0.006494777277112007, 0.03732248768210411, 0.05771750956773758, -0.004948974121361971, -0.07142352312803268, 0.03581804037094116, -0.031203951686620712, 0.04892240837216377, -0.038215961307287216, 0.0884060189127922, -0.05196354538202286, 0.0038042098749428988, 0.07715899497270584, -0.018336044624447823, 0.029059499502182007, 0.03410087898373604, 0.04648435488343239, -0.0332050621509552, 0.04958617687225342, -0.00022971240105107427, -0.02070927433669567, 0.047893889248371124, 0.004072084091603756, 0.023219965398311615, -0.06265860050916672, 0.005116224754601717, 0.13782168924808502, 0.12048426270484924, -0.008559388108551502, -0.09504571557044983, -0.01798820309340954, 0.025672700256109238, 0.04519180208444595, -0.024006150662899017, -7.958310731772935e-34, 0.0750378966331482, 0.07702771574258804, -0.05684162303805351, 0.08464618027210236, 0.024417288601398468, 0.06933249533176422, 0.04986155778169632, 0.08877238631248474, -0.06157495453953743, 0.03579288348555565, -0.05354144796729088, 0.07275316119194031, -0.06366187334060669, -0.01813092827796936, -0.08228261023759842, -0.030745603144168854, -0.037181105464696884, 0.015831932425498962, 0.025889873504638672, -0.012209625914692879, 0.018631400540471077, -0.00511542521417141, -0.03826557844877243, -0.007180582731962204, 0.020933568477630615, -0.03487968072295189, -0.03193925693631172, -0.02920730970799923, -0.12676873803138733, -0.03611955791711807, -0.04113656282424927, -0.020842481404542923, 0.02442781813442707, 0.005721774883568287, 0.07765109091997147, 0.014019785448908806, 0.0228606965392828, 0.05108841136097908, -0.08206173032522202, 0.0079681146889925, 0.01638321578502655, 0.018737755715847015, 0.007430647034198046, -0.07875102758407593, -0.05817350000143051, -0.09430357068777084, -0.05102032423019409, 0.010179742239415646, 0.028204012662172318, -0.11460617184638977, -0.003621748648583889, 0.07288574427366257, -0.021538257598876953, -0.03820398822426796, 0.09587644785642624, -0.0010347742354497313, -0.015276994556188583, 0.012249374762177467, 0.045654233545064926, 0.03215344250202179, -0.008503162302076817, -0.01827850192785263, 0.0626341924071312, 0.0225383210927248, 0.00889605563133955, -0.031091025099158287, 0.045552901923656464, 0.010944843292236328, 0.03953096270561218, 0.03728459030389786, 0.04947938397526741, 0.020286191254854202, 0.0332767590880394, 0.01745658740401268, -0.018541298806667328, -0.09773734211921692, -0.06391981244087219, 0.012542295269668102, 0.025241520255804062, 0.048078350722789764, -0.055661484599113464, -0.057504937052726746, -0.022915514186024666, 0.07284701615571976, 0.0872834101319313, 0.003456543432548642, -0.0018587146187201142, -0.07023900002241135, -0.032458387315273285, -0.09299106150865555, -0.050218917429447174, -0.014470353722572327, -0.060521289706230164, -0.10808274894952774, -0.011379644274711609, -1.8296890994785458e-33, 0.04428022727370262, -0.049036070704460144, -0.0013426294317469, 0.047121670097112656, 0.017617417499423027, -0.015970099717378616, 0.06244419515132904, 0.010930203832685947, 0.02046028897166252, 0.08859425783157349, -0.009812586009502411, -0.05747757852077484, -0.006366633344441652, -0.06810295581817627, -0.03957391902804375, 0.045194000005722046, -0.0643596276640892, -0.10387470573186874, 0.013226727023720741, -0.0616033561527729, -0.03981519490480423, -0.009414835833013058, -0.05606907233595848, 0.0587175227701664, -0.11247945576906204, -0.0026027478743344545, 0.05121238902211189, -0.024060096591711044, -0.030632494017481804, 0.0698835700750351, -0.025842195376753807, -0.028052272275090218, 0.00994293112307787, 0.05788807570934296, -0.058651864528656006, 0.03679735213518143, -0.036750610917806625, 0.04391254112124443, 0.07742750644683838, 0.09666768461465836, 0.06652865558862686, 0.0064074513502418995, -0.04298829287290573, 0.03939305245876312, -0.06776510179042816, -0.03078923188149929, 0.07511819154024124, -0.003733449149876833, 0.0535103864967823, -0.08705554157495499, 0.07580918073654175, -0.0007964965188875794, -0.14671972393989563, 0.05431230738759041, -0.06392727792263031, -0.07449162751436234, -0.07685021311044693, 0.0038076979108154774, -0.07267183065414429, 0.031058356165885925, 0.027629394084215164, -0.014510208740830421, -0.0170891135931015, -0.034433186054229736, 0.028378136456012726, -0.0753297433257103, -0.04701724275946617, -0.038778867572546005, -0.015119282528758049, -0.06947636604309082, 0.016162829473614693, -0.06052606552839279, 0.0934162512421608, 0.07592466473579407, 0.045711539685726166, -0.007602576166391373, 0.038212429732084274, 0.005315537564456463, 0.1150553971529007, -0.028254922479391098, -0.016649285331368446, -0.01188476663082838, 0.005829162430018187, 0.0746011883020401, -0.0067635043524205685, -0.03160072863101959, -0.06006236746907234, 0.1665567308664322, -0.0775582492351532, -0.040181964635849, 0.022434044629335403, 0.011015349999070168, -0.0032686134800314903, 0.01201154850423336, 0.05693823844194412, -5.6257185576669144e-8, -0.07462328672409058, 0.007436655927449465, -0.024851970374584198, 0.042123835533857346, -0.05054095759987831, 0.034166350960731506, 0.10473950207233429, 0.049132172018289566, -0.027346529066562653, -0.015886971727013588, -0.021582143381237984, 0.0773252546787262, -0.022998936474323273, 0.017961187288165092, -0.03017262928187847, -0.04528861120343208, -0.10883396118879318, -0.03681550920009613, -0.013566875830292702, -0.04450726509094238, 0.02441895566880703, 0.06351374089717865, -0.04242415353655815, -0.032033227384090424, 0.09450287371873856, 0.020669294521212578, -0.06331367790699005, 0.054163265973329544, 0.009325592778623104, 0.02587468922138214, -0.02347474917769432, 0.006780554540455341, -0.04739854857325554, 0.0025328928604722023, -0.006984766107052565, 0.004826157819479704, -0.010871369391679764, -0.06793154776096344, -0.06345350295305252, 0.03295325115323067, 0.05256359279155731, 0.006900216918438673, -0.04739968106150627, -0.017260193824768066, -0.059801436960697174, 0.01148128416389227, 0.00975997094064951, -0.003357239533215761, 0.029796235263347626, 0.010613386519253254, 0.1011962965130806, -0.05893324315547943, -0.010218027047812939, -0.02798214927315712, -0.03086748905479908, -0.07951434701681137, 0.04640670865774155, 0.05480201542377472, 0.012347783893346786, -0.0002607084752526134, 0.06031479313969612, -0.025673286989331245, 0.020219821482896805, -0.051814526319503784 ]
0.039405
------------------------------------------ { "range": { "line\_no": { "gte": "10", "lte": "15" } } } ------------------------------------------ // NOTCONSOLE But when `params` is `{ "start": 10 }` this query would use the default value for `end`: [source,js] ------------------------------------------ { "range": { "line\_no": { "gte": "10", "lte": "20" } } } ------------------------------------------ // NOTCONSOLE [float] ===== Conditional clauses Conditional clauses cannot be expressed using the JSON form of the template. Instead, the template \*must\* be passed as a string. For instance, let's say we wanted to run a `match` query on the `line` field, and optionally wanted to filter by line numbers, where `start` and `end` are optional. The `params` would look like: [source,js] ------------------------------------------ { "params": { "text": "words to search for", "line\_no": { <1> "start": 10, <1> "end": 20 <1> } } } ------------------------------------------ // NOTCONSOLE <1> All three of these elements are optional. We could write the query as: [source,js] ------------------------------------------ { "query": { "bool": { "must": { "match": { "line": "{{text}}" <1> } }, "filter": { {{#line\_no}} <2> "range": { "line\_no": { {{#start}} <3> "gte": "{{start}}" <4> {{#end}},{{/end}} <5> {{/start}} <3> {{#end}} <6> "lte": "{{end}}" <7> {{/end}} <6> } } {{/line\_no}} <2> } } } } ------------------------------------------ // NOTCONSOLE <1> Fill in the value of param `text` <2> Include the `range` filter only if `line\_no` is specified <3> Include the `gte` clause only if `line\_no.start` is specified <4> Fill in the value of param `line\_no.start` <5> Add a comma after the `gte` clause only if `line\_no.start` AND `line\_no.end` are specified <6> Include the `lte` clause only if `line\_no.end` is specified <7> Fill in the value of param `line\_no.end` [NOTE] ================================== As written above, this template is not valid JSON because it includes the \_section\_ markers like `{{#line\_no}}`. For this reason, the template should either be stored in a file (see <>) or, when used via the REST API, should be written as a string: [source,js] -------------------- "source": "{\"query\":{\"bool\":{\"must\":{\"match\":{\"line\":\"{{text}}\"}},\"filter\":{{{#line\_no}}\"range\":{\"line\_no\":{{{#start}}\"gte\":\"{{start}}\"{{#end}},{{/end}}{{/start}}{{#end}}\"lte\":\"{{end}}\"{{/end}}}}{{/line\_no}}}}}}" -------------------- // NOTCONSOLE ================================== [float] ===== Encoding URLs The `{{#url}}value{{/url}}` function can be used to encode a string value in a HTML encoding form as defined in by the http://www.w3.org/TR/html4/[HTML specification]. As an example, it is useful to encode a URL: [source,js] ------------------------------------------ GET \_render/template { "source" : { "query" : { "term": { "http\_access\_log": "{{#url}}{{host}}/{{page}}{{/url}}" } } }, "params": { "host": "https://www.elastic.co/", "page": "learn" } } ------------------------------------------ // CONSOLE The previous query will be rendered as: [source,js] ------------------------------------------ { "template\_output" : { "query" : { "term" : { "http\_access\_log" : "https%3A%2F%2Fwww.elastic.co%2F%2Flearn" } } } } ------------------------------------------ // TESTRESPONSE [float] [[pre-registered-templates]] ===== Pre-registered template You can register search templates by using the stored scripts api. [source,js] ------------------------------------------ POST \_scripts/ { "script": { "lang": "mustache", "source": { "query": { "match": { "title": "{{query\_string}}" } } } } } ------------------------------------------ // CONSOLE // TEST[continued] ////////////////////////// We want to be sure that the template has been created, because we'll use it later. [source,js] -------------------------------------------------- { "acknowledged" : true } -------------------------------------------------- // TESTRESPONSE ////////////////////////// This template can be retrieved by [source,js] ------------------------------------------ GET \_scripts/ ------------------------------------------ // CONSOLE // TEST[continued] which is rendered as: [source,js] ------------------------------------------ { "script" : { "lang" : "mustache", "source" : "{\"query\":{\"match\":{\"title\":\"{{query\_string}}\"}}}", "options": { "content\_type" : "application/json; charset=UTF-8" } }, "\_id": "", "found": true } ------------------------------------------ // TESTRESPONSE This template can be deleted by [source,js] ------------------------------------------ DELETE \_scripts/ ------------------------------------------ // CONSOLE // TEST[continued] ////////////////////////// We want to be sure that the template has been created, because we'll use it later. [source,js] -------------------------------------------------- { "acknowledged" : true } -------------------------------------------------- // TESTRESPONSE ////////////////////////// To use a stored template at search time use: [source,js] ------------------------------------------ GET \_search/template { "id": "", <1> "params": { "query\_string": "search for
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/search-template.asciidoc
6.2
elasticsearch-6-2
[ -0.054528649896383286, 0.049283117055892944, -0.0021756694186478853, 0.049310073256492615, -0.06419704109430313, 0.05308999493718147, -0.025009356439113617, 0.07227130979299545, 0.021278157830238342, -0.07965640723705292, -0.00016567157581448555, -0.06122265383601189, -0.02439045161008835, -0.0043839458376169205, 0.03733058273792267, 0.04251907393336296, -0.007971188053488731, -0.07624991983175278, -0.06718838959932327, -0.1144104152917862, 0.07089219987392426, 0.10685540735721588, 0.006531679071485996, -0.05290719121694565, 0.016072934493422508, -0.06319142132997513, -0.009831985458731651, -0.006638161838054657, 0.07752075046300888, 0.05574816092848778, -0.04349379986524582, 0.0017427698476240039, -0.08281969279050827, 0.11757374554872513, 0.01370956003665924, -0.04805230721831322, 0.001314791152253747, -0.03351445123553276, 0.020732292905449867, 0.06833703815937042, 0.05635834112763405, 0.026497334241867065, -0.0987766683101654, -0.09180197864770889, 0.050125639885663986, -0.042128484696149826, -0.057849034667015076, 0.012297315523028374, -0.025444045662879944, -0.0037358077242970467, -0.020152803510427475, -0.0002734068257268518, -0.032096799463033676, -0.0032446940895169973, 0.06482228636741638, 0.039782118052244186, -0.08514942973852158, -0.013432214967906475, 0.0622171051800251, -0.04349074140191078, -0.05598250776529312, -0.0635339617729187, -0.040521830320358276, -0.03822348639369011, -0.027585478499531746, -0.032339293509721756, -0.023988835513591766, 0.05344647541642189, 0.045820124447345734, 0.048330873250961304, -0.02351994998753071, -0.040430713444948196, -0.061464302241802216, -0.026454661041498184, -0.03977663442492485, 0.06259872764348984, 0.007514200173318386, -0.02590823546051979, 0.015763329342007637, 0.015792854130268097, -0.01777668669819832, -0.10774124413728714, -0.0610898919403553, 0.005338530987501144, -0.0022918747272342443, -0.0505276694893837, -0.013003029860556126, -0.018030136823654175, 0.11755051463842392, -0.03597511351108551, -0.09418580681085587, -0.004979147110134363, -0.025977009907364845, 0.05664382502436638, -0.027185624465346336, 0.06135417893528938, 0.03220066428184509, -0.0035671063233166933, -0.029822921380400658, 0.028222020715475082, 0.005508179776370525, -0.07473800331354141, 0.017732173204421997, 0.00510375015437603, -0.06304518133401871, -0.01939685270190239, 0.03420770540833473, 0.02415340021252632, -0.06175195798277855, 0.005330967251211405, 0.0010465335799381137, 0.07164011895656586, -0.021868780255317688, -0.09462835639715195, -0.0590677373111248, -0.007523125968873501, 0.04857674241065979, -0.01750129833817482, 0.02433975413441658, 0.036616962403059006, 0.06953410804271698, 0.008539066649973392, -0.08300711214542389, 0.05940613895654678, -0.009248140268027782, -0.006702068727463484, 0.10290239751338959, -1.083872004850879e-33, 0.027887385338544846, -0.0947326198220253, 0.05689563974738121, -0.06913842260837555, 0.003199775703251362, 0.043472856283187866, -0.048809826374053955, 0.048333656042814255, 0.0026010049041360617, 0.06962108612060547, -0.03689355403184891, -0.009137134999036789, -0.07516230642795563, -0.06704965978860855, 0.00030964252073317766, -0.000411475746659562, 0.02069580927491188, -0.0235774926841259, -0.03543059155344963, 0.02555271051824093, -0.0115334652364254, -0.06706395000219345, -0.05754850059747696, 0.013400008901953697, -0.012671749107539654, -0.03830830752849579, -0.07294781506061554, -0.044445790350437164, -0.09607088565826416, -0.031664710491895676, -0.06480025500059128, 0.01394099835306406, -0.019347015768289566, 0.02472475916147232, -0.0005159584688954055, 0.03685144707560539, 0.0217635165899992, 0.032553449273109436, -0.05431380867958069, -0.020897775888442993, -0.0232304185628891, 0.03934100642800331, 0.022834524512290955, -0.050235994160175323, 0.005478325765579939, -0.0828094407916069, 0.011275433003902435, 0.02753429487347603, -0.047400642186403275, 0.05228741466999054, -0.07571765780448914, 0.07754591852426529, -0.015760865062475204, -0.03249165415763855, 0.11447533965110779, -0.034208089113235474, 0.03372243419289589, 0.11007676273584366, 0.009138080291450024, 0.02316744439303875, -0.058756228536367416, 0.006341171450912952, -0.011677812784910202, 0.003526827320456505, 0.08849433064460754, 0.09767045825719833, 0.021384775638580322, 0.039016082882881165, 0.0386614054441452, 0.03781328722834587, -0.023429276421666145, -0.0074498639442026615, 0.06507597863674164, 0.043197162449359894, 0.04687052592635155, -0.07137501239776611, -0.020635265856981277, 0.034531425684690475, 0.047126270830631256, -0.06735628843307495, 0.06486969441175461, -0.002344689331948757, -0.08221098780632019, 0.07552062720060349, 0.00900219101458788, 0.0036687611136585474, -0.002751818625256419, -0.017202051356434822, -0.08411578088998795, -0.006017214152961969, -0.03477277606725693, 0.002703679259866476, -0.0032348271925002337, -0.03527235984802246, -0.01354298833757639, -2.3765044595681036e-33, 0.09255324304103851, -0.00921339076012373, 0.021897489205002785, 0.02711784653365612, 0.04323097690939903, -0.03347734361886978, 0.1170690581202507, 0.021076859906315804, 0.05892414599657059, 0.09298736602067947, 0.027369460090994835, -0.025920365005731583, 0.06673584878444672, -0.04204724729061127, 0.015687009319663048, 0.06743204593658447, -0.05377059057354927, -0.07576446980237961, 0.01348047610372305, -0.08114557713270187, 0.016713201999664307, 0.02281547710299492, -0.03388403356075287, 0.04146371781826019, 0.009733127430081367, -0.05092541500926018, -0.007668273523449898, 0.02403232455253601, -0.11091263592243195, -0.013996485620737076, -0.05375621095299721, -0.07206690311431885, 0.013035292737185955, 0.04363714158535004, -0.036822374910116196, -0.039829321205616, 0.027944834902882576, 0.0843372642993927, 0.048198260366916656, 0.07120975852012634, -0.023278623819351196, 0.0031028424855321646, 0.04309537634253502, 0.05400253087282181, -0.06508331000804901, 0.05135274678468704, 0.027410509064793587, -0.021417027339339256, -0.07032044231891632, -0.08660493791103363, -0.01094125583767891, 0.03997925668954849, -0.08257217705249786, 0.0592842623591423, 0.0025284455623477697, -0.06864430755376816, -0.041692350059747696, -0.11418942362070084, -0.05802423134446144, -0.069603331387043, 0.04244296997785568, -0.0631435215473175, -0.005536002106964588, -0.03198584169149399, 0.06525639444589615, -0.10548790544271469, -0.0752638503909111, 0.0025683774147182703, 0.013630548492074013, -0.04702423885464668, 0.012840699404478073, -0.04287618771195412, 0.11846189200878143, -0.04311631992459297, -0.059999581426382065, -0.0713486447930336, 0.053891222923994064, -0.028818760067224503, 0.10642926394939423, -0.000789255544077605, -0.05977141484618187, -0.010862323455512524, 0.03241501748561859, 0.07507479935884476, -0.034684065729379654, 0.05192072317004204, -0.047126952558755875, 0.12110135704278946, 0.07835617661476135, 0.07957372814416885, 0.002946206135675311, -0.007005895487964153, -0.004567546769976616, 0.016333186998963356, 0.006553830578923225, -4.9885930053505945e-8, -0.11075703799724579, 0.017632171511650085, -0.07297360897064209, 0.015910034999251366, 0.07079653441905975, 0.03585437685251236, 0.06662879139184952, 0.04971207305788994, 0.0017708234954625368, 0.014603483490645885, 0.054987404495477676, 0.041856180876493454, -0.039704158902168274, 0.027157384902238846, -0.021349158138036728, -0.06811629980802536, 0.006284542381763458, -0.009650157764554024, -0.015611247159540653, 0.015399487689137459, 0.007095209322869778, 0.0532277375459671, -0.04087144881486893, -0.018950771540403366, 0.10054752230644226, 0.022819114848971367, -0.022679734975099564, 0.07049503177404404, 0.06755229830741882, 0.034123629331588745, -0.020462866872549057, -0.031484853476285934, 0.027943838387727737, 0.047333020716905594, -0.1207796260714531, -0.012626530602574348, 0.030425960198044777, 0.08248095959424973, -0.04552639648318291, 0.0027780288364738226, 0.011641050688922405, -0.05314677208662033, -0.13535015285015106, 0.04473340883851051, -0.04798377305269241, -0.02509690262377262, 0.001987271709367633, 0.011153897270560265, 0.04645030200481415, -0.021750546991825104, 0.001333752297796309, -0.08049028366804123, 0.016078077256679535, -0.09119381755590439, 0.01060006208717823, -0.10736402869224548, 0.029659897089004517, 0.006865610834211111, -0.012242590077221394, -0.008922247216105461, 0.037373293191194534, -0.033737633377313614, -0.018998315557837486, 0.038780104368925095 ]
0.01292
////////////////////////// We want to be sure that the template has been created, because we'll use it later. [source,js] -------------------------------------------------- { "acknowledged" : true } -------------------------------------------------- // TESTRESPONSE ////////////////////////// To use a stored template at search time use: [source,js] ------------------------------------------ GET \_search/template { "id": "", <1> "params": { "query\_string": "search for these words" } } ------------------------------------------ // CONSOLE // TEST[catch:missing] <1> Name of the stored template script. [float] ==== Validating templates A template can be rendered in a response with given parameters using [source,js] ------------------------------------------ GET \_render/template { "source": "{ \"query\": { \"terms\": {{#toJson}}statuses{{/toJson}} }}", "params": { "statuses" : { "status": [ "pending", "published" ] } } } ------------------------------------------ // CONSOLE This call will return the rendered template: [source,js] ------------------------------------------ { "template\_output": { "query": { "terms": { "status": [ <1> "pending", "published" ] } } } } ------------------------------------------ // TESTRESPONSE <1> `status` array has been populated with values from the `params` object. Pre-registered templates can also be rendered using [source,js] ------------------------------------------ GET \_render/template/ { "params": { "..." } } ------------------------------------------ // NOTCONSOLE [float] ===== Explain You can use `explain` parameter when running a template: [source,js] ------------------------------------------ GET \_search/template { "id": "my\_template", "params": { "status": [ "pending", "published" ] }, "explain": true } ------------------------------------------ // CONSOLE // TEST[catch:missing] [float] ===== Profiling You can use `profile` parameter when running a template: [source,js] ------------------------------------------ GET \_search/template { "id": "my\_template", "params": { "status": [ "pending", "published" ] }, "profile": true } ------------------------------------------ // CONSOLE // TEST[catch:missing] [[multi-search-template]] == Multi Search Template The multi search template API allows to execute several search template requests within the same API using the `\_msearch/template` endpoint. The format of the request is similar to the <> format: [source,js] -------------------------------------------------- header\n body\n header\n body\n -------------------------------------------------- // NOTCONSOLE The header part supports the same `index`, `types`, `search\_type`, `preference`, and `routing` options as the usual Multi Search API. The body includes a search template body request and supports inline, stored and file templates. Here is an example: [source,js] -------------------------------------------------- $ cat requests {"index": "test"} {"source": {"query": {"match": {"user" : "{{username}}" }}}, "params": {"username": "john"}} <1> {"index": "\_all", "types": "accounts"} {"source": {"query": {"{{query\_type}}": {"name": "{{name}}" }}}, "params": {"query\_type": "match\_phrase\_prefix", "name": "Smith"}} {"index": "\_all"} {"id": "template\_1", "params": {"query\_string": "search for these words" }} <2> $ curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/\_msearch/template --data-binary "@requests"; echo -------------------------------------------------- // NOTCONSOLE // Not converting to console because this shows how curl works <1> Inline search template request <2> Search template request based on a stored template The response returns a `responses` array, which includes the search template response for each search template request matching its order in the original multi search template request. If there was a complete failure for that specific search template request, an object with `error` message will be returned in place of the actual search response.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/search-template.asciidoc
6.2
elasticsearch-6-2
[ -0.10902589559555054, 0.09202729910612106, -0.021973052993416786, 0.10401393473148346, 0.0175999253988266, 0.058498356491327286, 0.009434451349079609, 0.01612362451851368, 0.038437310606241226, -0.061522226780653, -0.01387761626392603, -0.0372612401843071, -0.04788735881447792, -0.0740031823515892, -0.06256534159183502, -0.022236915305256844, 0.024092653766274452, -0.01853494718670845, 0.031189341098070145, 0.006972926668822765, 0.03525710850954056, -0.01996402069926262, 0.0495217926800251, -0.016404835507273674, 0.011478935368359089, -0.007406001910567284, -0.008477326482534409, -0.03252149000763893, 0.037848908454179764, 0.034073606133461, 0.03305451199412346, -0.0534089021384716, 0.011665056459605694, 0.04987450689077377, 0.0711711123585701, 0.038788944482803345, 0.022080466151237488, -0.03140266612172127, -0.014318650588393211, -0.0211500097066164, -0.0072320313192903996, -0.008769555017352104, -0.11073701828718185, -0.035445041954517365, -0.035682570189237595, -0.05639880150556564, -0.031568437814712524, -0.03491898998618126, -0.08835526555776596, -0.04602205380797386, -0.09614421427249908, -0.0650445967912674, 0.009618793614208698, -0.11732322722673416, -0.03839672729372978, 0.043815333396196365, 0.02067405730485916, -0.053500883281230927, -0.0038318014703691006, -0.009037768468260765, 0.009639871306717396, -0.0416068434715271, 0.027685003355145454, 0.002335259458050132, -0.003631116822361946, -0.0012640667846426368, -0.047041330486536026, -0.027748368680477142, 0.04676385223865509, -0.017565641552209854, -0.0049474649131298065, 0.021585535258054733, 0.026317443698644638, -0.033735621720552444, -0.01680103875696659, -0.020841099321842194, -0.05853039771318436, -0.01594054512679577, -0.00422290526330471, -0.04508782923221588, 0.026931574568152428, -0.052505504339933395, -0.042720869183540344, -0.05086851492524147, -0.016436321660876274, -0.0008174018003046513, -0.007459327578544617, 0.01659916341304779, 0.07748028635978699, -0.045611318200826645, 0.02192513272166252, -0.01280063483864069, -0.05796961858868599, -0.049303602427244186, -0.011148406192660332, 0.05275249108672142, -0.03612424060702324, 0.03773393854498863, 0.05728144198656082, 0.01939201168715954, 0.04017557576298714, 0.021753888577222824, -0.038069646805524826, 0.0176185742020607, 0.04504678025841713, 0.010758623480796814, -0.03270754590630531, 0.029905343428254128, 0.023685293272137642, 0.04222099483013153, 0.01630791462957859, 0.0882064700126648, -0.036541588604450226, -0.05398667976260185, -0.03688129037618637, -0.049551866948604584, -0.008105289191007614, -0.10949766635894775, -0.007312003057450056, 0.08080153167247772, 0.13936834037303925, -0.027553768828511238, -0.0388367623090744, -0.015213820151984692, -0.026821760460734367, -0.021617736667394638, 0.049155160784721375, 2.111768254412547e-33, 0.05007132887840271, 0.0527353510260582, -0.0919407531619072, 0.09722897410392761, 0.08212956041097641, 0.030736587941646576, 0.05064306780695915, 0.07381566613912582, -0.07933882623910904, 0.010336202569305897, 0.015835421159863472, 0.0235065296292305, -0.06303701549768448, -0.08261695504188538, -0.18907776474952698, -0.009439694695174694, -0.01829303801059723, 0.046164676547050476, 0.001279324758797884, -0.03281191363930702, 0.06128518283367157, -0.04371602088212967, 0.02473374642431736, 0.013290985487401485, 0.01760871149599552, -0.025772597640752792, -0.06880617886781693, 0.06573048233985901, -0.09875783324241638, -0.04256138950586319, 0.07020296156406403, -0.05489325150847435, -0.01944880187511444, 0.07552044093608856, 0.047517843544483185, 0.03384408354759216, 0.004145474173128605, -0.025062624365091324, -0.06435517966747284, 0.04119962826371193, 0.07922881096601486, -0.04881284758448601, 0.007914595305919647, -0.03865944966673851, -0.04106414318084717, -0.08387498557567596, -0.05128958076238632, 0.0024474256206303835, 0.043437980115413666, -0.050723087042570114, -0.03260895609855652, 0.06456579267978668, -0.09843195974826813, -0.07567381113767624, 0.023383403196930885, 0.026162998750805855, -0.08551030606031418, 0.045749690383672714, 0.06391981244087219, 0.013504298403859138, -0.017236832529306412, -0.008855132386088371, -0.05544036626815796, -0.015337313525378704, -0.0344688706099987, -0.030319074168801308, 0.00613459013402462, -0.028984343633055687, 0.010281848721206188, -0.02642185427248478, 0.049431104212999344, -0.10454168915748596, 0.09309692680835724, 0.03172609955072403, 0.020547349005937576, -0.08614114671945572, -0.10559816658496857, 0.015524563379585743, 0.03294189274311066, -0.038453031331300735, 0.04429490491747856, -0.07133378833532333, -0.12804894149303436, 0.08588818460702896, 0.08134342730045319, -0.03281096741557121, -0.0168108269572258, -0.09502296149730682, -0.05591973662376404, 0.017721176147460938, 0.009183891117572784, -0.03382077440619469, -0.02257770486176014, -0.11161898076534271, 0.02450890652835369, -1.0449351320123331e-32, 0.0928005576133728, -0.022896889597177505, 0.006969981826841831, 0.006827416829764843, -0.003942177165299654, -0.021082177758216858, -0.023062007501721382, 0.030142154544591904, -0.05215951055288315, 0.03188240900635719, 0.07923156768083572, -0.011118002235889435, 0.053391020745038986, -0.010817601345479488, -0.09649486839771271, 0.14591893553733826, -0.04320725426077843, -0.11915889382362366, -0.10926564037799835, -0.058528829365968704, -0.009054717607796192, 0.03016609139740467, -0.01013344805687666, 0.06833501905202866, -0.10207685083150864, -0.04407048597931862, 0.007168611045926809, -0.014858354814350605, -0.0883849486708641, 0.0009692917810752988, -0.0748986154794693, 0.054973434656858444, -0.0488625168800354, 0.01749681681394577, 0.02881481684744358, -0.031750962138175964, 0.02903464064002037, 0.033911168575286865, -0.04036969318985939, 0.1052120104432106, 0.07304321974515915, -0.008865599520504475, -0.08675123751163483, 0.034422390162944794, -0.04213200882077217, -0.02825876697897911, 0.019811520352959633, -0.00041660881834104657, 0.1042376160621643, -0.06061985716223717, -0.016371725127100945, -0.062056347727775574, -0.07002181559801102, -0.05647299066185951, -0.026018276810646057, 0.005015558563172817, -0.07518760114908218, -0.06037043407559395, -0.06322319060564041, 0.052780382335186005, 0.05060528963804245, -0.05504823848605156, -0.027400100603699684, -0.0035111072938889265, 0.06161675602197647, -0.12891142070293427, -0.014992712996900082, -0.0012248182902112603, 0.022222768515348434, -0.03836486488580704, 0.009753464721143246, -0.009415848180651665, 0.07900769263505936, -0.007210945710539818, 0.06575842201709747, -0.035061657428741455, 0.035625558346509933, -0.03263553977012634, 0.03909993916749954, -0.0076951454393565655, -0.025732332840561867, -0.002285170601680875, -0.011032627895474434, 0.006501268595457077, 0.01874372735619545, -0.06489048153162003, -0.04885789006948471, 0.07011067867279053, -0.09656824171543121, 0.007396311964839697, -0.04162251576781273, -0.02934514917433262, -0.038692232221364975, 0.0006168860709294677, 0.05242761969566345, -6.960085130458538e-8, -0.07103981077671051, 0.031677380204200745, -0.04352260008454323, -0.0902939960360527, 0.036676641553640366, 0.01336729433387518, 0.0518413744866848, -0.005432202946394682, -0.09079263359308243, -0.10606929659843445, -0.024376869201660156, 0.07432030886411667, -0.0024493990931659937, 0.0425633005797863, -0.006399143952876329, -0.08158645033836365, -0.018540071323513985, -0.034156884998083115, -0.02760886773467064, -0.0529240220785141, 0.02377781644463539, 0.04537557438015938, 0.008049589581787586, 0.04453505948185921, 0.01957852579653263, 0.034153301268815994, 0.01442110538482666, 0.036336034536361694, 0.021123284474015236, 0.011696758680045605, -0.03337154909968376, 0.049383457750082016, -0.026120668277144432, 0.00942305289208889, -0.006676124408841133, 0.05602819472551346, 0.056436121463775635, -0.05881856754422188, -0.03882845863699913, -0.004504706710577011, 0.03901131823658943, 0.03357398137450218, -0.06384892761707306, 0.04030652344226837, -0.06863299012184143, 0.07502026855945587, -0.05861562117934227, -0.010143150575459003, 0.0035467378329485655, -0.04858025908470154, 0.01365379523485899, -0.07136759161949158, -0.01614660769701004, 0.0341472290456295, -0.039630305022001266, -0.04012127220630646, 0.04269836097955704, -0.0020297509618103504, 0.030217519029974937, -0.03673350811004639, 0.047954585403203964, -0.04304316267371178, 0.07864535599946976, -0.01348681841045618 ]
0.060854
[[search-request-body]] == Request Body Search The search request can be executed with a search DSL, which includes the <>, within its body. Here is an example: [source,js] -------------------------------------------------- GET /twitter/\_search { "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] And here is a sample response: [source,js] -------------------------------------------------- { "took": 1, "timed\_out": false, "\_shards":{ "total" : 1, "successful" : 1, "skipped" : 0, "failed" : 0 }, "hits":{ "total" : 1, "max\_score": 1.3862944, "hits" : [ { "\_index" : "twitter", "\_type" : "\_doc", "\_id" : "0", "\_score": 1.3862944, "\_source" : { "user" : "kimchy", "message": "trying out Elasticsearch", "date" : "2009-11-15T14:12:12", "likes" : 0 } } ] } } -------------------------------------------------- // TESTRESPONSE[s/"took": 1/"took": $body.took/] [float] === Parameters [horizontal] `timeout`:: A search timeout, bounding the search request to be executed within the specified time value and bail with the hits accumulated up to that point when expired. Defaults to no timeout. See <>. `from`:: To retrieve hits from a certain offset. Defaults to `0`. `size`:: The number of hits to return. Defaults to `10`. If you do not care about getting some hits back but only about the number of matches and/or aggregations, setting the value to `0` will help performance. `search\_type`:: The type of the search operation to perform. Can be `dfs\_query\_then\_fetch` or `query\_then\_fetch`. Defaults to `query\_then\_fetch`. See <> for more. `request\_cache`:: Set to `true` or `false` to enable or disable the caching of search results for requests where `size` is 0, ie aggregations and suggestions (no top hits returned). See <>. `terminate\_after`:: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. If set, the response will have a boolean field `terminated\_early` to indicate whether the query execution has actually terminated\_early. Defaults to no terminate\_after. `batched\_reduce\_size`:: The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. Out of the above, the `search\_type` and the `request\_cache` must be passed as query-string parameters. The rest of the search request should be passed within the body itself. The body content can also be passed as a REST parameter named `source`. Both HTTP GET and HTTP POST can be used to execute search with body. Since not all clients support GET with body, POST is allowed as well. [float] === Fast check for any matching docs In case we only want to know if there are any documents matching a specific query, we can set the `size` to `0` to indicate that we are not interested in the search results. Also we can set `terminate\_after` to `1` to indicate that the query execution can be terminated whenever the first matching document was found (per shard). [source,js] -------------------------------------------------- GET /\_search?q=message:elasticsearch&size=0&terminate\_after=1 -------------------------------------------------- // CONSOLE // TEST[setup:twitter] The response will not contain any hits as the `size` was set to `0`. The `hits.total` will be either equal to `0`, indicating that there were no matching documents, or greater than `0` meaning that there were at least as many documents matching the query when it was early terminated. Also if the query was terminated early, the `terminated\_early` flag will be set to `true` in the response. [source,js] -------------------------------------------------- { "took": 3, "timed\_out": false, "terminated\_early": true, "\_shards": { "total": 1, "successful": 1, "skipped" : 0, "failed": 0 }, "hits": { "total": 1, "max\_score": 0.0, "hits": [] } } -------------------------------------------------- // TESTRESPONSE[s/"took": 3/"took": $body.took/] The `took` time in
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request-body.asciidoc
6.2
elasticsearch-6-2
[ -0.0653342753648758, 0.09545797109603882, -0.024025022983551025, 0.052944593131542206, 0.010300260968506336, -0.0647454634308815, 0.0029423933010548353, -0.004168674349784851, 0.052596744149923325, -0.06987268477678299, -0.02373773790895939, -0.010109508410096169, 0.030478080734610558, -0.07588662207126617, 0.054200369864702225, -0.014436976984143257, -0.0030568367801606655, -0.03059987723827362, 0.003384103998541832, -0.08331913501024246, 0.038327623158693314, 0.04043895751237869, 0.018166381865739822, -0.021960031241178513, -0.048794616013765335, -0.011112060397863388, -0.06417596340179443, -0.09094321727752686, 0.06930830329656601, 0.06437329947948456, 0.024294696748256683, -0.011363220401108265, -0.04577680304646492, 0.07113095372915268, -0.05534462258219719, 0.03616749867796898, -0.09375786036252975, -0.024570200592279434, -0.0006031618686392903, -0.012160862796008587, 0.0074398098513484, -0.031646836549043655, -0.0803067684173584, -0.03046220913529396, -0.0014590173959732056, -0.07604581862688065, -0.05777550861239433, -0.017688976600766182, -0.05807043984532356, -0.021307745948433876, -0.10552642494440079, -0.039926886558532715, -0.02496427297592163, 0.027205711230635643, -0.0014537042006850243, 0.005288261920213699, -0.06776738166809082, -0.04193125292658806, 0.05011768266558647, -0.03608553484082222, 0.019744427874684334, -0.07191885262727737, 0.028089342638850212, 0.007948750630021095, 0.03999883681535721, -0.016575604677200317, -0.04194911569356918, 0.04053563252091408, 0.021714119240641594, -0.019323844462633133, 0.01948673091828823, -0.03139052912592888, -0.045386217534542084, -0.004434825852513313, 0.05316442623734474, -0.004182809963822365, 0.0038608801551163197, -0.031191397458314896, -0.04000050574541092, 0.06006429344415665, -0.021893950179219246, -0.09997731447219849, -0.04243617504835129, 0.045816194266080856, -0.003561577061191201, 0.0816558226943016, -0.01953829638659954, -0.07745734602212906, 0.026672067120671272, -0.06993430852890015, -0.026599111035466194, -0.03787080943584442, -0.01650378480553627, -0.010689886286854744, -0.02464701421558857, 0.034034810960292816, -0.004954122472554445, -0.05839671939611435, 0.030607858672738075, 0.04049953073263168, 0.000773772073443979, -0.02434787154197693, 0.036051779985427856, -0.013742966577410698, -0.07051464915275574, -0.01519181951880455, 0.01521664671599865, 0.05261453986167908, 0.07995497435331345, 0.003366130869835615, -0.054948002099990845, 0.07220131158828735, -0.01977859064936638, -0.021123364567756653, -0.038813862949609756, -0.09677954018115997, 0.049778785556554794, -0.028694486245512962, 0.07195539027452469, 0.07045724987983704, 0.11613796651363373, 0.038202691823244095, -0.07031317055225372, -0.04372311383485794, 0.059099096804857254, 0.007571961265057325, 0.05329803749918938, -4.0336419971260395e-35, 0.08409038186073303, -0.015880810096859932, 0.02982489950954914, -0.0017218163702636957, 0.009785395115613937, 0.041200894862413406, 0.029408805072307587, 0.04198828712105751, -0.07855946570634842, 0.02523621916770935, -0.04982784390449524, -0.014713439159095287, -0.009751084260642529, -0.01671234704554081, -0.045666616410017014, -0.018648235127329826, -0.010071859695017338, 0.015382939949631691, 0.022673185914754868, 0.029785839840769768, -0.02702544815838337, 0.007272107992321253, -0.010725470259785652, 0.014379570260643959, -0.010622799396514893, -0.017257658764719963, -0.012331745587289333, -0.028268421068787575, -0.1172773614525795, 0.0000023759166651871055, -0.03100973181426525, 0.004782575182616711, -0.06245867908000946, 0.058580849319696426, 0.08734551817178726, 0.00871420931071043, 0.012980050407350063, 0.08428098261356354, -0.09763124585151672, -0.030717747285962105, -0.010824762284755707, -0.02160060778260231, -0.009797430597245693, -0.10681129992008209, -0.07542583346366882, -0.06499701738357544, -0.08449736982584, -0.03821844235062599, 0.011870477348566055, 0.0289195254445076, -0.02466673031449318, 0.08545506745576859, -0.017285862937569618, -0.03813717141747475, 0.077800452709198, 0.025275856256484985, -0.03925293684005737, 0.07573437690734863, 0.0417722687125206, 0.04361722990870476, 0.017908887937664986, 0.002802252769470215, 0.060317352414131165, -0.015329018235206604, 0.0481480173766613, 0.005751253571361303, -0.027764596045017242, -0.02086701989173889, -0.0006317208171822131, 0.021361898630857468, 0.03798401728272438, -0.00971075426787138, 0.06882742047309875, -0.007579587399959564, 0.022478049620985985, -0.0822419673204422, -0.11621961742639542, 0.03729795664548874, 0.05168679729104042, 0.0010928669944405556, 0.06865273416042328, -0.09661050885915756, -0.03450639918446541, 0.06586511433124542, 0.03508255258202553, 0.043617840856313705, -0.02501535229384899, -0.16288991272449493, -0.046149641275405884, 0.00700325658544898, -0.08709369599819183, -0.009741555899381638, -0.11976683884859085, -0.09984021633863449, -0.02614879608154297, -5.0352388679549e-33, 0.07039882987737656, -0.08031760901212692, 0.010821674019098282, 0.03483010455965996, 0.021205801516771317, -0.043081749230623245, 0.034235142171382904, -0.033754754811525345, 0.02417927235364914, 0.09742014855146408, 0.06332873553037643, 0.028075864538550377, -0.06295481324195862, -0.031786978244781494, -0.006905011832714081, 0.11520357429981232, -0.0025310523342341185, -0.0771307423710823, -0.054844725877046585, -0.010117973200976849, -0.03815542906522751, 0.029515858739614487, -0.061851419508457184, 0.05050702765583992, -0.07812383025884628, -0.05095314607024193, 0.06729830056428909, 0.06964491307735443, -0.06718240678310394, -0.04508312791585922, -0.07163647562265396, 0.018237663432955742, -0.047879815101623535, 0.03279230371117592, -0.04483398422598839, 0.001316620851866901, 0.03953991085290909, 0.09006868302822113, 0.03948276489973068, 0.06923763453960419, 0.10534490644931793, -0.008030949160456657, 0.02416318468749523, 0.04830104112625122, -0.010786415077745914, -0.037609778344631195, -0.06425875425338745, 0.034665338695049286, 0.007977684028446674, -0.005468379706144333, 0.054325368255376816, 0.015175745822489262, -0.03366997838020325, 0.008717893622815609, -0.03246492147445679, -0.08528647571802139, 0.008403204381465912, -0.02077662944793701, -0.04524780437350273, -0.014396312646567822, 0.0012402881402522326, -0.032047245651483536, -0.02016359753906727, 0.018342526629567146, 0.04198073223233223, -0.11598663032054901, -0.0003863935125991702, -0.032449353486299515, 0.023899603635072708, -0.06829105317592621, 0.022133536636829376, -0.048745639622211456, 0.1275015026330948, 0.015518153086304665, 0.13336683809757233, -0.0582200288772583, 0.03309137746691704, -0.013442312367260456, 0.06312327086925507, -0.006094621494412422, -0.05561413988471031, -0.009057791903614998, 0.012253375723958015, 0.048292919993400574, -0.025023503229022026, -0.0007478632614947855, -0.07645896077156067, 0.1458282619714737, -0.05375514179468155, -0.09588290750980377, 0.04724457859992981, -0.0016348764766007662, -0.02975856512784958, 0.03164311870932579, 0.06654335558414459, -5.698252891761513e-8, -0.0744994729757309, -0.045357704162597656, -0.0795058086514473, 0.04041160270571709, -0.020089782774448395, 0.13748039305210114, 0.027345236390829086, -0.0018086109776049852, -0.0489175021648407, -0.0548328161239624, 0.011944200843572617, 0.07899127155542374, 0.029334766790270805, 0.03213736042380333, -0.05562055855989456, -0.04140518605709076, -0.08837291598320007, -0.060943327844142914, -0.01973394863307476, -0.03262041136622429, -0.001771834446117282, 0.022014480084180832, 0.029563143849372864, -0.005796120967715979, 0.08901743590831757, 0.03490152955055237, -0.07734628766775131, 0.03643551096320152, -0.02788318321108818, 0.008144923485815525, -0.008057915605604649, 0.0373244471848011, -0.06932070106267929, -0.019932443276047707, 0.019374201074242592, -0.018913505598902702, 0.025018462911248207, -0.01742120273411274, -0.07833082973957062, 0.006379373371601105, 0.07360630482435226, 0.03232898190617561, -0.03717370703816414, 0.024672795087099075, -0.040541261434555054, 0.0344977006316185, 0.010393130593001842, -0.013339314609766006, 0.10717660933732986, -0.07392016798257828, 0.029046962037682533, -0.07413539290428162, -0.04836881905794144, 0.038596976548433304, -0.03766033425927162, -0.07819266617298126, 0.0653662234544754, -0.02163778990507126, 0.0052591185085475445, -0.008566471748054028, 0.1346188336610794, 0.003414439270272851, -0.013149688951671124, 0.044361479580402374 ]
0.036765
`terminated\_early` flag will be set to `true` in the response. [source,js] -------------------------------------------------- { "took": 3, "timed\_out": false, "terminated\_early": true, "\_shards": { "total": 1, "successful": 1, "skipped" : 0, "failed": 0 }, "hits": { "total": 1, "max\_score": 0.0, "hits": [] } } -------------------------------------------------- // TESTRESPONSE[s/"took": 3/"took": $body.took/] The `took` time in the response contains the milliseconds that this request took for processing, beginning quickly after the node received the query, up until all search related work is done and before the above JSON is returned to the client. This means it includes the time spent waiting in thread pools, executing a distributed search across the whole cluster and gathering all the results. include::request/query.asciidoc[] include::request/from-size.asciidoc[] include::request/sort.asciidoc[] include::request/source-filtering.asciidoc[] include::request/stored-fields.asciidoc[] include::request/script-fields.asciidoc[] include::request/docvalue-fields.asciidoc[] include::request/post-filter.asciidoc[] include::request/highlighting.asciidoc[] include::request/rescore.asciidoc[] include::request/search-type.asciidoc[] include::request/scroll.asciidoc[] include::request/preference.asciidoc[] include::request/explain.asciidoc[] include::request/version.asciidoc[] include::request/index-boost.asciidoc[] include::request/min-score.asciidoc[] include::request/named-queries-and-filters.asciidoc[] include::request/inner-hits.asciidoc[] include::request/collapse.asciidoc[] include::request/search-after.asciidoc[]
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request-body.asciidoc
6.2
elasticsearch-6-2
[ 0.009675096720457077, 0.07173731178045273, 0.008027383126318455, 0.061870213598012924, 0.05466241016983986, -0.09566450864076614, -0.04151954874396324, -0.016937479376792908, 0.11110756546258926, 0.01601705700159073, -0.003065418219193816, -0.04053319990634918, -0.04503001645207405, -0.014153538271784782, -0.013359783217310905, -0.06967400759458542, 0.012919489294290543, -0.08937420696020126, -0.06717570126056671, -0.03091839700937271, 0.05127489194273949, -0.004915459547191858, 0.0025224441196769476, -0.037634167820215225, -0.014788998290896416, -0.0029148824978619814, -0.08499075472354889, -0.0375441238284111, 0.0016924431547522545, 0.01199556328356266, 0.014112686738371849, -0.02869020402431488, -0.04009503498673439, 0.03168129920959473, -0.01131744310259819, 0.06415121257305145, 0.030229778960347176, -0.07542490214109421, -0.024998128414154053, -0.002566615119576454, 0.014520875178277493, -0.025983333587646484, -0.04986223205924034, -0.005079761613160372, 0.03911497816443443, -0.05005091801285744, -0.08087006956338882, -0.026995116844773293, -0.0709768757224083, 0.018568797037005424, -0.06129417568445206, -0.020059576258063316, -0.006234070286154747, -0.005007235798984766, 0.011564033105969429, 0.051515836268663406, -0.028662772849202156, 0.025111403316259384, -0.04576301574707031, -0.08290771394968033, -0.012599337846040726, -0.11273223161697388, -0.03605338931083679, -0.045415736734867096, 0.06925316154956818, -0.021960651502013206, 0.03405741974711418, -0.05826450511813164, 0.012536240741610527, 0.07169046998023987, 0.02163873054087162, 0.0056356280110776424, -0.08127690851688385, 0.003952465485781431, 0.002005675109103322, 0.028628922998905182, -0.00200891331769526, -0.00029066577553749084, -0.013307739049196243, -0.054513391107320786, -0.0486346036195755, -0.11424367874860764, -0.04859975352883339, 0.027711981907486916, -0.024865586310625076, 0.008542369119822979, 0.022396543994545937, 0.08926667273044586, 0.014403562061488628, -0.03262346237897873, -0.027478497475385666, 0.005858288146555424, 0.009661522693932056, 0.0210274625569582, 0.0539122074842453, 0.05635153129696846, -0.0190512016415596, 0.04851900413632393, 0.05308812856674194, 0.028733866289258003, 0.013623200356960297, 0.04050809144973755, -0.045964453369379044, -0.057156551629304886, 0.03855406492948532, -0.03915726765990257, -0.02256733737885952, 0.06778378784656525, -0.08126063644886017, 0.06245875731110573, 0.04829338192939758, 0.045301441103219986, 0.05230046063661575, -0.000459899049019441, 0.05580584332346916, 0.07445883005857468, 0.04398937523365021, -0.006768627092242241, 0.027560941874980927, 0.014334889128804207, 0.16162677109241486, 0.06277979165315628, -0.0027232645079493523, -0.04782019183039665, 0.005556130316108465, 0.002700838027521968, 0.05772959440946579, -2.4136377750976027e-33, 0.01127735897898674, -0.04565012454986572, 0.02294614166021347, -0.06727372109889984, 0.0002971446083392948, 0.03526484966278076, 0.002587768482044339, 0.0781242772936821, 0.009279285557568073, 0.002793894149363041, -0.11889509111642838, -0.026837676763534546, 0.006913203280419111, -0.09043359756469727, -0.021417556330561638, -0.014756586402654648, 0.0631328895688057, 0.039723534137010574, -0.000991163426078856, 0.038090065121650696, 0.07800988107919693, -0.10794736444950104, -0.0275346077978611, 0.035617683082818985, 0.00947898905724287, -0.040785323828458786, -0.05199936032295227, -0.03698376193642616, -0.1127958744764328, -0.029182687401771545, -0.02434571087360382, -0.010601861402392387, -0.05929145589470863, 0.012121874839067459, 0.07976356148719788, -0.036215007305145264, 0.03896119445562363, 0.03705110400915146, -0.05382375419139862, -0.028142470866441727, -0.028057711198925972, 0.02433372288942337, -0.044892095029354095, -0.016881907358765602, -0.12215293943881989, -0.0852816179394722, -0.06242681294679642, -0.02956479787826538, -0.000826796458568424, 0.06426206231117249, 0.02240927144885063, 0.02242276631295681, 0.09017740935087204, -0.045784108340740204, -0.008400704711675644, 0.04860152304172516, 0.07336683571338654, 0.03951529413461685, -0.021813057363033295, 0.0403716042637825, 0.1024705022573471, -0.0433296337723732, 0.010538813658058643, -0.0007336576818488538, 0.034762803465127945, 0.054455723613500595, -0.0072968448512256145, 0.06148194521665573, 0.0321953110396862, 0.05113290250301361, -0.011685718782246113, 0.03986813500523567, -0.011547165922820568, -0.007241156883537769, 0.01830127090215683, -0.10622972249984741, 0.006685141008347273, 0.01901836507022381, 0.0011981611605733633, -0.02272421307861805, 0.08680769801139832, -0.0853799358010292, -0.10263504087924957, -0.029751602560281754, -0.06490794569253922, 0.10057778656482697, 0.021617865189909935, -0.09748048335313797, -0.0859416201710701, -0.09683338552713394, -0.07687360793352127, -0.014979757368564606, -0.05019475519657135, -0.07010553777217865, -0.04170737415552139, 3.761316747636164e-35, 0.05459641292691231, -0.04638410732150078, 0.02374490723013878, 0.078116275370121, 0.10205729305744171, -0.028354180976748466, 0.0774502158164978, 0.055640190839767456, 0.04260942339897156, 0.06773918867111206, 0.06483631581068039, -0.08849064260721207, -0.0186554454267025, -0.03125626593828201, -0.051241256296634674, 0.04686056077480316, 0.07148504257202148, -0.15865367650985718, 0.05329786613583565, -0.009965437464416027, 0.010566415265202522, 0.048397161066532135, 0.0013326092157512903, 0.0016845293575897813, -0.07385246455669403, -0.013094394467771053, 0.03935738652944565, -0.09437354654073715, -0.06527482718229294, -0.04998822882771492, -0.021341372281312943, -0.005689631216228008, -0.01242566853761673, 0.029901955276727676, -0.02345585636794567, -0.023101218044757843, 0.021388163790106773, 0.09125590324401855, -0.016933204606175423, 0.0824509784579277, 0.04990684986114502, 0.03540778532624245, -0.1057312935590744, 0.0531172938644886, -0.005221914034336805, 0.05395238846540451, 0.0432516373693943, 0.03274797648191452, -0.01975109986960888, 0.015511644072830677, 0.015256994403898716, 0.01160302571952343, -0.0004063874075654894, 0.15872204303741455, 0.03613845631480217, -0.05161239206790924, -0.02878192625939846, -0.12236867100000381, -0.02521517686545849, 0.03453096002340317, -0.06821662932634354, 0.028235461562871933, 0.00947733223438263, -0.011578336358070374, 0.10118543356657028, -0.003686850890517235, -0.005817753728479147, -0.09327740222215652, -0.002784413518384099, -0.010447239503264427, 0.0002746054087765515, 0.03897529095411301, 0.02804202027618885, 0.016889778897166252, 0.033825263381004333, -0.03188920393586159, -0.09576748311519623, 0.014441638253629208, 0.03761656954884529, 0.04781398922204971, -0.06109321862459183, 0.010711890645325184, 0.0072408984415233135, 0.06948167085647583, -0.007884807884693146, -0.013226279057562351, -0.0017835143953561783, 0.06058766320347786, -0.022608187049627304, -0.016809871420264244, 0.024385394528508186, 0.036852773278951645, -0.005703892093151808, 0.04448045417666435, 0.023407379165291786, -5.1418382440715504e-8, -0.008051382377743721, -0.026345085352659225, -0.04451043903827667, 0.06971359997987747, 0.011800462380051613, 0.060239411890506744, 0.016437429934740067, 0.0223471000790596, -0.03249482810497284, -0.06911046802997589, 0.033332377672195435, 0.035428598523139954, -0.01888943463563919, -0.031990304589271545, -0.03480298072099686, -0.05683410167694092, 0.007122287526726723, -0.009044806472957134, -0.021592609584331512, -0.08117032051086426, 0.02636140026152134, 0.018743271008133888, 0.00004991497553419322, -0.07882045209407806, 0.020967617630958557, 0.054610952734947205, -0.0034485815558582544, 0.04905715212225914, -0.0038069228176027536, -0.08535177260637283, -0.026435114443302155, -0.01969759725034237, 0.03398479148745537, -0.04874053969979286, -0.03947540000081062, 0.04045756161212921, -0.03335918113589287, 0.05398624390363693, 0.008304392918944359, 0.09889812022447586, -0.01286441832780838, 0.07241399586200714, -0.07105040550231934, 0.04328558221459389, 0.01346010621637106, -0.04731470346450806, -0.07664851099252701, 0.061928894370794296, 0.05450611561536789, -0.046430110931396484, 0.07811344414949417, -0.0568447969853878, -0.02276805229485035, 0.006233393680304289, -0.00919494591653347, 0.02692856267094612, 0.07081078737974167, -0.09449014812707901, -0.026223760098218918, 0.03438267111778259, 0.16358855366706848, -0.04585348442196846, -0.04337828606367111, 0.020928602665662766 ]
0.029022
[[search-suggesters]] == Suggesters The suggest feature suggests similar looking terms based on a provided text by using a suggester. Parts of the suggest feature are still under development. The suggest request part is defined alongside the query part in a `\_search` request. NOTE: `\_suggest` endpoint has been deprecated in favour of using suggest via `\_search` endpoint. In 5.0, the `\_search` endpoint has been optimized for suggest only search requests. [source,js] -------------------------------------------------- POST twitter/\_search { "query" : { "match": { "message": "tring out Elasticsearch" } }, "suggest" : { "my-suggestion" : { "text" : "trying out Elasticsearch", "term" : { "field" : "message" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] Several suggestions can be specified per request. Each suggestion is identified with an arbitrary name. In the example below two suggestions are requested. Both `my-suggest-1` and `my-suggest-2` suggestions use the `term` suggester, but have a different `text`. [source,js] -------------------------------------------------- POST \_search { "suggest": { "my-suggest-1" : { "text" : "tring out Elasticsearch", "term" : { "field" : "message" } }, "my-suggest-2" : { "text" : "kmichy", "term" : { "field" : "user" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] The below suggest response example includes the suggestion response for `my-suggest-1` and `my-suggest-2`. Each suggestion part contains entries. Each entry is effectively a token from the suggest text and contains the suggestion entry text, the original start offset and length in the suggest text and if found an arbitrary number of options. [source,js] -------------------------------------------------- { "\_shards": ... "hits": ... "took": 2, "timed\_out": false, "suggest": { "my-suggest-1": [ { "text": "tring", "offset": 0, "length": 5, "options": [ {"text": "trying", "score": 0.8, "freq": 1 } ] }, { "text": "out", "offset": 6, "length": 3, "options": [] }, { "text": "elasticsearch", "offset": 10, "length": 13, "options": [] } ], "my-suggest-2": ... } } -------------------------------------------------- // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": "$body.\_shards",/] // TESTRESPONSE[s/"hits": .../"hits": "$body.hits",/] // TESTRESPONSE[s/"took": 2,/"took": "$body.took",/] // TESTRESPONSE[s/"my-suggest-2": \.\.\./"my-suggest-2": "$body.suggest.my-suggest-2"/] Each options array contains an option object that includes the suggested text, its document frequency and score compared to the suggest entry text. The meaning of the score depends on the used suggester. The term suggester's score is based on the edit distance. [float] [[global-suggest]] === Global suggest text To avoid repetition of the suggest text, it is possible to define a global text. In the example below the suggest text is defined globally and applies to the `my-suggest-1` and `my-suggest-2` suggestions. [source,js] -------------------------------------------------- POST \_search { "suggest": { "text" : "tring out Elasticsearch", "my-suggest-1" : { "term" : { "field" : "message" } }, "my-suggest-2" : { "term" : { "field" : "user" } } } } -------------------------------------------------- // CONSOLE The suggest text can in the above example also be specified as suggestion specific option. The suggest text specified on suggestion level override the suggest text on the global level. include::suggesters/term-suggest.asciidoc[] include::suggesters/phrase-suggest.asciidoc[] include::suggesters/completion-suggest.asciidoc[] include::suggesters/context-suggest.asciidoc[] include::suggesters/misc.asciidoc[]
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters.asciidoc
6.2
elasticsearch-6-2
[ -0.07135817408561707, 0.058578863739967346, 0.06693276017904282, 0.03319800645112991, 0.07554058730602264, -0.0016427449882030487, 0.031381864100694656, 0.04911404475569725, 0.05745422840118408, -0.04180537536740303, -0.025410812348127365, -0.041676685214042664, 0.019523657858371735, 0.021438872441649437, 0.07729670405387878, 0.03369217365980148, -0.018797697499394417, -0.08793598413467407, 0.01844760589301586, -0.06413956731557846, 0.08969353884458542, 0.11679564416408539, 0.043233130127191544, -0.03535933792591095, 0.005420646630227566, -0.018060913309454918, -0.06495874375104904, 0.006909750867635012, 0.007350125815719366, 0.10220284014940262, -0.003605474019423127, 0.04599699378013611, -0.064926378428936, 0.0711478665471077, -0.1257677674293518, 0.006806159391999245, -0.12453403323888779, -0.015466016717255116, 0.020456939935684204, 0.019807640463113785, -0.011798269115388393, 0.044670164585113525, -0.08491739630699158, -0.04795852676033974, -0.017671292647719383, -0.046950701624155045, 0.016143472865223885, -0.023893140256404877, -0.08501360565423965, 0.029855724424123764, -0.09453947842121124, -0.06394898146390915, -0.02192806638777256, -0.021034806966781616, 0.007365293800830841, -0.011835599318146706, -0.10505463182926178, -0.006066263187676668, 0.05258985608816147, -0.05587087199091911, 0.06937132030725479, -0.09961292892694473, 0.0061118826270103455, -0.05625857412815094, 0.0016377882566303015, -0.0457429476082325, 0.04359957203269005, 0.028067724779248238, 0.05706801638007164, -0.02771339938044548, 0.066830575466156, -0.0064183068461716175, -0.049349457025527954, -0.05488920956850052, 0.0540095716714859, 0.023115606978535652, -0.004791491664946079, -0.02687828429043293, -0.025628676638007164, 0.044089384377002716, -0.0963008850812912, -0.06820373237133026, -0.008178092539310455, 0.0310693196952343, -0.03360796347260475, 0.02240978181362152, -0.014281581155955791, -0.08386526256799698, 0.0705169066786766, -0.04883408546447754, -0.03755992650985718, -0.15657541155815125, -0.06666778773069382, 0.0006032282253727317, 0.00024324486730620265, 0.058308087289333344, -0.11804753541946411, -0.023408714681863785, -0.020302673801779747, -0.012421483173966408, 0.03639503940939903, -0.06297864019870758, 0.07607240974903107, -0.05998171865940094, -0.03981301188468933, 0.0005196452257223427, 0.011838136240839958, 0.05057971552014351, 0.057542067021131516, 0.056700386106967926, -0.06994381546974182, 0.05445385351777077, -0.015926258638501167, 0.021189304068684578, -0.03012072481215, 0.022686049342155457, 0.05717197805643082, -0.08003024756908417, 0.09760388731956482, 0.09784682095050812, 0.12285789102315903, -0.00356439221650362, -0.02620437927544117, -0.052338939160108566, 0.01463393121957779, 0.03811018168926239, -0.018761372193694115, 2.0044632525977344e-33, 0.0650474950671196, 0.041264306753873825, 0.0409395694732666, -0.019449923187494278, -0.02305203676223755, 0.03621416166424751, -0.04037536680698395, 0.1071925163269043, -0.10585113614797592, -0.029918208718299866, -0.05335013568401337, 0.061132218688726425, -0.0035481962841004133, -0.005338927265256643, -0.01084350049495697, -0.054781701415777206, 0.019583798944950104, 0.035569023340940475, 0.03522609546780586, 0.038465261459350586, 0.025150079280138016, 0.07465063035488129, -0.0473429337143898, -0.008689837530255318, -0.018490726128220558, -0.03441166505217552, 0.011309615336358547, -0.03622406721115112, -0.0184558667242527, -0.01788233406841755, -0.08455722779035568, -0.010356921702623367, -0.014381208457052708, 0.00007820245082257316, 0.05774887651205063, 0.0362347736954689, -0.02239460125565529, 0.058952949941158295, -0.08672355115413666, -0.053879961371421814, 0.06445133686065674, 0.0419192872941494, -0.03682342916727066, -0.08879806846380234, -0.0058840918354690075, -0.04334253817796707, -0.042864732444286346, -0.011952551081776619, 0.040135644376277924, 0.0019372807582840323, -0.04597306251525879, 0.04083642363548279, -0.03422245755791664, 0.017486168071627617, 0.07990484684705734, 0.04494849219918251, -0.030102962628006935, 0.10018863528966904, -0.00587517861276865, -0.005315822549164295, -0.008030084893107414, -0.0011717566521838307, 0.0792728066444397, -0.029715631157159805, 0.0558440275490284, 0.009608759544789791, 0.06664802879095078, 0.0707477480173111, 0.020418228581547737, 0.0077525293454527855, -0.008876888081431389, 0.0404864177107811, 0.056063227355480194, -0.0017479503294453025, -0.013154920190572739, -0.11164721846580505, -0.01896676979959011, -0.010293116793036461, 0.056447409093379974, -0.020549895241856575, -0.05314800143241882, -0.12487415224313736, -0.051978081464767456, 0.061315957456827164, -0.028337854892015457, 0.06519144773483276, 0.024589750915765762, -0.07828304171562195, 0.0021746219135820866, -0.04116210341453552, -0.04852532595396042, 0.05054069310426712, -0.09682422876358032, -0.006988326087594032, -0.06668747961521149, -4.3801571720767475e-33, 0.05424780771136284, -0.0908094123005867, 0.006346584763377905, 0.05536320433020592, 0.05048801749944687, -0.05083402618765831, 0.043382588773965836, -0.011379866860806942, 0.037506598979234695, 0.004598291125148535, 0.005885953549295664, -0.08210628479719162, 0.026474012061953545, -0.02189302258193493, -0.023743879050016403, 0.07215780764818192, -0.046662233769893646, -0.029503902420401573, -0.0023941630497574806, -0.013560864143073559, -0.019978560507297516, -0.022503351792693138, -0.05434250831604004, 0.012743249535560608, -0.05649248883128166, -0.01884068176150322, 0.07364863902330399, 0.04111472889780998, -0.06492707133293152, -0.02913288213312626, -0.03825435787439346, -0.008713743649423122, -0.029608426615595818, 0.00477721868082881, -0.04518851637840271, 0.02139904908835888, 0.009287900291383266, 0.08307106047868729, 0.028303662315011024, 0.05867980793118477, 0.08486339449882507, 0.07242301106452942, 0.020118363201618195, 0.044634465128183365, -0.0615205280482769, -0.03689460828900337, 0.019441766664385796, 0.05139945074915886, 0.007440103683620691, -0.04511692374944687, 0.04851232096552849, -0.004517777822911739, -0.11293881386518478, 0.017128411680459976, -0.08177796006202698, -0.02310124598443508, -0.004659600090235472, 0.037869956344366074, -0.03331649675965309, -0.021615002304315567, -0.008691158145666122, -0.0029541985131800175, 0.0033914202358573675, -0.008813527412712574, 0.10846146941184998, -0.1261269748210907, -0.04087675362825394, -0.02669713646173477, 0.048489682376384735, -0.047917794436216354, 0.022512737661600113, -0.05394234508275986, 0.06547757983207703, 0.04200853407382965, 0.11699631810188293, -0.030633745715022087, 0.06690516322851181, -0.06618820875883102, 0.06477862596511841, -0.06263218075037003, 0.01259541790932417, 0.0023824195377528667, -0.010432984679937363, 0.05886455625295639, 0.003450607182458043, -0.01854117587208748, -0.07457008212804794, 0.18806299567222595, -0.05530247464776039, -0.007476321421563625, 0.0392783097922802, -0.05893003195524216, -0.010182153433561325, -0.02559633180499077, -0.021890779957175255, -5.370979394569986e-8, -0.02864273078739643, -0.0037944784853607416, -0.08139663189649582, 0.03524211049079895, 0.007164746522903442, 0.03342190384864807, 0.04155931621789932, 0.04270253702998161, 0.013757440261542797, -0.009583011269569397, -0.009873881004750729, 0.04261569678783417, -0.0850772112607956, 0.004791209939867258, -0.007917934097349644, -0.01634088158607483, -0.04982949420809746, 0.016605235636234283, -0.05336446687579155, -0.02289990708231926, -0.054457925260066986, -0.002095741219818592, -0.03324972465634346, 0.006885800510644913, 0.062036510556936264, 0.07008186727762222, 0.013945797458291054, 0.06217982620000839, 0.02806173823773861, 0.0336577445268631, -0.08597114682197571, -0.006513800472021103, 0.012751416303217411, -0.05960918962955475, 0.04007348790764809, 0.021107180044054985, 0.041010573506355286, -0.019685840234160423, -0.03417211025953293, 0.04983677342534065, 0.04871878772974014, -0.038107823580503464, -0.07273746281862259, 0.016518598422408104, 0.010791981592774391, -0.008213200606405735, 0.03415768966078758, -0.04752330854535103, 0.054814111441373825, -0.04844275861978531, 0.02349727228283882, -0.049424756318330765, -0.010643813759088516, 0.046286534518003464, -0.024690359830856323, 0.0038540649693459272, -0.0030660415068268776, -0.002622073981910944, 0.014635004103183746, -0.014008547179400921, 0.12342307716608047, -0.009855530224740505, 0.0020502861589193344, 0.0798564925789833 ]
0.111765
[[search-field-caps]] == Field Capabilities API The field capabilities API allows to retrieve the capabilities of fields among multiple indices. The field capabilities api by default executes on all indices: [source,js] -------------------------------------------------- GET \_field\_caps?fields=rating -------------------------------------------------- // CONSOLE ... but the request can also be restricted to specific indices: [source,js] -------------------------------------------------- GET twitter/\_field\_caps?fields=rating -------------------------------------------------- // CONSOLE // TEST[setup:twitter] Alternatively the `fields` option can also be defined in the request body: [source,js] -------------------------------------------------- POST \_field\_caps { "fields" : ["rating"] } -------------------------------------------------- // CONSOLE This is equivalent to the previous request. Supported request options: [horizontal] `fields`:: A list of fields to compute stats for. The field name supports wildcard notation. For example, using `text\_\*` will cause all fields that match the expression to be returned. [float] === Field Capabilities The field capabilities api returns the following information per field: [horizontal] `searchable`:: Whether this field is indexed for search on all indices. `aggregatable`:: Whether this field can be aggregated on all indices. `indices`:: The list of indices where this field has the same type, or null if all indices have the same type for the field. `non\_searchable\_indices`:: The list of indices where this field is not searchable, or null if all indices have the same definition for the field. `non\_aggregatable\_indices`:: The list of indices where this field is not aggregatable, or null if all indices have the same definition for the field. [float] === Response format Request: [source,js] -------------------------------------------------- GET \_field\_caps?fields=rating,title -------------------------------------------------- // CONSOLE [source,js] -------------------------------------------------- { "fields": { "rating": { <1> "long": { "searchable": true, "aggregatable": false, "indices": ["index1", "index2"], "non\_aggregatable\_indices": ["index1"] <2> }, "keyword": { "searchable": false, "aggregatable": true, "indices": ["index3", "index4"], "non\_searchable\_indices": ["index4"] <3> } }, "title": { <4> "text": { "searchable": true, "aggregatable": false } } } } -------------------------------------------------- // NOTCONSOLE <1> The field `rating` is defined as a long in `index1` and `index2` and as a `keyword` in `index3` and `index4`. <2> The field `rating` is not aggregatable in `index1`. <3> The field `rating` is not searchable in `index4`. <4> The field `title` is defined as `text` in all indices.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/field-caps.asciidoc
6.2
elasticsearch-6-2
[ 0.004564153030514717, 0.05592598766088486, -0.0764610543847084, 0.06423713266849518, 0.03797278180718422, 0.023674294352531433, 0.04009411111474037, -0.0019355426775291562, 0.014790649525821209, -0.09001082926988602, -0.0065052686259150505, -0.08129078894853592, 0.018994787707924843, 0.023482220247387886, -0.007146637886762619, 0.011138023808598518, -0.023378053680062294, -0.015697166323661804, -0.07886111736297607, -0.10892009735107422, 0.009532037191092968, 0.04482857137918472, -0.025425350293517113, -0.04555723816156387, -0.0032196547836065292, -0.020915955305099487, -0.09698496013879776, -0.026033248752355576, 0.013953001238405704, 0.020554861053824425, -0.03285554423928261, -0.02524595521390438, -0.023804638534784317, 0.03423590585589409, -0.05305762588977814, 0.047891564667224884, -0.060320548713207245, -0.02168501541018486, 0.05524982884526253, -0.011983273550868034, 0.002622923580929637, 0.024010255932807922, -0.06327994167804718, -0.06045785918831825, 0.023558277636766434, -0.07762565463781357, -0.055066898465156555, -0.055671241134405136, -0.0389823317527771, 0.01589769683778286, -0.08689916878938675, 0.031825415790081024, 0.0015132821863517165, -0.010847373865544796, 0.038636401295661926, 0.05613957718014717, -0.15343165397644043, -0.004908248782157898, 0.01984720304608345, 0.015614690259099007, -0.02585991844534874, -0.09075984358787537, -0.014710059389472008, -0.02266079932451248, 0.029268987476825714, -0.038390785455703735, -0.02056746743619442, 0.01231938973069191, -0.04452478140592575, -0.06065770238637924, 0.06595299392938614, 0.0073374113999307156, -0.055709607899188995, -0.03897315636277199, 0.023058459162712097, 0.06356532126665115, -0.034320730715990067, -0.019041094928979874, 0.006862839218229055, 0.03372101113200188, -0.07242003828287125, -0.07128501683473587, -0.01645956002175808, 0.03764332830905914, -0.04671427235007286, -0.04102485626935959, -0.07137768715620041, -0.0237553920596838, 0.054394129663705826, 0.002183921169489622, -0.029660914093255997, -0.06555279344320297, -0.006366915535181761, 0.07964096963405609, 0.011535952799022198, 0.04083551838994026, -0.07535887509584427, -0.07122951000928879, -0.030395198613405228, 0.024520978331565857, -0.04870462417602539, -0.09907697886228561, -0.021744579076766968, -0.02022518962621689, -0.014576733112335205, -0.0067875259555876255, 0.02039681188762188, 0.0470849871635437, -0.06178732588887215, 0.05386055260896683, 0.012204241938889027, 0.14083512127399445, -0.0406256802380085, -0.009485035203397274, 0.01298449095338583, 0.10031000524759293, 0.01650851219892502, -0.020264241844415665, 0.10272502154111862, 0.09207464754581451, 0.08583123236894608, 0.020908301696181297, 0.012292665429413319, -0.047909680753946304, -0.009594288654625416, 0.03362307325005531, 0.008699772879481316, 1.0866945688252949e-33, 0.04445262998342514, 0.00876528024673462, 0.024074533954262733, 0.0009232326992787421, -0.024943623691797256, 0.04081561788916588, 0.05196218937635422, 0.04226933419704437, -0.09337162971496582, -0.01959560252726078, -0.03820564225316048, 0.14656291902065277, -0.04228217527270317, -0.11128583550453186, 0.0729408785700798, -0.0498657152056694, 0.07334229350090027, 0.04114342853426933, 0.057968754321336746, -0.01593567430973053, 0.07899370044469833, 0.027419960126280785, -0.009370927698910236, 0.08458235114812851, 0.022807391360402107, -0.05326726660132408, -0.05353809893131256, -0.030674787238240242, -0.057603247463703156, 0.0423748679459095, 0.014308488927781582, 0.05451522395014763, -0.0012791549088433385, -0.03667601943016052, 0.09417922794818878, 0.03086954914033413, -0.047709397971630096, 0.058162011206150055, -0.03524588420987129, -0.018347807228565216, 0.0208093523979187, 0.01646522618830204, -0.004468036349862814, -0.12317070364952087, -0.11916053295135498, -0.01302653644233942, -0.027120189741253853, 0.004324977286159992, -0.044364094734191895, 0.04505060240626335, -0.04434896633028984, 0.08186619728803635, -0.03120257332921028, -0.0753817930817604, 0.1345982402563095, 0.0015197009779512882, -0.06327402591705322, 0.12341482937335968, 0.03314562141895294, -0.0027824766002595425, 0.005629256367683411, 0.015608278103172779, -0.02622644416987896, -0.0017451515886932611, 0.00011085344158345833, 0.06950987130403519, 0.015586347319185734, 0.02447081170976162, 0.012134320102632046, -0.006559503730386496, 0.015797724947333336, 0.04842064902186394, 0.03400919958949089, -0.001592666027136147, -0.02438022755086422, -0.08577476441860199, -0.006600602995604277, -0.049313824623823166, 0.021323654800653458, -0.058369144797325134, -0.05045054107904434, -0.00032856600591912866, -0.03563037887215614, 0.006576331332325935, 0.03464926779270172, -0.017662910744547844, -0.04624578729271889, -0.012626647017896175, -0.009517434053122997, -0.06463222950696945, -0.06838004291057587, 0.004994729999452829, -0.07592116296291351, -0.12556032836437225, -0.121170774102211, -4.817067483784268e-33, 0.02013321779668331, -0.1396675407886505, -0.0005285910447128117, -0.05261245369911194, 0.04437738656997681, -0.06864336133003235, 0.022008035331964493, -0.04866456612944603, 0.026757672429084778, 0.04653951898217201, 0.019972553476691246, -0.027153920382261276, -0.06005658581852913, -0.04987647011876106, 0.0005699219764210284, 0.05528227612376213, -0.08505546301603317, -0.05827033519744873, 0.04149165004491806, -0.023866519331932068, -0.03288392350077629, 0.06247283145785332, -0.0011612632079049945, 0.12256527692079544, -0.053026359528303146, -0.06459610164165497, -0.047558482736349106, 0.008055736310780048, -0.050933919847011566, -0.010339721105992794, -0.0026959823444485664, -0.06580942124128342, -0.019866961985826492, 0.10431303828954697, -0.061303284019231796, -0.013192472979426384, -0.010955790989100933, 0.006547009106725454, 0.053351663053035736, 0.09363921731710434, 0.044419560581445694, -0.038976892828941345, 0.03224719688296318, 0.043226469308137894, -0.026556771248579025, -0.017638521268963814, 0.07685787975788116, 0.014688074588775635, 0.022667918354272842, -0.05602432042360306, 0.056622885167598724, 0.011805769056081772, 0.005793350748717785, 0.07251658290624619, -0.0755646750330925, -0.079953633248806, 0.034064147621393204, -0.05010078102350235, -0.02676083892583847, -0.023809639737010002, 0.08293077349662781, -0.0665646493434906, -0.061381228268146515, 0.0467759370803833, 0.09521329402923584, -0.08862894028425217, -0.058176007121801376, -0.03221612796187401, -0.04611179977655411, -0.008620268665254116, 0.0446304976940155, -0.10845516622066498, 0.13150639832019806, 0.026404621079564095, 0.006519019138067961, -0.0011228026123717427, 0.0019112012814730406, 0.0023956026416271925, 0.05503449961543083, -0.059152644127607346, -0.013423996977508068, 0.029109347611665726, 0.042238980531692505, 0.0064475093968212605, 0.02878107875585556, -0.010278462432324886, 0.007385967765003443, 0.06842277199029922, 0.013608861714601517, -0.006133080925792456, 0.025435876101255417, -0.031318195164203644, 0.01283080130815506, -0.019811125472187996, 0.037025269120931625, -4.694729582865875e-8, -0.06214984878897667, -0.011759817600250244, -0.12166866660118103, 0.07042386382818222, 0.0056166150607168674, 0.0687907338142395, -0.012178545817732811, 0.008474673144519329, 0.011881332844495773, -0.026010101661086082, 0.02433667704463005, 0.05382389575242996, -0.06317497044801712, -0.006139277946203947, 0.012186519801616669, -0.05888262018561363, -0.049482956528663635, 0.04248717799782753, 0.014036379754543304, 0.03239131718873978, 0.011011543683707714, 0.05183589458465576, 0.02750227600336075, -0.0629354938864708, 0.033413130789995193, -0.015208357013761997, -0.05023002624511719, -0.02650202251970768, 0.043244991451501846, 0.08225954324007034, 0.014601992443203926, -0.026827607303857803, 0.014611626975238323, -0.023613587021827698, 0.021139470860362053, 0.01143206749111414, -0.011598797515034676, -0.03468361124396324, -0.05770737677812576, 0.08336689323186874, 0.08749879896640778, 0.004372206516563892, -0.05216158181428909, 0.03793809562921524, -0.0004825947107747197, 0.006235504522919655, -0.034831658005714417, 0.03673145920038223, 0.142011359333992, 0.006394383497536182, -0.016404928639531136, -0.02826625294983387, -0.037694454193115234, 0.013372659683227539, -0.03918859362602234, -0.020105596631765366, 0.02484160289168358, 0.02667825110256672, 0.04306032136082649, -0.030867472290992737, 0.10512892156839371, -0.04145678132772446, -0.011485251598060131, 0.061936747282743454 ]
0.028538
[[search-shards]] == Search Shards API The search shards api returns the indices and shards that a search request would be executed against. This can give useful feedback for working out issues or planning optimizations with routing and shard preferences. When filtered aliases are used, the filter is returned as part of the `indices` section [5.1.0] Added in 5.1.0. The `index` may be a single value, or comma-separated. [float] === Usage Full example: [source,js] -------------------------------------------------- GET /twitter/\_search\_shards -------------------------------------------------- // CONSOLE // TEST[s/^/PUT twitter\n/] This will yield the following result: [source,js] -------------------------------------------------- { "nodes": ..., "indices" : { "twitter": { } }, "shards": [ [ { "index": "twitter", "node": "JklnKbD7Tyqi9TP3\_Q\_tBg", "primary": true, "shard": 0, "state": "STARTED", "allocation\_id": {"id":"0TvkCyF7TAmM1wHP4a42-A"}, "relocating\_node": null } ], [ { "index": "twitter", "node": "JklnKbD7Tyqi9TP3\_Q\_tBg", "primary": true, "shard": 1, "state": "STARTED", "allocation\_id": {"id":"fMju3hd1QHWmWrIgFnI4Ww"}, "relocating\_node": null } ], [ { "index": "twitter", "node": "JklnKbD7Tyqi9TP3\_Q\_tBg", "primary": true, "shard": 2, "state": "STARTED", "allocation\_id": {"id":"Nwl0wbMBTHCWjEEbGYGapg"}, "relocating\_node": null } ], [ { "index": "twitter", "node": "JklnKbD7Tyqi9TP3\_Q\_tBg", "primary": true, "shard": 3, "state": "STARTED", "allocation\_id": {"id":"bU\_KLGJISbW0RejwnwDPKw"}, "relocating\_node": null } ], [ { "index": "twitter", "node": "JklnKbD7Tyqi9TP3\_Q\_tBg", "primary": true, "shard": 4, "state": "STARTED", "allocation\_id": {"id":"DMs7\_giNSwmdqVukF7UydA"}, "relocating\_node": null } ] ] } -------------------------------------------------- // TESTRESPONSE[s/"nodes": ...,/"nodes": $body.nodes,/] // TESTRESPONSE[s/JklnKbD7Tyqi9TP3\_Q\_tBg/$body.shards.0.0.node/] // TESTRESPONSE[s/0TvkCyF7TAmM1wHP4a42-A/$body.shards.0.0.allocation\_id.id/] // TESTRESPONSE[s/fMju3hd1QHWmWrIgFnI4Ww/$body.shards.1.0.allocation\_id.id/] // TESTRESPONSE[s/Nwl0wbMBTHCWjEEbGYGapg/$body.shards.2.0.allocation\_id.id/] // TESTRESPONSE[s/bU\_KLGJISbW0RejwnwDPKw/$body.shards.3.0.allocation\_id.id/] // TESTRESPONSE[s/DMs7\_giNSwmdqVukF7UydA/$body.shards.4.0.allocation\_id.id/] And specifying the same request, this time with a routing value: [source,js] -------------------------------------------------- GET /twitter/\_search\_shards?routing=foo,baz -------------------------------------------------- // CONSOLE // TEST[s/^/PUT twitter\n/] This will yield the following result: [source,js] -------------------------------------------------- { "nodes": ..., "indices" : { "twitter": { } }, "shards": [ [ { "index": "twitter", "node": "JklnKbD7Tyqi9TP3\_Q\_tBg", "primary": true, "shard": 0, "state": "STARTED", "allocation\_id": {"id":"0TvkCyF7TAmM1wHP4a42-A"}, "relocating\_node": null } ], [ { "index": "twitter", "node": "JklnKbD7Tyqi9TP3\_Q\_tBg", "primary": true, "shard": 1, "state": "STARTED", "allocation\_id": {"id":"fMju3hd1QHWmWrIgFnI4Ww"}, "relocating\_node": null } ] ] } -------------------------------------------------- // TESTRESPONSE[s/"nodes": ...,/"nodes": $body.nodes,/] // TESTRESPONSE[s/JklnKbD7Tyqi9TP3\_Q\_tBg/$body.shards.0.0.node/] // TESTRESPONSE[s/0TvkCyF7TAmM1wHP4a42-A/$body.shards.0.0.allocation\_id.id/] // TESTRESPONSE[s/fMju3hd1QHWmWrIgFnI4Ww/$body.shards.1.0.allocation\_id.id/] This time the search will only be executed against two of the shards, because routing values have been specified. [float] === All parameters: [horizontal] `routing`:: A comma-separated list of routing values to take into account when determining which shards a request would be executed against. `preference`:: Controls a `preference` of which shard replicas to execute the search request on. By default, the operation is randomized between the shard replicas. See the link:search-request-preference.html[preference] documentation for a list of all acceptable values. `local`:: A boolean value whether to read the cluster state locally in order to determine where shards are allocated instead of using the Master node's cluster state.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/search-shards.asciidoc
6.2
elasticsearch-6-2
[ -0.007210283540189266, 0.08004964143037796, 0.04856809601187706, 0.04275219142436981, 0.056050755083560944, -0.03269724175333977, 0.023271627724170685, -0.037352681159973145, 0.09377378970384598, -0.04762939736247063, -0.034884966909885406, -0.028297867625951767, 0.00772048206999898, -0.029234932735562325, -0.020446350798010826, 0.01883666031062603, -0.04095510020852089, -0.04608536511659622, -0.04954488202929497, -0.07316239178180695, 0.09360843151807785, 0.047177303582429886, -0.030254259705543518, -0.007813110947608948, -0.0058067250065505505, -0.02411060780286789, -0.07303040474653244, -0.08052407205104828, 0.06049978733062744, 0.03771759197115898, -0.003400455228984356, 0.010693991556763649, -0.1146906390786171, 0.006628393195569515, -0.09393135458230972, 0.061922695487737656, -0.04921327158808708, -0.007938633672893047, -0.003957055509090424, -0.0019122835947200656, 0.0348934680223465, -0.026797261089086533, -0.07390094548463821, -0.048224076628685, -0.039480309933423996, -0.027927137911319733, -0.02334613725543022, -0.03643499314785004, -0.056101392954587936, 0.04003613442182541, -0.12483948469161987, -0.08908602595329285, -0.06808825582265854, -0.030465420335531235, 0.0311589352786541, 0.011279525235295296, -0.1250634342432022, 0.046422407031059265, 0.07084180414676666, -0.05013241991400719, 0.030382080003619194, -0.09244571626186371, 0.02659037336707115, -0.017154952511191368, 0.0506015345454216, -0.05382092669606209, 0.01843821071088314, -0.002672123722732067, 0.012658054009079933, -0.02639678865671158, -0.01887192390859127, 0.045125383883714676, -0.06268532574176788, -0.03153160586953163, 0.008703617379069328, 0.03599848598241806, -0.0014302546624094248, -0.009616446681320667, 0.01675533689558506, 0.0518307201564312, -0.05888320505619049, -0.11597549915313721, -0.024851704016327858, 0.061485279351472855, -0.005329745355993509, 0.014148155227303505, -0.04273934289813042, -0.053966447710990906, 0.10459715873003006, -0.03263844549655914, -0.02326589822769165, -0.05887283384799957, 0.0281586442142725, -0.02279152162373066, 0.08392650634050369, 0.057055648416280746, -0.06428418308496475, 0.06386502087116241, 0.042738668620586395, 0.03485413268208504, -0.039643190801143646, -0.002022320870310068, -0.023531464859843254, -0.007388079538941383, -0.018908072263002396, -0.0004813949344679713, -0.012903258204460144, 0.060594260692596436, -0.0030006649903953075, 0.040500350296497345, -0.005197290796786547, 0.04823192581534386, 0.0060889036394655704, -0.054572027176618576, 0.009214402176439762, 0.09714573621749878, 0.0650356262922287, -0.07906615734100342, 0.04770374670624733, 0.028285318985581398, 0.048560649156570435, 0.04585234075784683, 0.010205920785665512, 0.02600931003689766, -0.024760384112596512, 0.04654296487569809, -0.040102019906044006, -5.441824823324563e-34, 0.06755620986223221, 0.01359104085713625, 0.03513774648308754, -0.02991800755262375, 0.010228457860648632, 0.020545102655887604, 0.026617731899023056, 0.05077043175697327, -0.08796233683824539, 0.020634904503822327, -0.13005559146404266, 0.057227157056331635, -0.020257364958524704, -0.05933216214179993, -0.011346551589667797, -0.0671955943107605, 0.07210834324359894, 0.07365021854639053, -0.029729066416621208, -0.030436744913458824, 0.05773108825087547, 0.03555430471897125, -0.027631577104330063, -0.022233853116631508, -0.016964690759778023, 0.002576559316366911, -0.05343109741806984, -0.069693922996521, -0.030129563063383102, 0.012495480477809906, -0.026274582371115685, 0.021566197276115417, -0.001686605392023921, 0.00807893555611372, 0.09572318941354752, 0.056269045919179916, -0.030320802703499794, 0.08962272852659225, -0.05833766236901283, -0.06945164501667023, 0.044490184634923935, 0.023109467700123787, 0.024836184456944466, -0.09964466094970703, -0.08015419542789459, -0.02106769010424614, -0.07573128491640091, 0.032746411859989166, 0.011069003492593765, -0.008768066763877869, -0.028839098289608955, 0.07245416939258575, -0.020402537658810616, 0.020505305379629135, 0.03150586038827896, -0.007067577447742224, 0.01585320010781288, 0.052939388900995255, -0.0008258789894171059, 0.056488316506147385, 0.04445341229438782, 0.006439588498324156, 0.03687078505754471, 0.08716665953397751, -0.001936458982527256, 0.03788917139172554, 0.02509506233036518, 0.09582903981208801, 0.04129878431558609, 0.06995903700590134, 0.020451510325074196, 0.0882142186164856, 0.013860613107681274, 0.0194195918738842, -0.012604417279362679, -0.13547161221504211, -0.11162076890468597, -0.05662401765584946, -0.04635104164481163, 0.011319070123136044, -0.040287215262651443, -0.049914389848709106, -0.04681684821844101, -0.01698978617787361, -0.026734484359622, 0.04384016990661621, -0.007150621153414249, -0.07227936387062073, -0.022454895079135895, -0.0897420197725296, -0.04844535514712334, -0.01163642667233944, -0.09687507152557373, -0.10985179990530014, -0.05581637844443321, -3.328847554605096e-33, 0.010626367293298244, -0.063764289021492, -0.003429597709327936, 0.05405503511428833, 0.00437824847176671, -0.055909931659698486, 0.10381750762462616, -0.03990664333105087, 0.06605441123247147, 0.061139822006225586, -0.009660322219133377, 0.013775856234133244, -0.03727894276380539, -0.06161951273679733, -0.0314800888299942, 0.047716788947582245, -0.03344755247235298, -0.13641349971294403, -0.013311742804944515, -0.020252851769328117, -0.10448183864355087, 0.04281127452850342, -0.05524756386876106, 0.07024943828582764, -0.06163860484957695, 0.007601263001561165, 0.06334927678108215, -0.008912363089621067, -0.03392113372683525, 0.013091806322336197, -0.07259709388017654, -0.03824266418814659, -0.037101950496435165, 0.016472656279802322, -0.06858879327774048, -0.007412355858832598, -0.02793513983488083, 0.09047936648130417, 0.07730276882648468, 0.021857265383005142, 0.0285989698022604, -0.04153768718242645, -0.006628238596022129, 0.08933539688587189, -0.005921454168856144, 0.010839142836630344, -0.0005538057303056121, 0.10611003637313843, 0.03430338576436043, -0.08422422409057617, 0.07045488804578781, 0.008919221349060535, -0.009592871181666851, 0.08083339780569077, -0.04834868386387825, -0.01411618385463953, -0.0662991851568222, 0.055671483278274536, -0.0795249491930008, 0.01966911181807518, -0.006456305738538504, -0.035916898399591446, -0.06864681839942932, 0.046354178339242935, 0.012624003924429417, -0.03777632489800453, -0.10202659666538239, -0.031849656254053116, 0.00012924590555485338, -0.0727180689573288, -0.016371283680200577, -0.08950153738260269, 0.08945149928331375, 0.009375681169331074, 0.04100361466407776, -0.08196345716714859, 0.02882872335612774, 0.04816383123397827, 0.08564899861812592, 0.07267564535140991, -0.050153378397226334, 0.11252667754888535, 0.016373928636312485, 0.020234419032931328, 0.03609243035316467, -0.07242974638938904, -0.01606343872845173, 0.10660535097122192, -0.07562447339296341, -0.022709861397743225, -0.011406396515667439, -0.006042237393558025, -0.05031130835413933, -0.0056946673430502415, 0.036882538348436356, -5.2337494338416946e-8, 0.011743062175810337, 0.003109740326181054, -0.06734967976808548, 0.07136357575654984, -0.024766698479652405, 0.04019976407289505, 0.028097521513700485, 0.04149579629302025, -0.07461101561784744, 0.009228401817381382, -0.017113611102104187, 0.030577383935451508, -0.06610078364610672, -0.007800609339028597, -0.015071092173457146, -0.08077284693717957, -0.005008490290492773, 0.03152909502387047, -0.0310901440680027, -0.05724732577800751, -0.0751175731420517, -0.00350589700974524, -0.006416639778763056, -0.0331975519657135, 0.036652736365795135, -0.0000063602556110708974, -0.022222250699996948, -0.019544731825590134, 0.0710659995675087, 0.0324304923415184, -0.020181939005851746, 0.030821701511740685, -0.018781650811433792, -0.009148159995675087, -0.04005058854818344, 0.07583871483802795, -0.0547311007976532, 0.012377806007862091, -0.0068143983371555805, 0.09306032210588455, 0.020696837455034256, -0.0022019746247678995, 0.009290088899433613, -0.02353747934103012, -0.05918347090482712, 0.025975503027439117, -0.009632529690861702, 0.001874952227808535, 0.10771819949150085, 0.040827590972185135, 0.008242703042924404, -0.008919468149542809, 0.02844965271651745, 0.013616766780614853, 0.053311076015233994, -0.06406485289335251, 0.006368787493556738, -0.049625691026449203, 0.0008961710846051574, 0.004166002850979567, 0.13614259660243988, -0.051074229180812836, 0.026374049484729767, -0.009121835231781006 ]
0.066905
[[search-suggesters-phrase]] === Phrase Suggester NOTE: In order to understand the format of suggestions, please read the <> page first. The `term` suggester provides a very convenient API to access word alternatives on a per token basis within a certain string distance. The API allows accessing each token in the stream individually while suggest-selection is left to the API consumer. Yet, often pre-selected suggestions are required in order to present to the end-user. The `phrase` suggester adds additional logic on top of the `term` suggester to select entire corrected phrases instead of individual tokens weighted based on `ngram-language` models. In practice this suggester will be able to make better decisions about which tokens to pick based on co-occurrence and frequencies. ==== API Example In general the `phrase` suggester requires special mapping up front to work. The `phrase` suggester examples on this page need the following mapping to work. The `reverse` analyzer is used only in the last example. [source,js] -------------------------------------------------- PUT test { "settings": { "index": { "number\_of\_shards": 1, "analysis": { "analyzer": { "trigram": { "type": "custom", "tokenizer": "standard", "filter": ["standard", "shingle"] }, "reverse": { "type": "custom", "tokenizer": "standard", "filter": ["standard", "reverse"] } }, "filter": { "shingle": { "type": "shingle", "min\_shingle\_size": 2, "max\_shingle\_size": 3 } } } } }, "mappings": { "test": { "properties": { "title": { "type": "text", "fields": { "trigram": { "type": "text", "analyzer": "trigram" }, "reverse": { "type": "text", "analyzer": "reverse" } } } } } } } POST test/test?refresh=true {"title": "noble warriors"} POST test/test?refresh=true {"title": "nobel prize"} -------------------------------------------------- // CONSOLE // TESTSETUP Once you have the analyzers and mappings set up you can use the `phrase` suggester in the same spot you'd use the `term` suggester: [source,js] -------------------------------------------------- POST test/\_search { "suggest": { "text": "noble prize", "simple\_phrase": { "phrase": { "field": "title.trigram", "size": 1, "gram\_size": 3, "direct\_generator": [ { "field": "title.trigram", "suggest\_mode": "always" } ], "highlight": { "pre\_tag": "*", "post\_tag": "*" } } } } } -------------------------------------------------- // CONSOLE The response contains suggestions scored by the most likely spell correction first. In this case we received the expected correction "nobel prize". [source,js] -------------------------------------------------- { "\_shards": ... "hits": ... "timed\_out": false, "took": 3, "suggest": { "simple\_phrase" : [ { "text" : "noble prize", "offset" : 0, "length" : 11, "options" : [ { "text" : "nobel prize", "highlighted": "*nobel* prize", "score" : 0.5962314 }] } ] } } -------------------------------------------------- // TESTRESPONSE[s/"\_shards": .../"\_shards": "$body.\_shards",/] // TESTRESPONSE[s/"hits": .../"hits": "$body.hits",/] // TESTRESPONSE[s/"took": 3,/"took": "$body.took",/] ==== Basic Phrase suggest API parameters [horizontal] `field`:: the name of the field used to do n-gram lookups for the language model, the suggester will use this field to gain statistics to score corrections. This field is mandatory. `gram\_size`:: sets max size of the n-grams (shingles) in the `field`. If the field doesn't contain n-grams (shingles) this should be omitted or set to `1`. Note that Elasticsearch tries to detect the gram size based on the specified `field`. If the field uses a `shingle` filter the `gram\_size` is set to the `max\_shingle\_size` if not explicitly set. `real\_word\_error\_likelihood`:: the likelihood of a term being a misspelled even if the term exists in the dictionary. The default is `0.95` corresponding to 5% of the real words are misspelled. `confidence`:: The confidence level defines a factor applied to the input phrases score which is used as a threshold for other suggest candidates. Only candidates that score higher than the threshold will be included in the result. For instance a confidence level of `1.0` will only return suggestions that score higher than the input phrase. If set to `0.0` the top N candidates are returned. The default is `1.0`. `max\_errors`:: the
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/phrase-suggest.asciidoc
6.2
elasticsearch-6-2
[ -0.12118826061487198, -0.02648271434009075, 0.0649532899260521, 0.023744599893689156, 0.0542992539703846, 0.01796516589820385, 0.06586594879627228, 0.04279734566807747, 0.043396688997745514, -0.031244460493326187, -0.017930809408426285, -0.06260683387517929, 0.043934911489486694, 0.014032630249857903, 0.0749845877289772, 0.057602159678936005, 0.035513605922460556, -0.004379115533083677, 0.007682744413614273, -0.15929999947547913, 0.06907228380441666, 0.12235727906227112, -0.02443496510386467, -0.04946833848953247, 0.0237914826720953, 0.025232521817088127, -0.03485586494207382, 0.0059571899473667145, 0.0836244449019432, 0.0992790013551712, -0.0000946250293054618, 0.07640427350997925, -0.008415897376835346, 0.039415184408426285, -0.14137646555900574, -0.011507909744977951, -0.11303245276212692, 0.010026444680988789, 0.0541662760078907, -0.015284005552530289, -0.05026179179549217, 0.04906022921204567, -0.08077766746282578, -0.019290819764137268, -0.013389055617153645, 0.007931332103908062, -0.04885685816407204, 0.02820192277431488, -0.07185620069503784, 0.012680106796324253, -0.11697837710380554, -0.014121532440185547, -0.033829957246780396, 0.022838754579424858, -0.0699055939912796, -0.062016721814870834, -0.0402480810880661, -0.013498243875801563, 0.07103779911994934, -0.06979141384363174, -0.018750017508864403, -0.1201321929693222, -0.022984595969319344, -0.05933082848787308, 0.06316126137971878, -0.024025289341807365, 0.01983543299138546, 0.029755493625998497, 0.04585560783743858, 0.07714377343654633, -0.0019141884986311197, 0.06441296637058258, -0.011642425321042538, -0.046713776886463165, -0.043123774230480194, 0.08598582446575165, -0.0017391132423654199, 0.020662778988480568, 0.020734887570142746, -0.04676410183310509, -0.05637568235397339, -0.02392616868019104, 0.10014314204454422, 0.0515151284635067, 0.03659053519368172, -0.006599281448870897, -0.010202647186815739, -0.026878992095589638, 0.14988306164741516, 0.018308987841010094, -0.035233981907367706, -0.14201977849006653, 0.07941751182079315, -0.03798310086131096, 0.04348578676581383, 0.025415606796741486, -0.06731493771076202, -0.04598237946629524, 0.014234435744583607, -0.0004697548574768007, 0.0435069277882576, 0.014146489091217518, 0.04702141508460045, -0.11749652773141861, -0.08318095654249191, -0.010287472046911716, 0.0143636679276824, 0.040977101773023605, 0.07470814138650894, 0.02344752661883831, -0.06084699183702469, 0.09410133957862854, 0.009195759892463684, 0.005277161952108145, -0.026019630953669548, -0.048722416162490845, 0.0960044413805008, -0.0909772515296936, 0.06369801610708237, 0.11109165102243423, 0.03231338411569595, 0.005102117080241442, 0.024096526205539703, -0.019022898748517036, -0.032807961106300354, 0.0013914078008383512, 0.012296504341065884, 6.306774780659214e-33, -0.030952442437410355, 0.006026625167578459, 0.018857676535844803, -0.04605147987604141, -0.07200254499912262, 0.003256808500736952, -0.08385828882455826, 0.05621064081788063, -0.06423601508140564, -0.012842241674661636, -0.003105203388258815, 0.09116282314062119, -0.029592184349894524, 0.017774760723114014, 0.017206409946084023, -0.07484558969736099, -0.0060785021632909775, 0.03500567376613617, 0.016118565574288368, -0.019896814599633217, -0.005648607388138771, 0.030720222741365433, -0.03623203560709953, -0.03083007037639618, -0.04124442860484123, -0.02857590839266777, 0.05322330445051193, -0.05135578289628029, -0.017467767000198364, -0.023203842341899872, -0.061750221997499466, -0.04975138232111931, 0.001393120619468391, 0.0003831145877484232, 0.04934465140104294, 0.020648958161473274, -0.005286853760480881, 0.014236841350793839, -0.05695837363600731, -0.08658845722675323, -0.02894463948905468, 0.005031617358326912, -0.015388909727334976, -0.03250911086797714, 0.021271230652928352, -0.02630731649696827, -0.06744138896465302, 0.004514706786721945, 0.004183569923043251, -0.007548169232904911, 0.004548050928860903, 0.0672675222158432, -0.07444686442613602, 0.04726247861981392, 0.07555120438337326, 0.015463722869753838, -0.02089829184114933, 0.09953723847866058, 0.0361703522503376, 0.02871261164546013, 0.018388565629720688, 0.014117415994405746, 0.06604083627462387, 0.007901428267359734, 0.03181667998433113, 0.03691183403134346, 0.07512502372264862, 0.03600193187594414, 0.039566315710544586, 0.016749046742916107, 0.003963008057326078, 0.03061186708509922, 0.0645824745297432, 0.020781802013516426, -0.02644479274749756, -0.072960264980793, 0.04734547436237335, -0.016666827723383904, 0.009627829305827618, -0.05025402829051018, -0.026387397199869156, -0.10326914489269257, -0.010803038254380226, 0.016404472291469574, -0.019164539873600006, -0.019891032949090004, 0.05711352452635765, -0.12888777256011963, -0.02850884571671486, -0.08589083701372147, 0.04714268073439598, 0.05914684385061264, -0.08347408473491669, 0.02855900302529335, -0.0005477116792462766, -6.661660933276279e-33, 0.04381886124610901, -0.05895968899130821, 0.06586623936891556, 0.050459690392017365, -0.011829318478703499, -0.10012403130531311, 0.030546491965651512, 0.006035300437361002, 0.11351616680622101, -0.08403389900922775, -0.0547371506690979, -0.052619580179452896, 0.01161133125424385, 0.021930314600467682, 0.039370566606521606, 0.07992557436227798, -0.058166757225990295, -0.007343171164393425, 0.03501962125301361, 0.06985526531934738, -0.012450839392840862, -0.006596171762794256, -0.06278806179761887, 0.03124099038541317, -0.07246968895196915, 0.06387794017791748, 0.030208280310034752, 0.08400047570466995, -0.0007370131206698716, -0.0474172867834568, -0.03766532242298126, -0.0016943725058808923, -0.011865144595503807, -0.05031124874949455, -0.06418020278215408, -0.05582718551158905, 0.00369438249617815, 0.07355271279811859, -0.01554891001433134, 0.056656211614608765, 0.05797424167394638, 0.07725317031145096, 0.027942605316638947, -0.04662056267261505, -0.06947554647922516, -0.041981711983680725, -0.06293298304080963, 0.021493107080459595, 0.02801290713250637, -0.09922157973051071, 0.0487869456410408, -0.0022825889755040407, -0.14304816722869873, 0.021097591146826744, -0.034989457577466965, -0.03521992638707161, 0.047233909368515015, -0.03969459608197212, -0.040308717638254166, -0.008241948671638966, -0.05673296004533768, -0.03845157101750374, 0.07526323944330215, -0.006711071822792292, 0.09189172834157944, -0.07164480537176132, -0.008856131695210934, -0.009756010957062244, 0.04277205094695091, -0.022397000342607498, 0.012738886289298534, -0.04786713793873787, 0.029319772496819496, -0.018653692677617073, 0.04430723935365677, 0.03377293050289154, 0.07935231924057007, -0.11181820183992386, 0.00006686263077426702, -0.09912379831075668, -0.01735885627567768, 0.038473229855298996, -0.02170703560113907, 0.04237159341573715, -0.04928310960531235, 0.012140581384301186, -0.04900636896491051, 0.11507412791252136, -0.0034722285345196724, 0.024555418640375137, 0.028813770040869713, -0.07856712490320206, 0.03286782652139664, 0.02817871980369091, 0.022265950217843056, -5.612380604702594e-8, -0.06340426951646805, -0.0226685032248497, -0.061102475970983505, 0.03249694034457207, 0.007812557741999626, -0.019947275519371033, -0.02769610658288002, 0.007581987883895636, -0.0091618737205863, -0.06168319284915924, 0.03148829936981201, 0.01911747455596924, -0.07440460473299026, 0.0056009115651249886, -0.0340828076004982, 0.0372077152132988, -0.01651419885456562, 0.00419370224699378, -0.011119541712105274, -0.012109189294278622, -0.019144045189023018, 0.012249701656401157, 0.018228059634566307, 0.006133052986115217, 0.027546953409910202, 0.0666152760386467, -0.005046693608164787, 0.06414353847503662, 0.010028609074652195, 0.019509484991431236, -0.01474112831056118, 0.06481101363897324, 0.017509160563349724, -0.06000545620918274, 0.00927988812327385, 0.0022452878765761852, 0.005325688049197197, -0.04851406067609787, -0.030802598223090172, 0.04830418899655342, 0.07033868879079819, -0.011405176483094692, -0.10370156913995743, 0.011438298039138317, 0.045469772070646286, 0.016381101682782173, 0.07421001046895981, -0.04901302605867386, 0.053218547254800797, -0.06889597326517105, 0.0076046111062169075, -0.01798299327492714, -0.012340233661234379, 0.007218083366751671, 0.017390256747603416, 0.028649328276515007, -0.04882282763719559, 0.054973144084215164, 0.03716989979147911, -0.005612739361822605, 0.06204167380928993, -0.00295557570643723, 0.016553087159991264, 0.016238858923316002 ]
0.131303
suggest candidates. Only candidates that score higher than the threshold will be included in the result. For instance a confidence level of `1.0` will only return suggestions that score higher than the input phrase. If set to `0.0` the top N candidates are returned. The default is `1.0`. `max\_errors`:: the maximum percentage of the terms that at most considered to be misspellings in order to form a correction. This method accepts a float value in the range `[0..1)` as a fraction of the actual query terms or a number `>=1` as an absolute number of query terms. The default is set to `1.0` which corresponds to that only corrections with at most 1 misspelled term are returned. Note that setting this too high can negatively impact performance. Low values like `1` or `2` are recommended otherwise the time spend in suggest calls might exceed the time spend in query execution. `separator`:: the separator that is used to separate terms in the bigram field. If not set the whitespace character is used as a separator. `size`:: the number of candidates that are generated for each individual query term Low numbers like `3` or `5` typically produce good results. Raising this can bring up terms with higher edit distances. The default is `5`. `analyzer`:: Sets the analyzer to analyse to suggest text with. Defaults to the search analyzer of the suggest field passed via `field`. `shard\_size`:: Sets the maximum number of suggested term to be retrieved from each individual shard. During the reduce phase, only the top N suggestions are returned based on the `size` option. Defaults to `5`. `text`:: Sets the text / query to provide suggestions for. `highlight`:: Sets up suggestion highlighting. If not provided then no `highlighted` field is returned. If provided must contain exactly `pre\_tag` and `post\_tag` which are wrapped around the changed tokens. If multiple tokens in a row are changed the entire phrase of changed tokens is wrapped rather than each token. `collate`:: Checks each suggestion against the specified `query` to prune suggestions for which no matching docs exist in the index. The collate query for a suggestion is run only on the local shard from which the suggestion has been generated from. The `query` must be specified and it can be templated, see <> for more information. The current suggestion is automatically made available as the `{{suggestion}}` variable, which should be used in your query. You can still specify your own template `params` -- the `suggestion` value will be added to the variables you specify. Additionally, you can specify a `prune` to control if all phrase suggestions will be returned, when set to `true` the suggestions will have an additional option `collate\_match`, which will be `true` if matching documents for the phrase was found, `false` otherwise. The default value for `prune` is `false`. [source,js] -------------------------------------------------- POST \_search { "suggest": { "text" : "noble prize", "simple\_phrase" : { "phrase" : { "field" : "title.trigram", "size" : 1, "direct\_generator" : [ { "field" : "title.trigram", "suggest\_mode" : "always", "min\_word\_length" : 1 } ], "collate": { "query": { <1> "source" : { "match": { "{{field\_name}}" : "{{suggestion}}" <2> } } }, "params": {"field\_name" : "title"}, <3> "prune": true <4> } } } } } -------------------------------------------------- // CONSOLE <1> This query will be run once for every suggestion. <2> The `{{suggestion}}` variable will be replaced by the text of each suggestion. <3> An additional `field\_name` variable has been specified in `params` and is used by the `match` query. <4> All suggestions will be returned with an extra `collate\_match` option indicating whether the generated phrase matched any document. ==== Smoothing
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/phrase-suggest.asciidoc
6.2
elasticsearch-6-2
[ -0.006254531908780336, -0.027313271537423134, -0.02305925264954567, 0.015210386365652084, 0.018588818609714508, 0.03360004350543022, 0.033418137580156326, 0.11432106792926788, -0.00760994665324688, 0.002866556867957115, -0.025567498058080673, -0.04972164332866669, 0.04716305062174797, -0.09229498356580734, -0.010769803076982498, 0.025089576840400696, 0.0392722561955452, -0.05861822888255119, -0.03923919424414635, -0.06907401978969574, 0.058107174932956696, 0.09558052569627762, 0.05010155960917473, -0.01844092272222042, 0.012028518132865429, -0.07110888510942459, -0.10329346358776093, 0.053249381482601166, 0.06574790179729462, 0.03021412342786789, -0.0821581780910492, 0.056617431342601776, 0.06172952800989151, 0.02132566086947918, -0.09474729001522064, -0.058195408433675766, -0.06516961008310318, -0.027365848422050476, -0.010667365975677967, -0.028910161927342415, 0.0006203799857757986, -0.005963509902358055, -0.02270401641726494, 0.08126860857009888, 0.006444657687097788, 0.006811205297708511, -0.006162446923553944, 0.03323594480752945, -0.04283314570784569, 0.03881894052028656, -0.13546478748321533, 0.02729158289730549, -0.0013214064529165626, 0.07332482188940048, -0.04297395795583725, -0.047119855880737305, -0.10091374814510345, -0.02279415726661682, 0.0013916026800870895, -0.04970688000321388, -0.10030584037303925, -0.03718158230185509, 0.002191843930631876, -0.02096639759838581, 0.09753809124231339, -0.02235867641866207, 0.012457060627639294, -0.09249760210514069, 0.06264452636241913, 0.03448689728975296, 0.01900305412709713, 0.02558407001197338, -0.12097350507974625, 0.025069396942853928, -0.012596586719155312, 0.07809047400951385, -0.07661326229572296, -0.017076540738344193, 0.04822497069835663, 0.03158699721097946, -0.05232548713684082, -0.03467733785510063, 0.027242040261626244, -0.026680395007133484, 0.07107792049646378, -0.03976374864578247, 0.06517688184976578, -0.033200398087501526, 0.12667137384414673, 0.018778089433908463, 0.0540403388440609, -0.121438167989254, -0.02564993128180504, 0.03355645388364792, -0.000772369559854269, 0.0341309979557991, -0.04400201886892319, -0.007927503436803818, 0.0366048738360405, 0.04265248030424118, 0.05327087268233299, -0.02284388616681099, -0.00680204015225172, -0.10578508675098419, -0.14437417685985565, -0.01862851157784462, 0.0709085613489151, 0.0751727968454361, 0.06717326492071152, -0.03187572956085205, -0.06526073813438416, 0.01250054407864809, -0.015031742863357067, 0.0026392487343400717, -0.0537254735827446, -0.023425424471497536, 0.06555870175361633, -0.02225535176694393, 0.033047664910554886, 0.018802328035235405, -0.01601380482316017, 0.06164873391389847, 0.0024802437983453274, -0.08052992075681686, -0.0318061038851738, 0.01891094446182251, -0.06872780621051788, 4.797095834763797e-33, 0.026419872418045998, 0.04724723473191261, 0.02287149429321289, -0.06943142414093018, -0.08109187334775925, 0.08794433623552322, -0.10091300308704376, 0.08724811673164368, -0.11399029195308685, 0.03779522329568863, 0.0018253001617267728, -0.00872790813446045, 0.05523809418082237, 0.009939477778971195, 0.1089571863412857, -0.024988899007439613, 0.04769347608089447, 0.04726865515112877, -0.01928907074034214, -0.0035332925617694855, 0.05890501290559769, 0.018369607627391815, 0.004548431374132633, -0.014354986138641834, 0.01395398285239935, 0.06914016604423523, 0.050580210983753204, 0.0293401051312685, -0.04092659056186676, 0.004530713893473148, -0.11108256131410599, -0.10029558092355728, -0.03322112560272217, -0.021933073177933693, 0.06444158405065536, 0.04991338029503822, 0.0059836492873728275, -0.003706103889271617, 0.020191695541143417, -0.019003991037607193, -0.09439727663993835, 0.0372227281332016, 0.031048022210597992, -0.0019453850109130144, 0.03251916915178299, -0.04876754805445671, -0.008019753731787205, 0.06699888408184052, -0.05491133779287338, 0.05804842337965965, -0.024829747155308723, -0.005149030592292547, -0.00021597319573629647, 0.07002423703670502, 0.03351864591240883, 0.04635944962501526, 0.015459410846233368, 0.059922270476818085, 0.002345742890611291, -0.02299831621348858, 0.0080178864300251, -0.0398416593670845, 0.013103862293064594, -0.044130127876996994, -0.01472031231969595, 0.048245325684547424, -0.005212133750319481, 0.028815677389502525, 0.10343675315380096, -0.01292997132986784, -0.003434509737417102, 0.012102819979190826, -0.023511691018939018, 0.009029281325638294, -0.02913823164999485, -0.056428130716085434, 0.09349554777145386, -0.028310200199484825, 0.016639111563563347, -0.020682193338871002, -0.0349026694893837, -0.03428911045193672, -0.027618875727057457, -0.028124306350946426, -0.04838762804865837, -0.0002922839194070548, 0.07987706363201141, -0.0004026451788377017, -0.046496160328388214, -0.04086800292134285, 0.06386369466781616, -0.03123830258846283, -0.03741162270307541, 0.02077416516840458, -0.08606639504432678, -5.116316754092944e-33, -0.06926888227462769, -0.039131660014390945, 0.009849383495748043, 0.05895766243338585, 0.005199546925723553, -0.09766968339681625, 0.0438527874648571, 0.007499987725168467, 0.06817977875471115, -0.09841392934322357, -0.024406153708696365, -0.03016522154211998, 0.041876282542943954, -0.07006774097681046, 0.029888011515140533, 0.03822815418243408, -0.06058816984295845, -0.0030903518199920654, -0.0566464401781559, 0.03592924773693085, 0.010028833523392677, 0.025544477626681328, -0.05857568606734276, 0.09036894887685776, -0.06564822793006897, 0.0282418355345726, 0.029483744874596596, 0.01795206405222416, -0.060775455087423325, -0.012602828443050385, -0.007723911665380001, -0.07278233021497726, -0.0904831811785698, 0.02177973836660385, 0.034423962235450745, -0.08854593336582184, 0.04662849009037018, -0.035743337124586105, 0.02590150572359562, 0.10295524448156357, 0.02426225319504738, 0.056557122617959976, -0.006891550030559301, 0.03793001547455788, -0.03233584016561508, 0.00020308690727688372, -0.07955239713191986, -0.00833817571401596, 0.029609577730298042, -0.02429329976439476, -0.012938941828906536, 0.04342564567923546, -0.0885426327586174, 0.1018875241279602, 0.010171625763177872, -0.04544771462678909, -0.05972191318869591, 0.01413725595921278, -0.09862937033176422, -0.03847917914390564, -0.06900899112224579, 0.09523874521255493, 0.03937530517578125, -0.003970969468355179, 0.09988073259592056, -0.060085900127887726, -0.05638208985328674, 0.041925810277462006, 0.03250538185238838, 0.03525334596633911, -0.07181689143180847, -0.06206298992037773, 0.08374667167663574, 0.032431524246931076, -0.03858828544616699, 0.002631155773997307, 0.03672106936573982, -0.014268256723880768, 0.05188506469130516, -0.0031716027297079563, -0.009972065687179565, 0.07416100800037384, 0.03967079520225525, 0.0165964737534523, -0.005461438093334436, -0.0003147312963847071, 0.04940782114863396, 0.12528680264949799, -0.04718901962041855, 0.006282540503889322, 0.051619116216897964, -0.041744038462638855, 0.0521678701043129, 0.014375639148056507, -0.06439930945634842, -5.5019903300035367e-8, -0.02921891026198864, 0.04000105708837509, -0.03913143277168274, 0.01827387511730194, 0.04874233528971672, 0.004180040676146746, -0.05315495282411575, 0.06754369288682938, -0.01637423038482666, 0.009264961816370487, 0.09192243218421936, -0.009595733135938644, -0.07261280715465546, -0.09863318502902985, 0.043359436094760895, 0.008700738660991192, 0.004793441388756037, 0.01865565776824951, -0.05660106986761093, -0.1238495334982872, -0.0698852688074112, -0.0008391180308535695, -0.04064769670367241, -0.008378462865948677, 0.024732939898967743, 0.03225245699286461, 0.01887076161801815, 0.11959708482027054, -0.03296275809407234, 0.034342143684625626, -0.02259589545428753, 0.0046137357130646706, 0.026789652183651924, -0.024016626179218292, 0.034435901790857315, 0.06258922070264816, -0.003968609031289816, 0.019593285396695137, 0.04428817331790924, 0.017822442576289177, 0.04021027311682701, -0.07603245973587036, -0.014422809705138206, 0.001378467190079391, 0.007998856715857983, -0.03093179315328598, 0.0018047356279566884, 0.031037459149956703, 0.03607814386487007, -0.07505867630243301, 0.015088366344571114, 0.018531164154410362, -0.05552077665925026, 0.04882600158452988, 0.03761259466409683, 0.03826596587896347, -0.02305096574127674, 0.009714688174426556, -0.018515124917030334, -0.05848896875977516, 0.07113947719335556, 0.0038869131822139025, -0.02901250310242176, 0.05819633603096008 ]
0.114084
The `{{suggestion}}` variable will be replaced by the text of each suggestion. <3> An additional `field\_name` variable has been specified in `params` and is used by the `match` query. <4> All suggestions will be returned with an extra `collate\_match` option indicating whether the generated phrase matched any document. ==== Smoothing Models The `phrase` suggester supports multiple smoothing models to balance weight between infrequent grams (grams (shingles) are not existing in the index) and frequent grams (appear at least once in the index). [horizontal] `stupid\_backoff`:: a simple backoff model that backs off to lower order n-gram models if the higher order count is `0` and discounts the lower order n-gram model by a constant factor. The default `discount` is `0.4`. Stupid Backoff is the default model. `laplace`:: a smoothing model that uses an additive smoothing where a constant (typically `1.0` or smaller) is added to all counts to balance weights, The default `alpha` is `0.5`. `linear\_interpolation`:: a smoothing model that takes the weighted mean of the unigrams, bigrams and trigrams based on user supplied weights (lambdas). Linear Interpolation doesn't have any default values. All parameters (`trigram\_lambda`, `bigram\_lambda`, `unigram\_lambda`) must be supplied. ==== Candidate Generators The `phrase` suggester uses candidate generators to produce a list of possible terms per term in the given text. A single candidate generator is similar to a `term` suggester called for each individual term in the text. The output of the generators is subsequently scored in combination with the candidates from the other terms to for suggestion candidates. Currently only one type of candidate generator is supported, the `direct\_generator`. The Phrase suggest API accepts a list of generators under the key `direct\_generator` each of the generators in the list are called per term in the original text. ==== Direct Generators The direct generators support the following parameters: [horizontal] `field`:: The field to fetch the candidate suggestions from. This is a required option that either needs to be set globally or per suggestion. `size`:: The maximum corrections to be returned per suggest text token. `suggest\_mode`:: The suggest mode controls what suggestions are included on the suggestions generated on each shard. All values other than `always` can be thought of as an optimization to generate fewer suggestions to test on each shard and are not rechecked when combining the suggestions generated on each shard. Thus `missing` will generate suggestions for terms on shards that do not contain them even other shards do contain them. Those should be filtered out using `confidence`. Three possible values can be specified: \*\* `missing`: Only generate suggestions for terms that are not in the shard. This is the default. \*\* `popular`: Only suggest terms that occur in more docs on the shard than the original term. \*\* `always`: Suggest any matching suggestions based on terms in the suggest text. `max\_edits`:: The maximum edit distance candidate suggestions can have in order to be considered as a suggestion. Can only be a value between 1 and 2. Any other value result in an bad request error being thrown. Defaults to 2. `prefix\_length`:: The number of minimal prefix characters that must match in order be a candidate suggestions. Defaults to 1. Increasing this number improves spellcheck performance. Usually misspellings don't occur in the beginning of terms. (Old name "prefix\_len" is deprecated) `min\_word\_length`:: The minimum length a suggest text term must have in order to be included. Defaults to 4. (Old name "min\_word\_len" is deprecated) `max\_inspections`:: A factor that is used to multiply with the `shards\_size` in order to inspect more candidate spell corrections on the shard level. Can improve accuracy at the cost of performance. Defaults to
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/phrase-suggest.asciidoc
6.2
elasticsearch-6-2
[ -0.1217280924320221, -0.0753038227558136, 0.04999230057001114, 0.0702415332198143, 0.013398010283708572, 0.03530561923980713, 0.02132999897003174, 0.049860429018735886, 0.013788641430437565, -0.03415558487176895, 0.04862827807664871, 0.033957310020923615, 0.048092424869537354, -0.09971292316913605, -0.0023867255076766014, -0.021344466134905815, 0.02926930971443653, -0.02986602671444416, -0.05474966764450073, -0.02964581921696663, 0.0619458332657814, 0.06475154310464859, -0.02771773748099804, 0.004023930989205837, 0.00899041909724474, 0.031041812151670456, -0.0332016795873642, 0.03790987655520439, 0.010054332204163074, -0.009618129581212997, -0.03969196230173111, 0.10377354174852371, -0.012215142138302326, 0.010457569733262062, -0.10273272544145584, -0.03970608487725258, -0.06765004992485046, 0.04389753192663193, -0.025045601651072502, -0.0020462467800825834, -0.09742438048124313, 0.00150411541108042, 0.025140676647424698, -0.013814778067171574, 0.09511932730674744, -0.06457991898059845, 0.01703033782541752, 0.018296604976058006, -0.05605034902691841, 0.013650796376168728, -0.06455609947443008, -0.07087105512619019, -0.02325124852359295, 0.028230877593159676, -0.013365888968110085, 0.010980203747749329, -0.04512597247958183, -0.05034613236784935, -0.01454250793904066, -0.06673596054315567, -0.09314124286174774, -0.06425974518060684, -0.09563851356506348, -0.030032377690076828, 0.01941748522222042, -0.052978143095970154, -0.013363896869122982, -0.031035972759127617, -0.010583083145320415, 0.09585323929786682, -0.038829367607831955, 0.03378771245479584, -0.07912188768386841, 0.03186073899269104, -0.007813576608896255, 0.07019832730293274, 0.012013493105769157, -0.033628854900598526, 0.02987511456012726, -0.009056096896529198, -0.015088394284248352, -0.03272455930709839, -0.006691667251288891, -0.03736782819032669, 0.014982970431447029, -0.08549447357654572, 0.027526848018169403, -0.019964667037129402, 0.1556181162595749, 0.004359024111181498, 0.014700000174343586, -0.02805553935468197, -0.01050560548901558, -0.005325266160070896, -0.07076571881771088, 0.12358535081148148, -0.019895320758223534, 0.031613320112228394, 0.03834545984864235, 0.052833329886198044, 0.04155682399868965, 0.03210940584540367, 0.10375399142503738, -0.029843948781490326, -0.0767296552658081, -0.021256206557154655, 0.08683545142412186, 0.0341934934258461, 0.07247325032949448, -0.08522208780050278, -0.06474737823009491, -0.00010041240602731705, -0.013706076890230179, -0.029105179011821747, -0.013406188227236271, -0.04053438827395439, 0.12830303609371185, -0.09709222614765167, 0.01574382558465004, -0.007044491358101368, 0.0016671449411660433, 0.06544598937034607, 0.026373116299510002, -0.1014287993311882, -0.014682828448712826, 0.10512879490852356, -0.05812360718846321, 4.5876547001999285e-33, 0.015925943851470947, 0.037348128855228424, -0.019568489864468575, -0.021738750860095024, 0.022921988740563393, 0.012201949022710323, -0.08653675764799118, 0.044474489986896515, -0.053393296897411346, 0.0340275838971138, -0.028494128957390785, 0.10283907502889633, -0.030267372727394104, 0.03891339525580406, 0.024946417659521103, -0.051876526325941086, 0.009852779097855091, 0.0769234299659729, 0.06154335290193558, 0.01139001827687025, 0.048720601946115494, 0.049552496522665024, -0.004335644654929638, -0.026851296424865723, 0.015008180402219296, 0.09207425266504288, 0.04873599112033844, -0.006548191420733929, 0.02751022018492222, 0.007828861474990845, -0.007812390569597483, 0.010807611979544163, -0.000010649913747329265, -0.11000563204288483, 0.019937030971050262, 0.005315011367201805, -0.07077578455209732, -0.032315779477357864, 0.023195041343569756, -0.047450073063373566, -0.000017273714547627605, 0.04970793053507805, 0.011129043996334076, 0.008010650984942913, -0.061492543667554855, -0.063752681016922, 0.026898708194494247, 0.015403634868562222, -0.007217838428914547, 0.025664422661066055, 0.005200105253607035, -0.006498113740235567, 0.012280134484171867, 0.08982259780168533, -0.06477485597133636, 0.08023364096879959, -0.0345209576189518, 0.07892131060361862, -0.008170470595359802, 0.009298260323703289, -0.00585089111700654, 0.029052579775452614, 0.026829008013010025, -0.05861419439315796, 0.05789472162723541, 0.03634561225771904, 0.03384651988744736, 0.06826427578926086, 0.07302017509937286, 0.040551744401454926, 0.0024495264515280724, -0.031522877514362335, -0.018918372690677643, 0.053446248173713684, 0.0325721874833107, -0.0638616532087326, 0.010631406679749489, -0.044063750654459, -0.008189519867300987, -0.05948589742183685, -0.09403938800096512, -0.011009125038981438, -0.014202105812728405, -0.024411452934145927, -0.05874662846326828, 0.0226561538875103, 0.06959118694067001, -0.07141823321580887, 0.038376495242118835, -0.11398344486951828, -0.06134409457445145, 0.012694379314780235, 0.0058859167620539665, 0.03642014414072037, -0.04153953492641449, -5.670234671455361e-33, 0.02489391341805458, -0.02990073524415493, -0.006162490230053663, 0.09182693809270859, 0.0015603266656398773, -0.010663732886314392, 0.03822372853755951, 0.042080964893102646, 0.06914685666561127, -0.1005016565322876, -0.025265444070100784, -0.04973021522164345, 0.08621262013912201, -0.03991446644067764, 0.09768831729888916, 0.014939283952116966, -0.058090467005968094, -0.05179814621806145, -0.08683987706899643, 0.06528632342815399, -0.06623406708240509, -0.02014702558517456, -0.03535592183470726, 0.07507499307394028, -0.010114818811416626, 0.013270877301692963, 0.01909475214779377, 0.02446983940899372, -0.04268549382686615, -0.0707113966345787, 0.010973126627504826, -0.06224928796291351, 0.03355654701590538, -0.0437818244099617, -0.05691470950841904, 0.004203132353723049, -0.017027338966727257, -0.0015795681392773986, -0.007427937351167202, 0.057916827499866486, 0.11680858582258224, 0.0995677262544632, 0.012365397997200489, 0.0386541374027729, -0.02076820097863674, 0.01985849440097809, -0.07709112018346786, -0.038120925426483154, 0.007416566368192434, -0.05522817745804787, -0.029813675209879875, -0.03064809925854206, -0.08851776272058487, 0.05970021337270737, -0.027737684547901154, -0.026962341740727425, -0.03991938382387161, 0.006255130283534527, -0.05526915192604065, -0.0013015351723879576, -0.038182612508535385, 0.038648128509521484, -0.03202785924077034, -0.02169380523264408, 0.06234252080321312, -0.06735143810510635, -0.03596053645014763, -0.09083344787359238, 0.058880168944597244, -0.051762208342552185, -0.0874500423669815, -0.06896412372589111, 0.03532661125063896, 0.015194305218756199, 0.06705445051193237, -0.02145100198686123, 0.04121408239006996, -0.09018700569868088, 0.039442773908376694, -0.03165048360824585, -0.016331171616911888, 0.024287879467010498, 0.020614057779312134, -0.00670555979013443, -0.02011432871222496, -0.06260719895362854, -0.09185124188661575, 0.17549104988574982, -0.01995048113167286, 0.038320839405059814, 0.012927121482789516, -0.0015405898448079824, 0.02871229499578476, 0.09268872439861298, -0.05237899720668793, -6.19654159095262e-8, 0.010825209319591522, 0.02388940192759037, 0.031176429241895676, 0.03869384154677391, -0.0006509117665700614, -0.0345228910446167, 0.004277872387319803, 0.02704264037311077, 0.014076527208089828, -0.06313874572515488, 0.06423230469226837, -0.028030959889292717, -0.0821618065237999, -0.018087197095155716, -0.005806571803987026, 0.0918038934469223, 0.003665999975055456, 0.08624225109815598, -0.06633535772562027, -0.012745929881930351, -0.0561046302318573, 0.0417354442179203, -0.0283000897616148, 0.046426061540842056, 0.09114066511392593, 0.039118796586990356, -0.0450480692088604, 0.07732418924570084, -0.0312962643802166, 0.0269524734467268, 0.042809776961803436, 0.024738123640418053, 0.038249094039201736, 0.006806865334510803, 0.05640988424420357, 0.07863175868988037, 0.06423161178827286, -0.03264090418815613, 0.08507011085748672, 0.06574227660894394, 0.0601496547460556, -0.009877102449536324, -0.11346611380577087, -0.02635275013744831, 0.04663815721869469, -0.04062684252858162, -0.02089221030473709, -0.04305766895413399, 0.040936969220638275, 0.002617400838062167, -0.03634878620505333, -0.0312812365591526, -0.033393971621990204, -0.0022936512250453234, 0.043178755789995193, -0.03523313254117966, -0.014767790213227272, 0.019232410937547684, 0.0004910418065264821, -0.06077274680137634, 0.09368100762367249, -0.07595590502023697, -0.01739749312400818, 0.019704382866621017 ]
0.081472
text term must have in order to be included. Defaults to 4. (Old name "min\_word\_len" is deprecated) `max\_inspections`:: A factor that is used to multiply with the `shards\_size` in order to inspect more candidate spell corrections on the shard level. Can improve accuracy at the cost of performance. Defaults to 5. `min\_doc\_freq`:: The minimal threshold in number of documents a suggestion should appear in. This can be specified as an absolute number or as a relative percentage of number of documents. This can improve quality by only suggesting high frequency terms. Defaults to 0f and is not enabled. If a value higher than 1 is specified then the number cannot be fractional. The shard level document frequencies are used for this option. `max\_term\_freq`:: The maximum threshold in number of documents a suggest text token can exist in order to be included. Can be a relative percentage number (e.g 0.4) or an absolute number to represent document frequencies. If an value higher than 1 is specified then fractional can not be specified. Defaults to 0.01f. This can be used to exclude high frequency terms from being spellchecked. High frequency terms are usually spelled correctly on top of this also improves the spellcheck performance. The shard level document frequencies are used for this option. `pre\_filter`:: a filter (analyzer) that is applied to each of the tokens passed to this candidate generator. This filter is applied to the original token before candidates are generated. `post\_filter`:: a filter (analyzer) that is applied to each of the generated tokens before they are passed to the actual phrase scorer. The following example shows a `phrase` suggest call with two generators, the first one is using a field containing ordinary indexed terms and the second one uses a field that uses terms indexed with a `reverse` filter (tokens are index in reverse order). This is used to overcome the limitation of the direct generators to require a constant prefix to provide high-performance suggestions. The `pre\_filter` and `post\_filter` options accept ordinary analyzer names. [source,js] -------------------------------------------------- POST \_search { "suggest": { "text" : "obel prize", "simple\_phrase" : { "phrase" : { "field" : "title.trigram", "size" : 1, "direct\_generator" : [ { "field" : "title.trigram", "suggest\_mode" : "always" }, { "field" : "title.reverse", "suggest\_mode" : "always", "pre\_filter" : "reverse", "post\_filter" : "reverse" } ] } } } } -------------------------------------------------- // CONSOLE `pre\_filter` and `post\_filter` can also be used to inject synonyms after candidates are generated. For instance for the query `captain usq` we might generate a candidate `usa` for term `usq` which is a synonym for `america` which allows to present `captain america` to the user if this phrase scores high enough.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/phrase-suggest.asciidoc
6.2
elasticsearch-6-2
[ 0.03542954474687576, -0.022458333522081375, 0.01020977646112442, -0.009217789396643639, -0.026133986189961433, 0.020774953067302704, -0.014538261108100414, 0.07281731814146042, 0.052622370421886444, 0.016537534072995186, -0.008549015037715435, -0.012584047392010689, 0.06469838321208954, 0.0119319511577487, -0.017562484368681908, -0.0019372169626876712, 0.05276358500123024, -0.07293521612882614, -0.09519761800765991, -0.043378256261348724, 0.062324922531843185, 0.04302344471216202, 0.10274428874254227, -0.04585175961256027, -0.005258845165371895, -0.03963221609592438, -0.16958197951316833, 0.019257664680480957, 0.04972285032272339, 0.024331901222467422, -0.012892786413431168, 0.1548885554075241, 0.05259181559085846, -0.01922600157558918, -0.030763057991862297, -0.023238161578774452, 0.0013701632851734757, -0.022486940026283264, -0.026502950116991997, 0.021754801273345947, -0.09017112106084824, -0.03364476189017296, -0.08510538190603256, 0.0866965502500534, -0.011530205607414246, -0.008532400242984295, -0.014875379391014576, 0.004124893341213465, -0.043885670602321625, 0.053809721022844315, -0.11066915839910507, -0.02007385529577732, -0.013093160465359688, 0.029885418713092804, -0.02956307865679264, -0.07211443781852722, -0.0831015482544899, 0.0009715791093185544, -0.040775787085294724, -0.09290404617786407, -0.043258003890514374, -0.03611835092306137, -0.041711825877428055, -0.045869503170251846, 0.010185341350734234, 0.024389546364545822, 0.033541664481163025, -0.06894726306200027, -0.0342363603413105, 0.07495851814746857, -0.06594173610210419, 0.04920613393187523, -0.04472829028964043, 0.05174367502331734, 0.007870637811720371, 0.04868568107485771, -0.03895244374871254, -0.014158500358462334, 0.008568420074880123, -0.030224300920963287, -0.06799199432134628, -0.002284164074808359, 0.060103822499513626, 0.005837552715092897, 0.01008460484445095, -0.036578886210918427, 0.06983968615531921, -0.03815251588821411, 0.025366032496094704, 0.008579573594033718, 0.059751953929662704, -0.07769827544689178, 0.049731556326150894, -0.05656665936112404, 0.018077317625284195, 0.0036064658779650927, -0.03184923157095909, 0.026793386787176132, 0.035332128405570984, 0.036659643054008484, 0.04798780009150505, -0.05393612012267113, 0.01568843610584736, -0.04152440279722214, -0.07638930529356003, -0.027812039479613304, 0.007427585311233997, 0.03990193456411362, 0.051407720893621445, -0.02248360775411129, -0.015495295636355877, -0.036529090255498886, -0.05213046073913574, -0.10193517804145813, 0.0197131484746933, -0.006765495054423809, 0.06617820262908936, -0.09768428653478622, 0.028310872614383698, 0.018252458423376083, 0.010327981784939766, 0.012188630178570747, 0.046743374317884445, -0.04655112326145172, -0.040650781244039536, 0.005104532930999994, -0.03921344131231308, 4.2874969931632576e-33, 0.044882070273160934, 0.1152501106262207, -0.0016914503648877144, 0.0048071471974253654, -0.00011785627430072054, 0.056399647146463394, -0.0745696946978569, 0.06592913717031479, -0.08895354717969894, -0.02212706208229065, -0.023150717839598656, 0.06864818930625916, 0.017206082120537758, -0.03611229732632637, 0.05336133763194084, -0.039200808852910995, 0.07126056402921677, 0.08906655758619308, -0.013984228484332561, -0.06335217505693436, 0.044840048998594284, -0.02867615781724453, 0.047205887734889984, -0.025998566299676895, -0.02002195455133915, 0.02809380367398262, 0.026971422135829926, -0.04100419208407402, -0.0069653866812586784, -0.01296953670680523, -0.05424957722425461, -0.06902635097503662, 0.07221246510744095, -0.07175137102603912, 0.0043939887546002865, 0.03777822107076645, -0.03880293294787407, 0.007718134205788374, 0.008345512673258781, -0.07834149152040482, 0.025243103504180908, 0.02201749011874199, 0.10599619895219803, -0.057155054062604904, 0.004984664265066385, 0.033298224210739136, 0.03782464191317558, 0.034222282469272614, -0.057568542659282684, 0.010800451040267944, 0.009157278575003147, 0.03222304955124855, 0.012159701436758041, 0.11720909923315048, 0.022045405581593513, 0.01709630899131298, 0.007411227561533451, -0.035948656499385834, -0.028103342279791832, -0.001099308137781918, -0.011825607158243656, -0.000046543515054509044, 0.06534437835216522, 0.015799202024936676, 0.0011508470633998513, -0.030462605878710747, 0.0176170002669096, 0.10625103116035461, 0.08460049331188202, 0.08434298634529114, -0.03263668715953827, 0.05357061326503754, -0.03717091307044029, 0.013189095072448254, 0.02031027525663376, -0.05208190530538559, 0.0626644417643547, -0.0957878828048706, -0.08950699865818024, 0.0034012282267212868, -0.10378646850585938, -0.042186189442873, 0.0261091161519289, -0.07255802303552628, -0.08926159143447876, 0.0025090619456022978, 0.11161335557699203, -0.01965958997607231, -0.046967342495918274, -0.0675974190235138, 0.0030094783287495375, -0.008689196780323982, -0.006155379582196474, -0.01821601763367653, -0.0299479141831398, -5.9868562789012516e-33, 0.014650121331214905, -0.10206092894077301, -0.06215434521436691, 0.11085385084152222, -0.002743314253166318, 0.016553862020373344, 0.06513813138008118, 0.06972058117389679, 0.05393465235829353, -0.11060771346092224, 0.022035710513591766, -0.036365050822496414, 0.057232778519392014, -0.03718031942844391, -0.016141394153237343, 0.020443454384803772, -0.09506319463253021, -0.04674259573221207, 0.06739933043718338, 0.09797868132591248, 0.0027591693215072155, -0.04349198937416077, -0.058582331985235214, 0.13468429446220398, 0.015885209664702415, 0.010471011511981487, -0.003120788373053074, -0.0723017007112503, -0.04082472249865532, -0.0033312097657471895, -0.053656116127967834, -0.002390161156654358, -0.07331312447786331, -0.0021140193566679955, -0.05626925081014633, -0.09947895258665085, 0.054184745997190475, 0.025678258389234543, -0.012424575164914131, 0.13185527920722961, 0.09809882193803787, 0.06937707960605621, -0.03897878900170326, -0.0032652164809405804, -0.09415939450263977, -0.036439862102270126, -0.03263406828045845, -0.0026076713111251593, 0.032763704657554626, -0.04444103688001633, 0.003630496561527252, -0.05461737886071205, -0.01933731697499752, 0.07459763437509537, -0.01677357405424118, 0.0813794806599617, -0.057988692075014114, 0.014194088988006115, -0.07450111210346222, 0.033100102096796036, -0.0444369912147522, 0.057628802955150604, -0.013986784964799881, -0.0574025921523571, 0.06456680595874786, -0.0700121521949768, -0.04462471604347229, 0.03186361864209175, 0.0019240017281845212, -0.07187215238809586, -0.07067422568798065, -0.009237276390194893, -0.002233714796602726, 0.0299418605864048, -0.028203029185533524, -0.036260124295949936, 0.0636858195066452, -0.05886552110314369, 0.017234371975064278, 0.030483460053801537, 0.0031418604776263237, 0.10626501590013504, -0.037670113146305084, 0.029371844604611397, 0.015321725979447365, -0.09263437241315842, 0.01832631416618824, 0.09940396994352341, -0.06105088070034981, 0.010761153884232044, -0.0045873308554291725, 0.023597845807671547, 0.011975318193435669, 0.027881257236003876, -0.06311533600091934, -5.9357187609521134e-8, -0.015310908667743206, 0.03209974616765976, -0.0437440350651741, 0.03971784934401512, 0.02531702257692814, -0.022913537919521332, 0.008246224373579025, 0.005740561988204718, -0.027051491662859917, -0.005203047767281532, 0.09191776067018509, -0.03295924887061119, -0.13916324079036713, -0.07560248672962189, 0.039071470499038696, 0.012155942618846893, 0.0023998527321964502, 0.030197493731975555, -0.02957242913544178, -0.07186949253082275, -0.024233367294073105, 0.01630694605410099, -0.013173393905162811, -0.0037454760167747736, 0.0002038985549006611, 0.0391475073993206, 0.013012736104428768, 0.0976213738322258, 0.005932710133492947, -0.0023344699293375015, 0.0129154734313488, -0.0029368512332439423, -0.00016030174447223544, -0.05469859018921852, -0.004666792694479227, 0.06036297231912613, -0.05173974484205246, 0.05674717575311661, 0.01209295354783535, 0.053990840911865234, 0.04514511302113533, -0.023098189383745193, -0.05164654180407524, -0.019248927012085915, -0.014726062305271626, -0.035165514796972275, -0.05231182649731636, -0.011847207322716713, 0.0171313788741827, -0.023827070370316505, 0.05085147172212601, 0.07246893644332886, 0.09936735033988953, 0.05544872209429741, 0.00835688877850771, 0.048795606940984726, 0.04323427006602287, 0.027955466881394386, -0.06366053223609924, -0.02979474514722824, 0.11499420553445816, -0.017795300111174583, 0.046621307730674744, -0.012325257994234562 ]
0.071928
[[returning-suggesters-type]] === Returning the type of the suggester Sometimes you need to know the exact type of a suggester in order to parse its results. The `typed\_keys` parameter can be used to change the suggester's name in the response so that it will be prefixed by its type. Considering the following example with two suggesters `term` and `phrase`: [source,js] -------------------------------------------------- POST \_search?typed\_keys { "suggest": { "text" : "some test mssage", "my-first-suggester" : { "term" : { "field" : "message" } }, "my-second-suggester" : { "phrase" : { "field" : "message" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] In the response, the suggester names will be changed to respectively `term#my-first-suggester` and `phrase#my-second-suggester`, reflecting the types of each suggestion: [source,js] -------------------------------------------------- { "suggest": { "term#my-first-suggester": [ <1> { "text": "some", "offset": 0, "length": 4, "options": [] }, { "text": "test", "offset": 5, "length": 4, "options": [] }, { "text": "mssage", "offset": 10, "length": 6, "options": [ { "text": "message", "score": 0.8333333, "freq": 4 } ] } ], "phrase#my-second-suggester": [ <2> { "text": "some test mssage", "offset": 0, "length": 16, "options": [ { "text": "some test message", "score": 0.030227963 } ] } ] }, ... } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": "$body.took", "timed\_out": false, "\_shards": "$body.\_shards", "hits": "$body.hits"/] <1> The name `my-first-suggester` now contains the `term` prefix. <2> The name `my-second-suggester` now contains the `phrase` prefix.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/misc.asciidoc
6.2
elasticsearch-6-2
[ -0.05891750380396843, 0.02768930234014988, 0.08743705600500107, 0.07214133441448212, 0.010754480957984924, -0.01377423107624054, 0.04074142500758171, 0.026319632306694984, 0.07742421329021454, -0.0648965984582901, -0.006409152876585722, -0.04310835525393486, 0.005091703496873379, 0.011430686339735985, 0.08157408982515335, 0.058486707508563995, -0.022182919085025787, -0.07734059542417526, 0.0076806629076600075, -0.07249505817890167, 0.08573489636182785, 0.06986646354198456, 0.018153613433241844, -0.03220222517848015, -0.004518589004874229, -0.04581576958298683, -0.06761720776557922, 0.024397606030106544, -0.00022886147780809551, 0.08542367815971375, -0.003628361504524946, 0.045017942786216736, -0.057924482971429825, 0.09979090839624405, -0.1050267368555069, 0.03157367557287216, -0.05661013722419739, 0.009697646833956242, 0.05141773074865341, 0.028489407151937485, -0.009144269861280918, 0.05288705974817276, -0.05781697481870651, -0.06081802770495415, 0.03469903767108917, -0.08900649845600128, 0.004295931663364172, 0.007626072037965059, -0.05652736499905586, -0.0053240093402564526, -0.07085401564836502, 0.017527662217617035, -0.06722241640090942, -0.010908320546150208, -0.011460574343800545, -0.025920631363987923, -0.08746980130672455, 0.028405863791704178, 0.022835060954093933, -0.06282662600278854, 0.009149696677923203, -0.10897161811590195, -0.017543978989124298, -0.08665131032466888, -0.010393061675131321, -0.026261303573846817, -0.013676890172064304, -0.019414985552430153, 0.03341342881321907, 0.008014718070626259, 0.08610158413648605, -0.02825663611292839, -0.004444040823727846, -0.09062190353870392, 0.02804897166788578, -0.009646001271903515, -0.048204489052295685, -0.037247490137815475, -0.05598157271742821, 0.050532806664705276, -0.07909396290779114, -0.08977970480918884, -0.006551751401275396, 0.027046620845794678, -0.01430295966565609, -0.008317708969116211, -0.016976194456219673, -0.07647908478975296, 0.07364588230848312, -0.011533528566360474, -0.0715177059173584, -0.18033790588378906, 0.005168852396309376, 0.06344933062791824, 0.06292005628347397, 0.046470995992422104, -0.029458165168762207, -0.05319635197520256, 0.01855243742465973, 0.023191465064883232, 0.03868032619357109, -0.02895902283489704, 0.06931135058403015, -0.08775310218334198, -0.04072444140911102, 0.00344572844915092, 0.02054687775671482, 0.0034722890704870224, -0.003663352457806468, 0.02053193934261799, -0.046993862837553024, 0.11662336438894272, -0.005511546973139048, 0.045154642313718796, -0.06900462508201599, 0.006046016234904528, 0.007215323392301798, -0.041547633707523346, 0.07443565875291824, 0.07563252747058868, 0.12343386560678482, 0.006144455634057522, -0.016078783199191093, -0.0419730506837368, 0.007222135551273823, -0.0018019075505435467, -0.0008313150028698146, -1.3454495281160816e-33, -0.0013702891301363707, 0.07052662968635559, 0.06057436391711235, -0.017155634239315987, -0.023977026343345642, 0.05741531029343605, -0.008708021603524685, 0.08653471618890762, -0.003246829379349947, -0.02821802720427513, -0.030498716980218887, 0.029405513778328896, -0.031147360801696777, -0.029360245913267136, -0.06180397421121597, 0.008401491679251194, -0.00392146036028862, 0.05532089248299599, -0.007925783284008503, 0.03486676514148712, 0.058909427374601364, 0.09363357722759247, -0.05241820961236954, -0.009100524708628654, 0.0033704880625009537, -0.0593302883207798, -0.008075932040810585, 0.008501600474119186, -0.031261056661605835, -0.03994080424308777, -0.06163718178868294, -0.060034703463315964, -0.004908898379653692, 0.007021582685410976, 0.05472452566027641, 0.061723414808511734, 0.03107665479183197, 0.023488400503993034, -0.09049401432275772, -0.10343796014785767, 0.053674086928367615, 0.03887474536895752, -0.014433271251618862, -0.03290587663650513, -0.04325921833515167, -0.04629654437303543, -0.0753786563873291, 0.03146596625447273, 0.023340003564953804, -0.021569160744547844, -0.07384850084781647, 0.01278961542993784, -0.007913664914667606, 0.04601690545678139, 0.055330388247966766, 0.052791498601436615, 0.027332555502653122, 0.09423890709877014, -0.012348869815468788, -0.036893971264362335, -0.020924707874655724, -0.010090150870382786, 0.05170330032706261, -0.00764379883185029, 0.044738613069057465, 0.03426859900355339, 0.03959428146481514, 0.09401950985193253, 0.045233987271785736, 0.019289232790470123, 0.0011038893135264516, 0.05563780665397644, -0.015798047184944153, 0.0389569066464901, 0.00398321682587266, -0.08259619027376175, -0.04294517636299133, -0.030729711055755615, 0.06282224506139755, -0.036232076585292816, -0.02998589724302292, -0.03490258753299713, -0.07237580418586731, 0.0943789854645729, -0.06823050230741501, 0.09206516295671463, -0.004494649823755026, -0.07025168836116791, -0.024253275245428085, -0.03579196706414223, -0.054636150598526, 0.060842081904411316, -0.109626404941082, -0.04871893674135208, -0.03359006345272064, -2.2362909423890442e-33, 0.01673137955367565, -0.06035907566547394, 0.01950732246041298, 0.05023839324712753, 0.047252997756004333, -0.05754653736948967, 0.05444462597370148, 0.004196471534669399, 0.041842229664325714, -0.019672846421599388, -0.016028037294745445, -0.07904943078756332, 0.06156926229596138, -0.022900626063346863, 0.023875579237937927, 0.05874783545732498, -0.09771349281072617, 0.02182847075164318, 0.0058284648694098, -0.023113006725907326, -0.051485057920217514, -0.005338994786143303, -0.024908971041440964, 0.015102132223546505, -0.07968994230031967, -0.019270289689302444, 0.04830852523446083, 0.06682328879833221, -0.051405370235443115, 0.021781647577881813, -0.011364155448973179, 0.03096972405910492, -0.029475972056388855, 0.005953066982328892, -0.05228172615170479, 0.0108956228941679, 0.017462147399783134, 0.039825983345508575, 0.013239720836281776, 0.08435410261154175, 0.05242735147476196, 0.06030840426683426, 0.001614913810044527, 0.009874940849840641, -0.022547390311956406, -0.05541747063398361, 0.040283218026161194, 0.026846297085285187, 0.04519174247980118, -0.04956742376089096, 0.03357801213860512, -0.0012669697171077132, -0.17589852213859558, -0.0004897995386272669, -0.059965331107378006, -0.05332589149475098, -0.005647994112223387, -0.04171748831868172, -0.02109883725643158, -0.01855732873082161, -0.02456449531018734, -0.037219028919935226, 0.03275403380393982, 0.03418802469968796, 0.08360984176397324, -0.17996050417423248, -0.008729738183319569, -0.048584066331386566, 0.08717688173055649, -0.05876971036195755, 0.018900267779827118, -0.03294793888926506, 0.09354215115308762, 0.03069327399134636, 0.10208885371685028, -0.03488217294216156, 0.012947813607752323, -0.016191894188523293, 0.05016368627548218, -0.08911378681659698, 0.020978450775146484, -0.021552151069045067, 0.0027578999288380146, 0.09308069199323654, -0.006927867885679007, -0.02408483810722828, 0.026938820257782936, 0.14372991025447845, -0.08938419818878174, 0.009435515850782394, 0.09184811264276505, -0.07901151478290558, 0.0015202747890725732, 0.01957498863339424, -0.013438310474157333, -5.7920637175357115e-8, -0.053685594350099564, 0.013978890143334866, -0.08837243169546127, 0.05165615305304527, -0.07102146744728088, 0.0043962677009403706, 0.008432579226791859, -0.019118065014481544, 0.02132537215948105, -0.05935285612940788, -0.02989475056529045, 0.023652734234929085, -0.02018842287361622, -0.010295485146343708, 0.013904400169849396, -0.0507788322865963, -0.01346870418637991, 0.01222100667655468, -0.044174425303936005, -0.01635594293475151, 0.03866078704595566, -0.053010039031505585, -0.014755366370081902, 0.0005750213167630136, 0.0921488106250763, 0.06258904933929443, 0.010000506415963173, 0.06621040403842926, 0.013342351652681828, 0.04598338529467583, -0.030963968485593796, 0.038607604801654816, -0.003120717592537403, -0.029032757505774498, 0.006727608386427164, -0.0003104017523583025, 0.07780366390943527, -0.01146349310874939, 0.015170353464782238, 0.08168310672044754, 0.03308293968439102, -0.048975273966789246, -0.11693178117275238, 0.030061624944210052, 0.011563917621970177, -0.009777853265404701, 0.060496941208839417, -0.0035501550883054733, 0.08556448668241501, -0.027311008423566818, 0.028358694165945053, -0.043735139071941376, 0.0013228751486167312, -0.03857061266899109, -0.052816689014434814, -0.0014308623503893614, 0.005292491987347603, 0.08486676961183548, 0.0031823941972106695, -0.04985542222857475, 0.09744738042354584, -0.025041451677680016, -0.03253090754151344, 0.03155473247170448 ]
0.015826
[[suggester-context]] === Context Suggester The completion suggester considers all documents in the index, but it is often desirable to serve suggestions filtered and/or boosted by some criteria. For example, you want to suggest song titles filtered by certain artists or you want to boost song titles based on their genre. To achieve suggestion filtering and/or boosting, you can add context mappings while configuring a completion field. You can define multiple context mappings for a completion field. Every context mapping has a unique name and a type. There are two types: `category` and `geo`. Context mappings are configured under the `contexts` parameter in the field mapping. The following defines types, each with two context mappings for a completion field: [source,js] -------------------------------------------------- PUT place { "mappings": { "\_doc" : { "properties" : { "suggest" : { "type" : "completion", "contexts": [ { <1> "name": "place\_type", "type": "category" }, { <2> "name": "location", "type": "geo", "precision": 4 } ] } } } } } PUT place\_path\_category { "mappings": { "\_doc" : { "properties" : { "suggest" : { "type" : "completion", "contexts": [ { <3> "name": "place\_type", "type": "category", "path": "cat" }, { <4> "name": "location", "type": "geo", "precision": 4, "path": "loc" } ] }, "loc": { "type": "geo\_point" } } } } } -------------------------------------------------- // CONSOLE // TESTSETUP <1> Defines a `category` context named 'place\_type' where the categories must be sent with the suggestions. <2> Defines a `geo` context named 'location' where the categories must be sent with the suggestions. <3> Defines a `category` context named 'place\_type' where the categories are read from the `cat` field. <4> Defines a `geo` context named 'location' where the categories are read from the `loc` field. NOTE: Adding context mappings increases the index size for completion field. The completion index is entirely heap resident, you can monitor the completion field index size using <>. [[suggester-context-category]] [float] ==== Category Context The `category` context allows you to associate one or more categories with suggestions at index time. At query time, suggestions can be filtered and boosted by their associated categories. The mappings are set up like the `place\_type` fields above. If `path` is defined then the categories are read from that path in the document, otherwise they must be sent in the suggest field like this: [source,js] -------------------------------------------------- PUT place/\_doc/1 { "suggest": { "input": ["timmy's", "starbucks", "dunkin donuts"], "contexts": { "place\_type": ["cafe", "food"] <1> } } } -------------------------------------------------- // CONSOLE <1> These suggestions will be associated with 'cafe' and 'food' category. If the mapping had a `path` then the following index request would be enough to add the categories: [source,js] -------------------------------------------------- PUT place\_path\_category/\_doc/1 { "suggest": ["timmy's", "starbucks", "dunkin donuts"], "cat": ["cafe", "food"] <1> } -------------------------------------------------- // CONSOLE <1> These suggestions will be associated with 'cafe' and 'food' category. NOTE: If context mapping references another field and the categories are explicitly indexed, the suggestions are indexed with both set of categories. [float] ===== Category Query Suggestions can be filtered by one or more categories. The following filters suggestions by multiple categories: [source,js] -------------------------------------------------- POST place/\_search?pretty { "suggest": { "place\_suggestion" : { "prefix" : "tim", "completion" : { "field" : "suggest", "size": 10, "contexts": { "place\_type": [ "cafe", "restaurants" ] } } } } } -------------------------------------------------- // CONSOLE // TEST[continued] NOTE: When no categories are provided at query-time, all indexed documents are considered. Querying with no categories on a category enabled completion field should be avoided, as it will degrade search performance. Suggestions with certain categories can be boosted higher than others. The following filters suggestions by categories and additionally boosts suggestions associated with some categories: [source,js] -------------------------------------------------- POST place/\_search?pretty
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/context-suggest.asciidoc
6.2
elasticsearch-6-2
[ -0.07274439185857773, 0.018266549333930016, 0.058580104261636734, 0.029737967997789383, 0.06238536164164543, 0.015435595996677876, 0.05893778055906296, -0.001727607916109264, 0.020593104884028435, -0.07853470742702484, -0.05600105971097946, -0.026815097779035568, 0.013532483018934727, 0.0413418710231781, 0.046187084168195724, 0.05032902956008911, -0.01682313159108162, 0.016823088750243187, 0.00816827081143856, -0.08561321347951889, 0.06378965824842453, 0.05839821323752403, 0.03778268024325371, -0.07803112268447876, 0.001160256564617157, 0.03204476088285446, -0.07723800092935562, -0.0047168792225420475, 0.046861372888088226, 0.07446552813053131, 0.011021509766578674, 0.06264802068471909, -0.034906625747680664, 0.005541324615478516, -0.14772966504096985, 0.008224346674978733, -0.06743122637271881, 0.033539969474077225, -0.004707620944827795, 0.008575278334319592, -0.0046760947443544865, 0.1073044016957283, -0.01595105230808258, -0.021281443536281586, -0.03866041824221611, -0.08786080032587051, -0.019565513357520103, -0.03137870877981186, -0.08145566284656525, 0.008687191642820835, -0.1239977702498436, -0.02080690488219261, -0.028987722471356392, -0.020590979605913162, -0.003243137849494815, 0.043368324637413025, -0.10154910385608673, 0.02360108494758606, 0.0183634664863348, -0.021616434678435326, -0.03449980169534683, -0.08067873865365982, -0.04620463028550148, -0.05360093340277672, 0.08012174069881439, 0.04214423894882202, 0.00040861632442101836, 0.01393997110426426, 0.04122341424226761, 0.01907196082174778, 0.11317909508943558, -0.018988555297255516, 0.01425165869295597, -0.062332794070243835, 0.05729261413216591, 0.012541371397674084, -0.012964163906872272, 0.022946638986468315, -0.011114082299172878, -0.016617679968476295, -0.03194015845656395, -0.03999025374650955, 0.035251494497060776, -0.03404673933982849, -0.027692606672644615, -0.004230153746902943, -0.038337793201208115, -0.07411772757768631, -0.0049333954229950905, 0.016979966312646866, -0.036256399005651474, -0.19670405983924866, -0.03463125601410866, 0.030149465426802635, 0.00031242682598531246, 0.044039882719516754, -0.035617679357528687, -0.008852827362716198, 0.0325283445417881, -0.0011540172854438424, -0.002654370851814747, -0.0869823768734932, 0.021138371899724007, -0.01798822358250618, 0.021241523325443268, -0.038432542234659195, -0.025509435683488846, 0.05411182716488838, -0.030410485342144966, 0.048918332904577255, -0.04284686595201492, 0.07114709913730621, -0.07165642827749252, -0.0030999265145510435, -0.06024326756596565, 0.08561834692955017, 0.10138989239931107, -0.07459560036659241, 0.09815798699855804, 0.07633494585752487, 0.04797446355223656, -0.012109071016311646, -0.0007939104689285159, -0.10299775004386902, -0.0295579731464386, -0.017346393316984177, -0.010093648917973042, 9.022306688354843e-34, 0.04969475045800209, -0.03510240092873573, 0.019451681524515152, 0.013234919868409634, 0.017788967117667198, 0.0463714562356472, -0.05608826503157616, 0.031112592667341232, -0.06742852926254272, -0.006895124446600676, 0.026117049157619476, 0.10972067713737488, -0.062000904232263565, 0.0004884476074948907, -0.010416515171527863, -0.06379271298646927, 0.02265409380197525, 0.07348319888114929, -0.05913333594799042, -0.013650435023009777, 0.00557045079767704, 0.05251313000917435, -0.07249957323074341, 0.00036578302388079464, -0.006624948233366013, -0.014583362266421318, -0.018062349408864975, -0.006631047930568457, -0.015873754397034645, -0.023783382028341293, -0.019542384892702103, -0.02112036570906639, -0.036956798285245895, -0.0019170255400240421, 0.012379789724946022, 0.07989951968193054, -0.030662627890706062, 0.019926395267248154, -0.00786596816033125, -0.040269967168569565, 0.06891860067844391, -0.0009092004620470107, -0.061438269913196564, -0.06194901093840599, -0.05692927539348602, -0.02466294914484024, -0.0031277528032660484, 0.011326971463859081, -0.022331753745675087, 0.0711432546377182, 0.024310776963829994, 0.012921507470309734, -0.04033966362476349, 0.05062480643391609, 0.06388988345861435, 0.04892195761203766, -0.01887326128780842, 0.08657248318195343, 0.05319271981716156, -0.00845956802368164, 0.010432603769004345, -0.02312188595533371, 0.04497908428311348, -0.01798931136727333, 0.024239104241132736, 0.03636983409523964, 0.09828781336545944, 0.03893571346998215, 0.049519483000040054, -0.0032894941978156567, -0.02773403190076351, 0.03582390397787094, -0.007514770608395338, 0.049291759729385376, 0.052865222096443176, -0.09221939742565155, -0.0760883241891861, -0.05976227670907974, -0.023309238255023956, -0.001422892790287733, -0.08100271224975586, -0.0023934131022542715, -0.008486400358378887, 0.033373139798641205, -0.05639025196433067, 0.08298637717962265, -0.01116918120533228, -0.02872876636683941, 0.023225268349051476, -0.1380787193775177, -0.004555576015263796, 0.06087590381503105, -0.05283733084797859, -0.04540364071726799, -0.04266548901796341, -2.8950613028058783e-33, 0.061986491084098816, -0.11870111525058746, 0.001590697094798088, 0.04494452849030495, 0.017308030277490616, -0.08829160034656525, 0.03223413601517677, 0.00543947983533144, 0.04527617618441582, -0.03352328762412071, -0.005155696999281645, -0.09814484417438507, 0.08425401151180267, -0.004496936220675707, -0.06499438732862473, 0.013918781653046608, -0.0903240442276001, -0.02009875886142254, -0.006971693132072687, -0.007677609100937843, 0.000053091665904503316, -0.05721354857087135, -0.00237211468629539, 0.044779758900403976, -0.06129349768161774, -0.007158043794333935, -0.06705902516841888, 0.038260966539382935, 0.008819924667477608, -0.03717486932873726, 0.010413807816803455, 0.0044379704631865025, -0.06102123111486435, -0.06787925958633423, -0.015316843055188656, -0.024954481050372124, -0.013720273971557617, 0.09617327898740768, -0.02882848121225834, 0.06061508506536484, 0.023739883676171303, 0.043495986610651016, -0.023950573056936264, 0.07440537214279175, -0.05858626216650009, -0.008517888374626637, 0.08148301392793655, 0.045817892998456955, 0.03075774945318699, -0.037653908133506775, -0.0023031786549836397, 0.0035127962473779917, -0.08906286954879761, 0.03207952529191971, -0.08560733497142792, -0.016133159399032593, 0.03789074346423149, -0.07086524367332458, 0.01941610872745514, 0.04177623987197876, 0.008047191426157951, -0.030198849737644196, 0.018164049834012985, -0.013167321681976318, 0.05607570707798004, -0.11216755956411362, 0.012544656172394753, -0.06689813733100891, 0.0421704463660717, 0.0023808563128113747, -0.03230661526322365, 0.010742432437837124, 0.029378775507211685, 0.0406736396253109, 0.07836410403251648, -0.015602998435497284, 0.1059185117483139, -0.036395810544490814, 0.11325974762439728, -0.11426351219415665, 0.0544469952583313, 0.02574317157268524, -0.0009711035527288914, 0.06283318996429443, 0.06023947894573212, 0.04702998325228691, -0.03889056295156479, 0.10531879961490631, -0.026663288474082947, 0.016485868021845818, 0.04207761585712433, -0.007622777484357357, -0.06135764345526695, 0.011147795245051384, -0.06718764454126358, -5.498591448827028e-8, -0.060512881726026535, 0.06040957570075989, -0.1341906040906906, 0.01359974779188633, -0.07474897801876068, -0.001213494804687798, 0.058750350028276443, 0.05735621601343155, 0.03433145955204964, -0.039166826754808426, 0.006579009350389242, -0.0038153512869030237, -0.10325109958648682, -0.020181048661470413, 0.06027374416589737, -0.05359843745827675, 0.10832618921995163, 0.09901102632284164, -0.03290139138698578, 0.06397292017936707, 0.018727464601397514, -0.03787023574113846, -0.01877892203629017, 0.0005302206845954061, 0.10711020231246948, 0.07693570852279663, 0.023039119318127632, 0.05142926052212715, 0.0749540701508522, 0.044847723096609116, -0.07473673671483994, 0.030562791973352432, 0.017129188403487206, 0.001409463002346456, -0.008576516062021255, 0.03023761883378029, 0.06240738928318024, -0.06846988946199417, -0.090461865067482, 0.011273175477981567, 0.08201521635055542, -0.07205947488546371, -0.04930352792143822, 0.002039108658209443, 0.023081330582499504, 0.025052599608898163, 0.07203546911478043, -0.019963666796684265, 0.04318881779909134, 0.02050245925784111, -0.026175223290920258, -0.06447895616292953, 0.0454065278172493, 0.01343019213527441, 0.007403931580483913, 0.008544947020709515, -0.00919000431895256, 0.05761957913637161, 0.02422153577208519, -0.02799372375011444, -0.0005947306053712964, -0.045714203268289566, -0.0019920142367482185, 0.056114356964826584 ]
0.088948
documents are considered. Querying with no categories on a category enabled completion field should be avoided, as it will degrade search performance. Suggestions with certain categories can be boosted higher than others. The following filters suggestions by categories and additionally boosts suggestions associated with some categories: [source,js] -------------------------------------------------- POST place/\_search?pretty { "suggest": { "place\_suggestion" : { "prefix" : "tim", "completion" : { "field" : "suggest", "size": 10, "contexts": { "place\_type": [ <1> { "context" : "cafe" }, { "context" : "restaurants", "boost": 2 } ] } } } } } -------------------------------------------------- // CONSOLE // TEST[continued] <1> The context query filter suggestions associated with categories 'cafe' and 'restaurants' and boosts the suggestions associated with 'restaurants' by a factor of `2` In addition to accepting category values, a context query can be composed of multiple category context clauses. The following parameters are supported for a `category` context clause: [horizontal] `context`:: The value of the category to filter/boost on. This is mandatory. `boost`:: The factor by which the score of the suggestion should be boosted, the score is computed by multiplying the boost with the suggestion weight, defaults to `1` `prefix`:: Whether the category value should be treated as a prefix or not. For example, if set to `true`, you can filter category of 'type1', 'type2' and so on, by specifying a category prefix of 'type'. Defaults to `false` [[suggester-context-geo]] [float] ==== Geo location Context A `geo` context allows you to associate one or more geo points or geohashes with suggestions at index time. At query time, suggestions can be filtered and boosted if they are within a certain distance of a specified geo location. Internally, geo points are encoded as geohashes with the specified precision. [float] ===== Geo Mapping In addition to the `path` setting, `geo` context mapping accepts the following settings: [horizontal] `precision`:: This defines the precision of the geohash to be indexed and can be specified as a distance value (`5m`, `10km` etc.), or as a raw geohash precision (`1`..`12`). Defaults to a raw geohash precision value of `6`. NOTE: The index time `precision` setting sets the maximum geohash precision that can be used at query time. [float] ===== Indexing geo contexts `geo` contexts can be explicitly set with suggestions or be indexed from a geo point field in the document via the `path` parameter, similar to `category` contexts. Associating multiple geo location context with a suggestion, will index the suggestion for every geo location. The following indexes a suggestion with two geo location contexts: [source,js] -------------------------------------------------- PUT place/\_doc/1 { "suggest": { "input": "timmy's", "contexts": { "location": [ { "lat": 43.6624803, "lon": -79.3863353 }, { "lat": 43.6624718, "lon": -79.3873227 } ] } } } -------------------------------------------------- // CONSOLE [float] ===== Geo location Query Suggestions can be filtered and boosted with respect to how close they are to one or more geo points. The following filters suggestions that fall within the area represented by the encoded geohash of a geo point: [source,js] -------------------------------------------------- POST place/\_search { "suggest": { "place\_suggestion" : { "prefix" : "tim", "completion" : { "field" : "suggest", "size": 10, "contexts": { "location": { "lat": 43.662, "lon": -79.380 } } } } } } -------------------------------------------------- // CONSOLE // TEST[continued] NOTE: When a location with a lower precision at query time is specified, all suggestions that fall within the area will be considered. Suggestions that are within an area represented by a geohash can also be boosted higher than others, as shown by the following: [source,js] -------------------------------------------------- POST place/\_search?pretty { "suggest": { "place\_suggestion" : { "prefix" : "tim", "completion" : { "field" : "suggest", "size": 10, "contexts": { "location": [ <1>
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/context-suggest.asciidoc
6.2
elasticsearch-6-2
[ -0.03178216516971588, 0.06033671647310257, 0.05959482491016388, 0.09315717220306396, 0.032599370926618576, 0.03694941848516464, -0.011471635662019253, 0.00856873020529747, 0.04279661551117897, -0.1057434156537056, -0.048221487551927567, 0.012180861085653305, -0.018479270860552788, 0.0012271952582523227, 0.04938443750143051, 0.05319385603070259, 0.036704037338495255, 0.022635379806160927, 0.01790972426533699, -0.09606294333934784, 0.043413545936346054, 0.04950055852532387, 0.09417598694562912, -0.057352498173713684, 0.007465686183422804, -0.006106209009885788, -0.09544399380683899, -0.056230343878269196, 0.00861147791147232, 0.06271012127399445, -0.04511718079447746, 0.06348540633916855, -0.02119464799761772, 0.03351255878806114, -0.10936800390481949, -0.022221487015485764, -0.03715278208255768, -0.020600110292434692, 0.06430985778570175, 0.035869110375642776, -0.08970078825950623, 0.10353228449821472, -0.036104217171669006, -0.05273035541176796, 0.023434557020664215, -0.062186870723962784, -0.006236161570996046, -0.06360577791929245, -0.04990307614207268, -0.011224309913814068, -0.11480357497930527, 0.005452307406812906, -0.046613503247499466, -0.040251944214105606, 0.0018578481394797564, -0.008715556934475899, -0.11218158155679703, -0.031709831207990646, 0.01578843966126442, -0.051455993205308914, 0.025151630863547325, -0.062336958944797516, -0.04680765047669411, -0.02024770714342594, -0.013532096520066261, -0.030673297122120857, -0.013965414837002754, 0.02896496281027794, 0.05228497460484505, 0.006713956594467163, 0.10118973255157471, 0.016932349652051926, -0.031311020255088806, -0.03122546896338463, 0.07625116407871246, 0.010995209217071533, -0.033056262880563736, -0.018858730792999268, -0.01941952109336853, 0.03899967297911644, -0.049416981637477875, -0.054793551564216614, -0.011813328601419926, -0.020798221230506897, -0.05697646364569664, -0.03019479475915432, -0.03261921927332878, -0.09357832372188568, 0.012964935973286629, -0.04950082302093506, -0.02300383895635605, -0.13610006868839264, -0.030584299936890602, -0.025834372267127037, 0.013547701761126518, 0.027665775269269943, 0.02240752801299095, -0.032435547560453415, 0.03333242982625961, 0.02587919868528843, 0.04849492385983467, -0.0034661602694541216, 0.007132783532142639, -0.04550687596201897, -0.024953672662377357, 0.04341793805360794, 0.024546632543206215, 0.10922042280435562, 0.02762925997376442, 0.010677562095224857, -0.04164887219667435, 0.07014258205890656, -0.09639174491167068, -0.049229566007852554, -0.0881083756685257, 0.07862376421689987, 0.12367384135723114, -0.11552180349826813, 0.09475468099117279, 0.0855388194322586, 0.07859300076961517, 0.03934995085000992, -0.017082739621400833, -0.0578542985022068, -0.028990503400564194, 0.02488607168197632, -0.03873206675052643, 2.2973013032486287e-33, 0.0653894692659378, 0.017438996583223343, 0.016629274934530258, -0.03486340120434761, -0.00879749096930027, 0.03932277485728264, -0.0226000789552927, 0.06078436225652695, -0.03618558868765831, 0.007097270805388689, -0.016831928864121437, 0.05670630931854248, -0.07213594764471054, -0.02053181082010269, 0.010579603724181652, -0.06746654957532883, 0.032917555421590805, 0.03441368043422699, -0.07831577211618423, 0.011103447526693344, 0.031428899616003036, 0.01513801421970129, -0.029123762622475624, 0.0008138538105413318, 0.010038649663329124, -0.024096708744764328, -0.0012404995504766703, 0.017173249274492264, -0.0324784517288208, -0.01700378581881523, -0.06244310736656189, -0.012446288019418716, -0.029658528044819832, -0.04608715698122978, -0.011997750028967857, 0.08610040694475174, -0.043136876076459885, -0.005479910410940647, 0.011117284186184406, -0.00971636176109314, -0.0027043260633945465, 0.03133957087993622, -0.03855772688984871, -0.11596481502056122, -0.021408861503005028, 0.02233901619911194, -0.011501499451696873, -0.022571446374058723, -0.024820873513817787, 0.04748113453388214, -0.00880966056138277, 0.031937915831804276, -0.06401445716619492, 0.07904212921857834, 0.04230998083949089, 0.0476783812046051, -0.02418004348874092, 0.10090237855911255, 0.018634818494319916, 0.0072448039427399635, 0.027353128418326378, -0.03985624760389328, 0.0769362598657608, -0.010006926953792572, 0.022521400824189186, 0.021869346499443054, 0.07851459085941315, 0.111122727394104, 0.08141051977872849, 0.026502644643187523, 0.03567627817392349, 0.036615874618291855, 0.03272935748100281, -0.04706299677491188, 0.07000073045492172, -0.08471919596195221, -0.05175644904375076, -0.028113756328821182, -0.016426149755716324, 0.015241118147969246, -0.01767219603061676, -0.10860969871282578, -0.03957990184426308, 0.05350840091705322, -0.016181865707039833, 0.08260100334882736, 0.04472614824771881, -0.045214686542749405, -0.014611917547881603, -0.03255194425582886, -0.050694286823272705, 0.10039541870355606, -0.05287523940205574, -0.079507976770401, -0.0410940907895565, -4.233377967935369e-33, 0.06348296999931335, -0.143205463886261, 0.02254350297152996, 0.02159326709806919, -0.003933293744921684, -0.037673354148864746, -0.012551491148769855, -0.02688128501176834, 0.021683890372514725, -0.008474797010421753, -0.05005672574043274, -0.046602170914411545, 0.07518348842859268, -0.05074794217944145, -0.04323707893490791, 0.05349009484052658, -0.06830249726772308, -0.023142503574490547, -0.03452880308032036, 0.049775198101997375, -0.005274489056318998, -0.007640967611223459, -0.01609671674668789, 0.07217088341712952, -0.01946696639060974, -0.00217837025411427, -0.09230723232030869, 0.0050975242629647255, -0.07007534056901932, -0.06038327142596245, -0.03368522971868515, -0.0012764298589900136, -0.06356750428676605, -0.024865686893463135, 0.000612831034231931, 0.014538947492837906, -0.0623798631131649, 0.07821191847324371, -0.01220434345304966, 0.0743011087179184, 0.03868051618337631, 0.03350428491830826, -0.05534712225198746, 0.052252065390348434, -0.022762591019272804, -0.01841595396399498, 0.013228923082351685, 0.040962375700473785, 0.057450562715530396, -0.038247060030698776, -0.014590145088732243, 0.008123585022985935, -0.12619464099407196, 0.04230067878961563, -0.004590638447552919, -0.00532523263245821, 0.007512583397328854, -0.05471903830766678, 0.00004476633694139309, 0.022873181849718094, -0.06505187600851059, 0.03061877004802227, 0.01675790175795555, -0.07222159951925278, 0.08735296875238419, -0.12835893034934998, -0.005576066207140684, 0.0007256768876686692, 0.06328659504652023, -0.0547696053981781, -0.03925434499979019, -0.019004544243216515, 0.0554472915828228, 0.03667618706822395, 0.025778234004974365, 0.031075790524482727, 0.12462081015110016, -0.013541363179683685, 0.08390448242425919, -0.06556958705186844, 0.024443412199616432, -0.015694372355937958, -0.012851594015955925, 0.07829566299915314, 0.04298944026231766, -0.000542852736543864, -0.08256273716688156, 0.08490027487277985, -0.07559660077095032, 0.02034600079059601, 0.027208706364035606, -0.035746101289987564, 0.01192723773419857, 0.00870805699378252, -0.0357174314558506, -6.185756262766517e-8, -0.06318198144435883, 0.0481802262365818, -0.11033996194601059, 0.041580598801374435, -0.03530824929475784, 0.010513179935514927, 0.07819722592830658, 0.10947076976299286, -0.05295613035559654, -0.0036381252575665712, -0.0028534464072436094, 0.02681177668273449, -0.09770285338163376, 0.01835823804140091, 0.035479750484228134, -0.02772003412246704, 0.0651358962059021, 0.025667039677500725, -0.04659377783536911, 0.06143723428249359, 0.04214286804199219, -0.027116356417536736, 0.005321088712662458, 0.032805223017930984, 0.07025959342718124, 0.0518648587167263, 0.01988139934837818, 0.05299338325858116, 0.11449024081230164, 0.029658090323209763, -0.05688958615064621, 0.025178413838148117, -0.05250976234674454, -0.0011494052596390247, 0.05083921551704407, -0.015987372025847435, 0.061945050954818726, -0.03425469622015953, -0.11703989654779434, 0.005310922861099243, 0.07067858427762985, -0.08475717157125473, -0.014115787111222744, 0.023845255374908447, -0.01888495497405529, -0.005030096508562565, 0.05216054990887642, -0.034035664051771164, 0.06862657517194748, 0.011407725512981415, -0.05265725031495094, -0.037927351891994476, 0.019794965162873268, -0.01982446201145649, -0.03431539982557297, 0.0018166082445532084, 0.005063290242105722, 0.023372218012809753, 0.02589905820786953, -0.02887478657066822, 0.09063845872879028, -0.048500850796699524, 0.000016185003914870322, 0.0598035492002964 ]
0.019041
be considered. Suggestions that are within an area represented by a geohash can also be boosted higher than others, as shown by the following: [source,js] -------------------------------------------------- POST place/\_search?pretty { "suggest": { "place\_suggestion" : { "prefix" : "tim", "completion" : { "field" : "suggest", "size": 10, "contexts": { "location": [ <1> { "lat": 43.6624803, "lon": -79.3863353, "precision": 2 }, { "context": { "lat": 43.6624803, "lon": -79.3863353 }, "boost": 2 } ] } } } } } -------------------------------------------------- // CONSOLE // TEST[continued] <1> The context query filters for suggestions that fall under the geo location represented by a geohash of '(43.662, -79.380)' with a precision of '2' and boosts suggestions that fall under the geohash representation of '(43.6624803, -79.3863353)' with a default precision of '6' by a factor of `2` In addition to accepting context values, a context query can be composed of multiple context clauses. The following parameters are supported for a `category` context clause: [horizontal] `context`:: A geo point object or a geo hash string to filter or boost the suggestion by. This is mandatory. `boost`:: The factor by which the score of the suggestion should be boosted, the score is computed by multiplying the boost with the suggestion weight, defaults to `1` `precision`:: The precision of the geohash to encode the query geo point. This can be specified as a distance value (`5m`, `10km` etc.), or as a raw geohash precision (`1`..`12`). Defaults to index time precision level. `neighbours`:: Accepts an array of precision values at which neighbouring geohashes should be taken into account. precision value can be a distance value (`5m`, `10km` etc.) or a raw geohash precision (`1`..`12`). Defaults to generating neighbours for index time precision level.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/context-suggest.asciidoc
6.2
elasticsearch-6-2
[ -0.022941436618566513, 0.019322210922837257, 0.06479419767856598, -0.008920895867049694, 0.05403175577521324, 0.002085006097331643, 0.027183616533875465, -0.006015014834702015, 0.01410665176808834, -0.0684317797422409, -0.05616080388426781, 0.005968931596726179, 0.049734871834516525, 0.004465444479137659, 0.017383700236678123, 0.06610569357872009, 0.026264028623700142, 0.024020731449127197, -0.012930289842188358, -0.14958152174949646, 0.09630655497312546, 0.03320470079779625, 0.09477070719003677, -0.009336006827652454, 0.06475236266851425, 0.02804655022919178, -0.037759918719530106, 0.04866614192724228, 0.043034251779317856, 0.04030812159180641, -0.03989607095718384, 0.060007866472005844, -0.01735641621053219, -0.00213416013866663, -0.10908001661300659, 0.07218972593545914, -0.06315965205430984, 0.08499419689178467, 0.0710718184709549, 0.0163815189152956, -0.023730743676424026, 0.06724811345338821, 0.005356355104595423, -0.05725374445319176, -0.01485457457602024, -0.0623551569879055, 0.013419927097856998, 0.02650480531156063, -0.07580776512622833, 0.016144897788763046, -0.08174943923950195, -0.04269254207611084, -0.047278232872486115, -0.024228757247328758, -0.0493508018553257, 0.024659015238285065, -0.09087022393941879, -0.032030701637268066, 0.004394033923745155, -0.06550607830286026, -0.003917886409908533, -0.036516450345516205, -0.04728085547685623, -0.05182598903775215, 0.04786049947142601, -0.04190608859062195, 0.023568367585539818, 0.035776954144239426, -0.008393914438784122, -0.010595315136015415, 0.1255011111497879, -0.030192933976650238, -0.037477556616067886, -0.012619933113455772, 0.05701754614710808, 0.020640432834625244, -0.07641489803791046, -0.019482895731925964, -0.02126453071832657, 0.04465141519904137, -0.04380045086145401, -0.03803212195634842, 0.022700496017932892, 0.0488656610250473, -0.020819272845983505, -0.03983015939593315, -0.0507771335542202, -0.05490900203585625, 0.05355345830321312, -0.028342323377728462, -0.006903676316142082, -0.10038658231496811, -0.05117146670818329, 0.02140260487794876, -0.013945840299129486, 0.03674471005797386, -0.015561633743345737, -0.020698344334959984, 0.005759227555245161, 0.0830111876130104, 0.009019760414958, -0.0033131481613963842, -0.020183010026812553, -0.07932690531015396, 0.01854749023914337, 0.004528789781033993, -0.037134259939193726, 0.05954381451010704, 0.01342370081692934, 0.020198794081807137, -0.05266667157411575, 0.05307956784963608, -0.09029022604227066, -0.021190721541643143, -0.06687720119953156, 0.018863992765545845, 0.10536469519138336, -0.04447589069604874, 0.03963562846183777, 0.026026157662272453, 0.06321810185909271, -0.025509437546133995, -0.021895134821534157, -0.03367296978831291, -0.004347164183855057, 0.006517497822642326, -0.04345865920186043, -3.55483707823465e-33, 0.08671274781227112, 0.05739792063832283, 0.0979049801826477, -0.042188387364149094, -0.03316803276538849, 0.030940691009163857, -0.08802579343318939, 0.015920527279376984, -0.08197502791881561, -0.010796496644616127, 0.02015441469848156, 0.0734364464879036, 0.002599325031042099, -0.06316696107387543, 0.010488229803740978, -0.05306364595890045, 0.027158847078680992, 0.08026769012212753, -0.10906524211168289, 0.002431201748549938, -0.00234038638882339, -0.009346498176455498, -0.0709838792681694, -0.03049936704337597, 0.019554052501916885, -0.04547792300581932, 0.004805909004062414, 0.029274795204401016, -0.08199945837259293, -0.004270358942449093, -0.004877900239080191, -0.005535172298550606, -0.009322065860033035, -0.005834772251546383, 0.07780841737985611, 0.05279547721147537, -0.027710838243365288, -0.047671038657426834, 0.0030800788663327694, -0.0520949587225914, 0.020537422969937325, 0.013716413639485836, -0.03225797414779663, -0.07602351903915405, -0.022638840600848198, 0.04105883091688156, -0.042359452694654465, -0.02979898639023304, -0.05080205947160721, 0.06300590187311172, 0.02032744325697422, 0.035562627017498016, -0.04370691999793053, 0.042868051677942276, 0.016290968284010887, 0.03578939661383629, -0.0003075608692597598, 0.09932217001914978, 0.10009369999170303, 0.009894823655486107, 0.006168619263917208, -0.011820275336503983, 0.05639270320534706, -0.0036675725132226944, 0.0501566119492054, -0.055748675018548965, 0.03191431984305382, 0.09582127630710602, 0.04488329589366913, 0.0793088898062706, 0.03790595009922981, 0.08951815217733383, 0.0452774278819561, 0.05606839433312416, 0.0011101796990260482, -0.09435514360666275, -0.02939789928495884, 0.040321823209524155, 0.03875771164894104, -0.02296299673616886, -0.02695435658097267, -0.1154780238866806, -0.08870730549097061, 0.0018193618161603808, -0.00040550672565586865, 0.0352080874145031, 0.02816157601773739, -0.04392692446708679, -0.0517941378057003, -0.11379940807819366, -0.08260165899991989, 0.025961250066757202, -0.05215912684798241, -0.1278013437986374, -0.12183890491724014, 1.733731475240007e-33, 0.06666632741689682, -0.11780843883752823, 0.036360520869493484, 0.04243037849664688, 0.019675156101584435, -0.10604020208120346, 0.06418514996767044, 0.035448282957077026, 0.010478212498128414, 0.02214791253209114, -0.05432870239019394, -0.03927778825163841, 0.07726241648197174, -0.020628945901989937, 0.012245479971170425, 0.061198387295007706, 0.013157440349459648, -0.032873623073101044, -0.03092307411134243, 0.03974795341491699, -0.00870842207223177, 0.006835137493908405, -0.057842984795570374, 0.06218868866562843, -0.041400499641895294, -0.03688966855406761, -0.02315480262041092, 0.024572329595685005, -0.0873284637928009, -0.0068331374786794186, -0.06530450284481049, -0.017991291359066963, -0.061623334884643555, -0.024687228724360466, -0.08136280626058578, -0.006212197244167328, 0.01586468517780304, 0.03440327197313309, 0.02119453065097332, 0.09005171805620193, 0.010535546578466892, 0.03767171874642372, 0.0036378507502377033, 0.03784387186169624, -0.035026513040065765, 0.0018111035460606217, 0.007736507803201675, 0.0808006003499031, -0.026069724932312965, -0.011006942950189114, -0.023700332269072533, 0.07134491205215454, -0.09394705295562744, 0.07589208334684372, -0.02894839271903038, -0.00304283550940454, -0.02345910854637623, -0.03585821017622948, -0.04174220561981201, -0.02690262533724308, -0.059719134122133255, 0.011191453784704208, 0.011062921956181526, 0.03785617649555206, 0.12658604979515076, -0.12428329885005951, -0.03986673429608345, -0.03080105595290661, 0.04297010600566864, -0.008291267789900303, -0.04314285144209862, -0.024295158684253693, 0.06424249708652496, 0.030273403972387314, 0.05377480760216713, -0.04013784974813461, 0.13053183257579803, 0.06488621234893799, 0.07215055823326111, -0.057478561997413635, -0.003742855740711093, -0.010076090693473816, 0.01864185556769371, 0.07683267444372177, 0.052233580499887466, 0.032052990049123764, -0.07680277526378632, 0.11505395174026489, -0.035548705607652664, -0.023016715422272682, -0.03536408394575119, 0.01311979629099369, -0.03325749933719635, 0.030356911942362785, -0.05573222041130066, -5.458231200350383e-8, -0.12078173458576202, 0.0024520258884876966, -0.07330293953418732, 0.0767858698964119, 0.004114228300750256, 0.034394290298223495, 0.056772127747535706, 0.056500326842069626, -0.019943958148360252, -0.03852270171046257, 0.03349700942635536, 0.024107880890369415, -0.10679328441619873, -0.038391146808862686, 0.03756393492221832, -0.08382078260183334, -0.009937265887856483, 0.0720989853143692, -0.07161609828472137, 0.039335042238235474, 0.010882423259317875, 0.06388997286558151, 0.001663935836404562, 0.030087489634752274, 0.09274560213088989, 0.04514685645699501, -0.013470344245433807, 0.049192119389772415, 0.05231388285756111, 0.03240280598402023, -0.028170660138130188, 0.020257551223039627, -0.010088983923196793, -0.03493741527199745, -0.012677355669438839, -0.024550553411245346, -0.007534421980381012, 0.015705514699220657, -0.041097402572631836, 0.04358348995447159, 0.05544689670205116, -0.024741023778915405, -0.05107886716723442, 0.04884481057524681, 0.09470602124929428, 0.006813757587224245, 0.07914600521326065, -0.02900748886168003, 0.09545235335826874, -0.029923293739557266, -0.03557266667485237, -0.028740648180246353, -0.0023364564403891563, -0.006379712373018265, -0.003218246391043067, -0.012136965990066528, -0.006447898223996162, 0.007233940996229649, -0.009001601487398148, -0.006437088828533888, 0.06897740066051483, -0.061509136110544205, -0.024564629420638084, 0.06004087254405022 ]
0.033491
[[search-suggesters-term]] === Term suggester NOTE: In order to understand the format of suggestions, please read the <> page first. The `term` suggester suggests terms based on edit distance. The provided suggest text is analyzed before terms are suggested. The suggested terms are provided per analyzed suggest text token. The `term` suggester doesn't take the query into account that is part of request. ==== Common suggest options: [horizontal] `text`:: The suggest text. The suggest text is a required option that needs to be set globally or per suggestion. `field`:: The field to fetch the candidate suggestions from. This is an required option that either needs to be set globally or per suggestion. `analyzer`:: The analyzer to analyse the suggest text with. Defaults to the search analyzer of the suggest field. `size`:: The maximum corrections to be returned per suggest text token. `sort`:: Defines how suggestions should be sorted per suggest text term. Two possible values: + \*\* `score`: Sort by score first, then document frequency and then the term itself. \*\* `frequency`: Sort by document frequency first, then similarity score and then the term itself. + `suggest\_mode`:: The suggest mode controls what suggestions are included or controls for what suggest text terms, suggestions should be suggested. Three possible values can be specified: + \*\* `missing`: Only provide suggestions for suggest text terms that are not in the index. This is the default. \*\* `popular`: Only suggest suggestions that occur in more docs than the original suggest text term. \*\* `always`: Suggest any matching suggestions based on terms in the suggest text. ==== Other term suggest options: [horizontal] `lowercase\_terms`:: Lower cases the suggest text terms after text analysis. `max\_edits`:: The maximum edit distance candidate suggestions can have in order to be considered as a suggestion. Can only be a value between 1 and 2. Any other value result in an bad request error being thrown. Defaults to 2. `prefix\_length`:: The number of minimal prefix characters that must match in order be a candidate suggestions. Defaults to 1. Increasing this number improves spellcheck performance. Usually misspellings don't occur in the beginning of terms. (Old name "prefix\_len" is deprecated) `min\_word\_length`:: The minimum length a suggest text term must have in order to be included. Defaults to 4. (Old name "min\_word\_len" is deprecated) `shard\_size`:: Sets the maximum number of suggestions to be retrieved from each individual shard. During the reduce phase only the top N suggestions are returned based on the `size` option. Defaults to the `size` option. Setting this to a value higher than the `size` can be useful in order to get a more accurate document frequency for spelling corrections at the cost of performance. Due to the fact that terms are partitioned amongst shards, the shard level document frequencies of spelling corrections may not be precise. Increasing this will make these document frequencies more precise. `max\_inspections`:: A factor that is used to multiply with the `shards\_size` in order to inspect more candidate spell corrections on the shard level. Can improve accuracy at the cost of performance. Defaults to 5. `min\_doc\_freq`:: The minimal threshold in number of documents a suggestion should appear in. This can be specified as an absolute number or as a relative percentage of number of documents. This can improve quality by only suggesting high frequency terms. Defaults to 0f and is not enabled. If a value higher than 1 is specified then the number cannot be fractional. The shard level document frequencies are used for this option. `max\_term\_freq`:: The maximum threshold in number of documents a suggest text token can exist in order to be included. Can be a
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/term-suggest.asciidoc
6.2
elasticsearch-6-2
[ -0.019405722618103027, 0.03235705569386482, -0.026167282834649086, 0.02618822082877159, 0.03239143639802933, 0.03274812176823616, 0.04060487821698189, 0.08595047891139984, -0.014617592096328735, 0.001768929767422378, 0.009458400309085846, -0.05992976203560829, 0.07713951170444489, 0.006285141222178936, -0.01412104070186615, 0.0494375005364418, -0.039188578724861145, -0.12033653259277344, 0.011538651771843433, -0.09948772192001343, 0.06411702930927277, 0.08361516147851944, 0.0765107274055481, -0.06850653886795044, -0.02555236406624317, -0.01597406715154648, -0.07282975316047668, 0.05544665455818176, 0.01949554868042469, 0.07294198125600815, -0.010898936539888382, 0.11004359275102615, 0.029447104781866074, 0.09675811976194382, -0.0798114612698555, -0.029474128037691116, -0.12785843014717102, 0.011112982407212257, 0.02201712317764759, -0.006524168886244297, -0.05869337543845177, 0.03437790274620056, -0.013332025147974491, -0.007581750396639109, -0.02876306138932705, -0.03681018203496933, -0.034195829182863235, -0.03800324723124504, -0.016222752630710602, 0.05843697488307953, -0.17393366992473602, 0.015729716047644615, -0.016544029116630554, -0.03717692196369171, -0.015667438507080078, 0.029406949877738953, -0.06173080578446388, -0.03229605033993721, 0.04594568535685539, -0.1282961070537567, -0.04509551450610161, -0.06949644535779953, -0.03331133350729942, -0.04601581022143364, -0.018669188022613525, -0.034837428480386734, 0.039522551000118256, 0.007033174391835928, 0.02257572114467621, 0.024752652272582054, 0.02548789046704769, 0.05083800107240677, -0.06921931356191635, -0.07594157755374908, 0.011938593350350857, 0.05705932155251503, -0.052162036299705505, -0.03871677815914154, -0.01706322655081749, -0.02400956302881241, -0.1182962954044342, -0.03482338786125183, 0.017299387603998184, 0.03249578922986984, 0.0216962993144989, -0.024734770879149437, 0.04200619459152222, -0.08461811393499374, 0.07716013491153717, 0.03403428941965103, 0.00471209641546011, -0.12441497296094894, -0.053273264318704605, -0.009938692674040794, 0.024519620463252068, 0.045844100415706635, -0.05357517674565315, -0.010230339132249355, 0.02384045347571373, 0.0024764363188296556, 0.03043585643172264, -0.020582083612680435, 0.026355421170592308, -0.06946016103029251, -0.12539878487586975, -0.037851959466934204, 0.0420161597430706, 0.02216021530330181, 0.09319205582141876, 0.006388458423316479, -0.06075155362486839, 0.0291778314858675, -0.05554690957069397, 0.003621532814577222, -0.03658829256892204, 0.0034220558591187, 0.13002543151378632, -0.06146801635622978, 0.051875192672014236, 0.06784206628799438, 0.06101212650537491, 0.03851483762264252, -0.02589457295835018, -0.054383285343647, 0.011171836405992508, 0.033030930906534195, 0.022693432867527008, 5.940177030888114e-33, 0.009633452631533146, -0.015830906108021736, 0.0263974629342556, -0.00499638170003891, -0.09202903509140015, 0.0398888923227787, -0.04287271201610565, 0.0897640585899353, -0.10393553972244263, -0.008079923689365387, -0.000414116628235206, 0.08206408470869064, -0.002552774967625737, 0.02298506163060665, 0.04035104066133499, -0.02229495905339718, 0.06296353787183762, 0.01994536817073822, -0.02247217297554016, -0.02571307122707367, 0.08389859646558762, 0.012972992844879627, -0.029252059757709503, -0.04258933663368225, -0.0069289663806557655, -0.011627438478171825, 0.039121631532907486, -0.004834215622395277, -0.02014544978737831, -0.03156382590532303, -0.06221836432814598, -0.04336250573396683, 0.007897735573351383, -0.004412353038787842, 0.05677890032529831, 0.041480112820863724, 0.0032113934867084026, 0.06096130982041359, -0.030947737395763397, -0.031409814953804016, -0.009533997625112534, 0.01121927984058857, 0.019300371408462524, -0.07106012105941772, 0.021744495257735252, -0.024537112563848495, -0.06948302686214447, 0.055396806448698044, 0.041152458637952805, 0.05397312343120575, -0.01869397796690464, 0.009370864368975163, -0.0065767355263233185, 0.09843888133764267, 0.036588434129953384, 0.07107333838939667, -0.018636681139469147, 0.10328556597232819, 0.007761322893202305, -0.015458635985851288, -0.002925425535067916, -0.028603632003068924, 0.04176386073231697, -0.062458205968141556, 0.05359030142426491, 0.0267646424472332, 0.0687040239572525, 0.05034865438938141, 0.11694909632205963, 0.024314675480127335, -0.03425367549061775, 0.03174153342843056, 0.06752891838550568, 0.030135713517665863, 0.009638199582695961, -0.08011169731616974, 0.012897943146526814, -0.03672219067811966, -0.010441367514431477, -0.03005399741232395, -0.04535648971796036, -0.041808608919382095, -0.025244688615202904, -0.03731628879904747, -0.017837319523096085, 0.004641784355044365, 0.05642077326774597, -0.04430965334177017, -0.04862361028790474, -0.09144826978445053, 0.023869328200817108, 0.060823600739240646, -0.06689769774675369, 0.0064245411194860935, -0.011178716085851192, -7.172316985108589e-33, 0.03354552760720253, -0.07836681604385376, 0.04134930670261383, 0.017191018909215927, 0.10127013176679611, -0.07248269766569138, -0.008573380298912525, -0.0053718117997050285, 0.09329064190387726, -0.06980599462985992, -0.060578033328056335, -0.08694335073232651, 0.02412809431552887, 0.0058164577931165695, 0.029924044385552406, 0.10651640594005585, -0.09794565290212631, 0.013556664809584618, -0.028474146500229836, 0.06095153093338013, -0.05248260870575905, 0.0022538863122463226, -0.019131606444716454, 0.009260312654078007, -0.02947918139398098, -0.014022095128893852, 0.10363934189081192, 0.04001672565937042, -0.019370445981621742, -0.04368121922016144, -0.04095299914479256, -0.0160625372081995, -0.09871009737253189, 0.04746219515800476, -0.027055714279413223, -0.04102640599012375, 0.02096516452729702, -0.010940314270555973, -0.034079063683748245, 0.16437122225761414, 0.07470263540744781, 0.11857350170612335, 0.0023615900427103043, -0.0026894535403698683, -0.018477415665984154, 0.004936737474054098, 0.003048477927222848, -0.0003535173600539565, -0.009528132155537605, -0.06995240598917007, 0.030495500192046165, 0.005747124087065458, -0.1078440397977829, -0.012551763094961643, -0.031354453414678574, -0.025109734386205673, 0.04545912891626358, 0.01701989397406578, -0.027401763945817947, -0.03826881945133209, -0.028337989002466202, 0.03323378786444664, 0.037530139088630676, 0.0038263730239123106, 0.07154973596334457, -0.06794853508472443, -0.025355543941259384, -0.03895321860909462, -0.013835357502102852, 0.0017009018920361996, -0.06869181990623474, -0.03972822055220604, 0.05534476786851883, 0.004774424247443676, 0.04156440868973732, 0.02215745858848095, 0.02211441658437252, -0.02787601947784424, 0.0767209604382515, -0.04835127666592598, 0.0237901508808136, 0.07851526886224747, -0.027383506298065186, 0.028851887211203575, -0.041631296277046204, -0.00975564494729042, -0.011996903456747532, 0.1635773479938507, -0.08042575418949127, -0.015035531483590603, 0.04758884012699127, -0.095333531498909, 0.060775481164455414, -0.013329197652637959, -0.04871974512934685, -5.517536294519232e-8, -0.028257770463824272, -0.021221043542027473, -0.07529987394809723, 0.10783219337463379, 0.018884357064962387, 0.02233636938035488, 0.004854027181863785, 0.008385889232158661, -0.018925834447145462, -0.0376238115131855, 0.07882548123598099, 0.008451592177152634, -0.10435314476490021, -0.010835781693458557, -0.009299444034695625, -0.056708142161369324, -0.020995890721678734, -0.00727600185200572, -0.052486930042505264, -0.025215743109583855, -0.036527782678604126, -0.02035077102482319, -0.011213521473109722, 0.054770030081272125, 0.050906598567962646, 0.029850497841835022, -0.02777429297566414, 0.07787062227725983, -0.0027630431577563286, 0.06602735817432404, 0.0018315952038392425, 0.025510668754577637, 0.018040252849459648, -0.06732413917779922, 0.023079033941030502, -0.022512570023536682, 0.03548746928572655, 0.016914980486035347, -0.01808859035372734, 0.05935585871338844, 0.024237005040049553, -0.02077077142894268, -0.08179259300231934, -0.016936035826802254, 0.019612278789281845, -0.04567273333668709, 0.02836533449590206, -0.050857651978731155, 0.09115113317966461, -0.0674758180975914, -0.00833631120622158, -0.06749054789543152, 0.006813366431742907, 0.01780186966061592, 0.01198266539722681, 0.05777591094374657, 0.01503292378038168, 0.049250420182943344, 0.031012848019599915, -0.06778556108474731, 0.06125983968377113, -0.006324982736259699, -0.000974096532445401, 0.08278278261423111 ]
0.057907
and is not enabled. If a value higher than 1 is specified then the number cannot be fractional. The shard level document frequencies are used for this option. `max\_term\_freq`:: The maximum threshold in number of documents a suggest text token can exist in order to be included. Can be a relative percentage number (e.g 0.4) or an absolute number to represent document frequencies. If an value higher than 1 is specified then fractional can not be specified. Defaults to 0.01f. This can be used to exclude high frequency terms from being spellchecked. High frequency terms are usually spelled correctly on top of this also improves the spellcheck performance. The shard level document frequencies are used for this option. `string\_distance`:: Which string distance implementation to use for comparing how similar suggested terms are. Five possible values can be specified: `internal` - The default based on damerau\_levenshtein but highly optimized for comparing string distance for terms inside the index. `damerau\_levenshtein` - String distance algorithm based on Damerau-Levenshtein algorithm. `levenshtein` - String distance algorithm based on Levenshtein edit distance algorithm. `jaro\_winkler` - String distance algorithm based on Jaro-Winkler algorithm. `ngram` - String distance algorithm based on character n-grams.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/term-suggest.asciidoc
6.2
elasticsearch-6-2
[ 0.031278789043426514, -0.03927381709218025, -0.05455334484577179, -0.06548584997653961, -0.044443726539611816, 0.013039846904575825, -0.017046794295310974, 0.029308514669537544, 0.0371534526348114, -0.023488899692893028, -0.015469393692910671, 0.01425210852175951, 0.036261484026908875, -0.032404907047748566, 0.01020726002752781, -0.005065008997917175, 0.022422615438699722, -0.057828668504953384, -0.11435484141111374, -0.06321845203638077, 0.0862894207239151, 0.06327269226312637, 0.0936964899301529, -0.028678975999355316, -0.008653408847749233, -0.026552775874733925, -0.1025398001074791, 0.011560422368347645, 0.03168913722038269, 0.04974959045648575, 0.024876346811652184, 0.10578477382659912, 0.013730224221944809, -0.04626884683966637, -0.04810752347111702, -0.03921956196427345, -0.02835150621831417, -0.008798051625490189, 0.0024044285528361797, -0.010516506619751453, -0.10369783639907837, -0.052279431372880936, -0.11948423087596893, 0.09026282280683517, -0.02095622383058071, 0.03160921111702919, -0.058891523629426956, 0.04976113885641098, -0.042188528925180435, 0.04911874234676361, -0.04347952827811241, 0.015256323851644993, -0.0028865626081824303, 0.05208313465118408, -0.04474284127354622, -0.040378767997026443, -0.10734333097934723, 0.01235930435359478, 0.004811839200556278, -0.052122704684734344, -0.08162037283182144, -0.016681326553225517, -0.0399181954562664, -0.027060838416218758, 0.00238386495038867, -0.006978006102144718, 0.023901518434286118, -0.08139670640230179, 0.0022888961248099804, 0.027721630409359932, -0.05445248633623123, 0.036764487624168396, 0.013027836568653584, 0.0720292255282402, -0.007234422955662012, 0.09142488241195679, -0.02397720329463482, -0.06030794605612755, 0.09016308933496475, -0.09920509904623032, -0.08103429526090622, -0.039892248809337616, 0.10329480469226837, 0.026401156559586525, 0.01779758930206299, -0.040579672902822495, 0.08880830556154251, -0.010836255736649036, 0.08476655185222626, 0.017555609345436096, 0.10228224843740463, -0.07908866554498672, 0.0375920832157135, -0.0703943595290184, 0.047565359622240067, -0.013461870141327381, -0.06518411636352539, 0.05327565222978592, 0.008579469285905361, 0.009834829717874527, 0.03138201683759689, -0.029553741216659546, -0.0191408172249794, -0.050124362111091614, -0.06247677654027939, 0.008079488761723042, 0.047935761511325836, 0.02116774395108223, 0.10541008412837982, -0.024560747668147087, -0.002342675579711795, -0.03190625086426735, -0.0024271768052130938, -0.0690506249666214, -0.022465022280812263, -0.042886022478342056, 0.11055424809455872, -0.0635831356048584, 0.04144139587879181, -0.01687854342162609, -0.014818091876804829, -0.05347935110330582, 0.038570336997509, -0.04729390889406204, 0.000903419975657016, -0.034092530608177185, -0.021138763055205345, 7.308909428674139e-33, 0.008180925622582436, 0.07079316675662994, -0.01638488471508026, -0.03126153349876404, -0.06473640352487564, 0.05554290860891342, -0.07838723808526993, 0.0778888389468193, -0.09793540090322495, -0.019613081589341164, -0.03398098051548004, 0.0310140922665596, 0.046987008303403854, -0.027457943186163902, 0.038421858102083206, -0.034605469554662704, 0.08429864048957825, 0.04048020765185356, -0.02987654134631157, -0.03377997502684593, 0.05721785128116608, -0.03182243928313255, 0.04841785505414009, -0.027549296617507935, -0.01903030090034008, 0.022391770035028458, -0.0068186563439667225, -0.011835304088890553, 0.028477560728788376, 0.009704862721264362, -0.00985157024115324, -0.07452797889709473, 0.024498343467712402, -0.07945910096168518, 0.04314381629228592, 0.058487702161073685, 0.02356324903666973, 0.0043962630443274975, 0.004524566698819399, -0.048330530524253845, -0.01729493774473667, -0.010239625349640846, 0.08909205347299576, -0.05184273421764374, -0.02933577634394169, 0.034876227378845215, -0.030109763145446777, 0.08949200063943863, -0.021990904584527016, 0.014306343160569668, 0.002346404129639268, 0.026312004774808884, -0.014761633239686489, 0.042988717555999756, 0.0633130669593811, 0.007842032238841057, 0.003606483107432723, -0.005044798832386732, 0.024729883298277855, 0.04280472919344902, -0.0225797351449728, 0.013200730085372925, 0.06040849909186363, -0.010449542663991451, 0.02221842110157013, -0.06570649892091751, -0.04562636837363243, 0.09048917889595032, 0.06542851030826569, 0.08764786273241043, 0.00446067750453949, 0.056670431047677994, -0.010091304779052734, 0.04670717939734459, -0.014730028808116913, -0.027344215661287308, 0.07617460936307907, -0.06544379889965057, -0.11202372610569, 0.0015269932337105274, -0.09638500958681107, -0.0289737768471241, 0.002439916366711259, -0.05425374209880829, -0.08706584572792053, -0.0014288289239630103, 0.05341457575559616, -0.041754018515348434, -0.06894738227128983, -0.05163361132144928, 0.03493194282054901, 0.018713176250457764, 0.005024452693760395, -0.042764995247125626, -0.025518227368593216, -8.426854514816044e-33, -0.019094202667474747, -0.09628607332706451, -0.02610158920288086, 0.08336828649044037, -0.006256768014281988, -0.01525874063372612, 0.11357948929071426, 0.04998336732387543, 0.0674835592508316, -0.08595360815525055, 0.032195769250392914, -0.029313744977116585, 0.015470246784389019, -0.05537700280547142, -0.013129673898220062, 0.02661469765007496, -0.11645397543907166, 0.004492658656090498, 0.06803833693265915, 0.12351301312446594, 0.04041271284222603, -0.03526906669139862, -0.060720767825841904, 0.15480317175388336, -0.02045128494501114, 0.009573864750564098, -0.030366666615009308, -0.04499909654259682, -0.03182581067085266, -0.016062812879681587, -0.04948732629418373, -0.01805170625448227, -0.04994262009859085, -0.005993179976940155, -0.066177137196064, -0.08983702212572098, 0.006892332807183266, 0.00989625882357359, -0.004346834495663643, 0.1188601404428482, 0.07639802992343903, 0.0435686819255352, -0.01472972147166729, -0.017140556126832962, -0.044943127781152725, -0.03421816974878311, -0.04192155599594116, 0.04427308589220047, 0.022719329223036766, -0.015173960477113724, 0.04527667909860611, -0.04137765243649483, -0.02472066320478916, 0.11284676194190979, 0.011077525094151497, 0.08700055629014969, -0.06283526867628098, -0.034227579832077026, -0.10226495563983917, 0.030045604333281517, -0.024846060201525688, 0.021383922547101974, 0.04354015365242958, -0.008228353224694729, 0.08026567846536636, -0.00801145937293768, 0.029577696695923805, 0.05156858637928963, 0.03615584596991539, -0.05590488389134407, -0.050046905875205994, -0.03351739048957825, 0.04347505792975426, 0.0382314957678318, -0.02880353108048439, -0.05624717101454735, 0.07582300156354904, -0.06678230315446854, -0.0026780199259519577, 0.04320286959409714, 0.01687774993479252, 0.09590742737054825, -0.05567833036184311, 0.021026823669672012, -0.0017717466689646244, -0.02476528100669384, -0.0016337502747774124, 0.055208101868629456, -0.024961020797491074, 0.007676356006413698, 0.01677614077925682, 0.040876924991607666, 0.011243577115237713, -0.027114050462841988, -0.05381275713443756, -5.664863067522674e-8, -0.013100065290927887, -0.027066385373473167, -0.054835643619298935, -0.010617226362228394, 0.009616238996386528, -0.03498218581080437, 0.022695370018482208, -0.03889890015125275, -0.041078802198171616, -0.033212240785360336, 0.12289842963218689, 0.011520790867507458, -0.11133255064487457, -0.08214980363845825, 0.07710053771734238, -0.013495366089046001, 0.06641685962677002, 0.01712433621287346, -0.04339960962533951, -0.07453756779432297, -0.025865081697702408, 0.009808630682528019, -0.02845839224755764, 0.022443925961852074, -0.0014579942217096686, 0.04454445838928223, -0.03567799925804138, 0.05761674419045448, -0.016958560794591904, 0.0022555722389370203, 0.03025074303150177, 0.02873470075428486, 0.0042883483693003654, -0.06779252737760544, 0.015284135937690735, 0.1028461679816246, -0.05730907991528511, 0.06377806514501572, -0.008344665169715881, 0.11848714202642441, 0.054466363042593, -0.025347771123051643, -0.047372374683618546, -0.001870885374955833, 0.031051702797412872, -0.07052087038755417, -0.014037871733307838, 0.002809588797390461, -0.009424915537238121, -0.0043229106813669205, 0.022716805338859558, 0.06912709772586823, 0.06425292044878006, 0.004027281887829304, -0.009154080413281918, -0.013805902563035488, -0.028724392876029015, -0.019636141136288643, -0.06827430427074432, -0.021824324503540993, 0.12843073904514313, -0.03245964273810387, 0.07852700352668762, -0.04275025054812431 ]
0.061958
[[search-suggesters-completion]] === Completion Suggester NOTE: In order to understand the format of suggestions, please read the <> page first. The `completion` suggester provides auto-complete/search-as-you-type functionality. This is a navigational feature to guide users to relevant results as they are typing, improving search precision. It is not meant for spell correction or did-you-mean functionality like the `term` or `phrase` suggesters. Ideally, auto-complete functionality should be as fast as a user types to provide instant feedback relevant to what a user has already typed in. Hence, `completion` suggester is optimized for speed. The suggester uses data structures that enable fast lookups, but are costly to build and are stored in-memory. [[completion-suggester-mapping]] ==== Mapping To use this feature, specify a special mapping for this field, which indexes the field values for fast completions. [source,js] -------------------------------------------------- PUT music { "mappings": { "\_doc" : { "properties" : { "suggest" : { "type" : "completion" }, "title" : { "type": "keyword" } } } } } -------------------------------------------------- // CONSOLE // TESTSETUP Mapping supports the following parameters: `analyzer`:: The index analyzer to use, defaults to `simple`. In case you are wondering why we did not opt for the `standard` analyzer: We try to have easy to understand behaviour here, and if you index the field content `At the Drive-in`, you will not get any suggestions for `a`, nor for `d` (the first non stopword). `search\_analyzer`:: The search analyzer to use, defaults to value of `analyzer`. `preserve\_separators`:: Preserves the separators, defaults to `true`. If disabled, you could find a field starting with `Foo Fighters`, if you suggest for `foof`. `preserve\_position\_increments`:: Enables position increments, defaults to `true`. If disabled and using stopwords analyzer, you could get a field starting with `The Beatles`, if you suggest for `b`. \*Note\*: You could also achieve this by indexing two inputs, `Beatles` and `The Beatles`, no need to change a simple analyzer, if you are able to enrich your data. `max\_input\_length`:: Limits the length of a single input, defaults to `50` UTF-16 code points. This limit is only used at index time to reduce the total number of characters per input string in order to prevent massive inputs from bloating the underlying datastructure. Most usecases won't be influenced by the default value since prefix completions seldom grow beyond prefixes longer than a handful of characters. [[indexing]] ==== Indexing You index suggestions like any other field. A suggestion is made of an `input` and an optional `weight` attribute. An `input` is the expected text to be matched by a suggestion query and the `weight` determines how the suggestions will be scored. Indexing a suggestion is as follows: [source,js] -------------------------------------------------- PUT music/\_doc/1?refresh { "suggest" : { "input": [ "Nevermind", "Nirvana" ], "weight" : 34 } } -------------------------------------------------- // CONSOLE // TEST The following parameters are supported: `input`:: The input to store, this can be an array of strings or just a string. This field is mandatory. `weight`:: A positive integer or a string containing a positive integer, which defines a weight and allows you to rank your suggestions. This field is optional. You can index multiple suggestions for a document as follows: [source,js] -------------------------------------------------- PUT music/\_doc/1?refresh { "suggest" : [ { "input": "Nevermind", "weight" : 10 }, { "input": "Nirvana", "weight" : 3 } ] } -------------------------------------------------- // CONSOLE // TEST[continued] You can use the following shorthand form. Note that you can not specify a weight with suggestion(s) in the shorthand form. [source,js] -------------------------------------------------- PUT music/\_doc/1?refresh { "suggest" : [ "Nevermind", "Nirvana" ] } -------------------------------------------------- // CONSOLE // TEST[continued] [[querying]] ==== Querying Suggesting works as usual, except that you have to specify the suggest type
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/completion-suggest.asciidoc
6.2
elasticsearch-6-2
[ -0.08628790080547333, -0.017435606569051743, 0.06049566715955734, 0.03190295770764351, 0.009644867852330208, -0.0022423435002565384, 0.07470782101154327, -0.00658355001360178, 0.03889615088701248, -0.06285912543535233, -0.028129318729043007, 0.05071244388818741, -0.006183498539030552, -0.037916284054517746, -0.001859038951806724, 0.0195463839918375, 0.012119968421757221, -0.037649963051080704, -0.0039012106135487556, -0.16176994144916534, 0.03716421127319336, 0.046347685158252716, 0.05033808574080467, -0.012261162512004375, 0.005569483619183302, -0.017458351328969002, -0.09461740404367447, -0.02535635605454445, 0.03496304526925087, 0.04052628204226494, -0.03898927569389343, 0.08088605105876923, 0.031648579984903336, -0.006739357486367226, -0.17467376589775085, 0.007823155261576176, -0.1314750760793686, 0.09078536182641983, 0.008771720342338085, -0.031091434881091118, -0.09282351285219193, 0.020259717479348183, -0.0360565260052681, 0.04461405798792839, -0.031271785497665405, -0.025504089891910553, -0.022201862186193466, -0.022288821637630463, -0.030740248039364815, -0.005937250796705484, -0.1417115479707718, 0.0071050552651286125, -0.008751415647566319, -0.01491010282188654, -0.019188711419701576, 0.031175700947642326, -0.11051758378744125, 0.007471620570868254, 0.0016932502621784806, -0.0311779472976923, -0.057443536818027496, -0.04963163286447525, -0.00691710039973259, -0.021710867062211037, 0.09050945937633514, -0.012705984525382519, 0.0741741731762886, -0.03621453046798706, 0.009722385555505753, 0.04287078231573105, 0.07340807467699051, 0.033926744014024734, -0.018442165106534958, -0.013625395484268665, 0.02328394167125225, -0.01117931678891182, -0.03769056499004364, -0.031176503747701645, -0.008304798044264317, 0.02237674780189991, -0.07538605481386185, -0.044543638825416565, 0.02638642117381096, 0.03698435425758362, -0.025998428463935852, 0.03264707326889038, 0.039790503680706024, -0.049415718764066696, 0.08710694313049316, -0.0022592616733163595, 0.027151605114340782, -0.16594497859477997, -0.03279354050755501, -0.015732314437627792, -0.00740796746686101, 0.05088294669985771, -0.0023894570767879486, -0.037074748426675797, -0.026602810248732567, -0.0033626018557697535, 0.05389271676540375, 0.010670437477529049, 0.04620353877544403, -0.06172020733356476, -0.07422281056642532, -0.04502803087234497, 0.0701916292309761, 0.08197379857301712, 0.03527553007006645, 0.030375495553016663, -0.05192817747592926, 0.02900310792028904, -0.04611792787909508, -0.009470363147556782, -0.08548492193222046, 0.014028985053300858, 0.06321758776903152, -0.10844402760267258, 0.14035876095294952, 0.08886803686618805, 0.051015738397836685, 0.039792533963918686, -0.01380572747439146, -0.05907423421740532, 0.004898137412965298, -0.02734697051346302, -0.023758310824632645, 3.41692257086641e-33, -0.017488962039351463, 0.057903777807950974, -0.01959727331995964, 0.01926073431968689, -0.09052281826734543, 0.01663634367287159, -0.06685589998960495, 0.06544867157936096, -0.09408925473690033, -0.03301714360713959, -0.002532872138544917, 0.03690860792994499, -0.04893558844923973, 0.0814993605017662, -0.029494287446141243, -0.08285333216190338, 0.06768578290939331, 0.08591104298830032, -0.10165338218212128, -0.013399417512118816, 0.08800899982452393, 0.034370601177215576, 0.006710744928568602, -0.01645776629447937, 0.035786863416433334, -0.03946991637349129, 0.003477211808785796, 0.045308563858270645, -0.004256925545632839, -0.03285672888159752, -0.04026494175195694, -0.0378074124455452, -0.0371428057551384, -0.01311191264539957, 0.032838501036167145, 0.01396836806088686, 0.04391179978847504, -0.029551329091191292, 0.013500958681106567, -0.05403329059481621, 0.01827525533735752, 0.02325471304357052, -0.014645692892372608, -0.056278299540281296, -0.03626737743616104, -0.04183851182460785, -0.06685864925384521, 0.056699853390455246, -0.02164008468389511, 0.08187518268823624, 0.04354177042841911, 0.0515470951795578, -0.09061954915523529, 0.06295590847730637, 0.01925075612962246, 0.07233544439077377, -0.010950383730232716, 0.02944786660373211, 0.03229350224137306, 0.05020437017083168, 0.005575322080403566, -0.03244159743189812, -0.00023471013992093503, -0.008432364091277122, 0.002845032373443246, 0.009720736183226109, 0.057762663811445236, 0.0622708685696125, 0.09837178885936737, -0.019033396616578102, -0.015472345985472202, -0.012503198347985744, 0.06087259575724602, -0.004840787500143051, 0.04240908473730087, -0.08490561693906784, -0.0722452700138092, -0.11163488030433655, 0.005153076257556677, -0.02325175516307354, -0.06062060967087746, -0.01597435213625431, -0.04612322896718979, -0.006379419472068548, 0.0201168991625309, -0.030405905097723007, 0.03358788415789604, -0.0877017080783844, 0.009556683711707592, -0.03975190967321396, 0.011063632555305958, 0.08907029032707214, -0.04689662903547287, -0.008408972062170506, -0.07225874066352844, -5.221242481873295e-33, 0.058722496032714844, -0.10541749000549316, 0.047055233269929886, 0.11533674597740173, 0.027073411270976067, -0.07347573339939117, -0.02296128310263157, -0.026851879432797432, 0.07631940394639969, -0.09046416729688644, -0.037899840623140335, -0.009956404566764832, 0.037281155586242676, -0.019846834242343903, -0.034126412123441696, 0.08156123012304306, 0.006542928051203489, -0.031603045761585236, -0.0022756969556212425, 0.027112092822790146, 0.010763760656118393, 0.0023395235184580088, -0.03919707238674164, 0.014514680951833725, -0.07883765548467636, 0.02066371589899063, 0.019956212490797043, 0.08059149980545044, -0.01825796067714691, -0.014369091019034386, -0.047809407114982605, 0.02105080522596836, -0.07905148714780807, -0.042935166507959366, -0.03424564003944397, 0.030155690386891365, -0.013872364535927773, 0.09332041442394257, -0.04849692061543465, 0.06796222925186157, 0.11219452321529388, 0.030868375673890114, -0.0027508612256497145, -0.014161559753119946, -0.03742658346891403, -0.026568982750177383, -0.017540492117404938, 0.035397663712501526, 0.08493032306432724, 0.04017024114727974, 0.04490124434232712, -0.01999829337000847, -0.11667515337467194, 0.003538521472364664, 0.009847132489085197, -0.021950358524918556, -0.006078936625272036, -0.0491102896630764, -0.01491559948772192, -0.006153529975563288, -0.08465611189603806, -0.0167310182005167, 0.1061425730586052, 0.019442781805992126, 0.04736090824007988, -0.1115473136305809, 0.013011913746595383, 0.02194381132721901, 0.08101672679185867, -0.017840391024947166, -0.007667320314794779, 0.025571012869477272, 0.03239426761865616, 0.01915883831679821, 0.021234892308712006, -0.059314463287591934, 0.10306952148675919, -0.03263931721448898, 0.05177142843604088, -0.1075831726193428, 0.03725535795092583, 0.065769724547863, -0.024512985721230507, 0.01594085805118084, -0.042676955461502075, 0.026419300585985184, -0.03262553736567497, 0.07622876763343811, -0.016959303990006447, 0.023302769288420677, 0.05728711560368538, 0.009541209787130356, 0.024472080171108246, 0.011801055632531643, -0.10550915449857712, -5.3769419139371166e-8, -0.02895953319966793, 0.024567963555455208, -0.11516822874546051, -0.015029293484985828, 0.02356179989874363, -0.07108550518751144, 0.007089974824339151, 0.1120496615767479, 0.015400255098938942, -0.06415784358978271, 0.05894186720252037, -0.008176479488611221, -0.033190444111824036, -0.01983923465013504, 0.06020312383770943, 0.003146321512758732, 0.059613488614559174, 0.021675102412700653, -0.053070925176143646, -0.022114254534244537, -0.0023261182941496372, -0.024288145825266838, -0.06308817118406296, 0.014371414668858051, 0.06724116206169128, 0.07549284398555756, -0.019463064149022102, 0.05897140130400658, 0.012564893811941147, 0.06180940940976143, -0.030458780005574226, 0.08188080787658691, 0.010555656626820564, -0.0381334163248539, 0.07970739156007767, -0.025560922920703888, 0.02324732579290867, -0.037938859313726425, -0.03569122403860092, 0.028823841363191605, 0.06557521224021912, -0.03270944580435753, -0.024188144132494926, -0.0003471396630629897, 0.04179640859365463, -0.043446920812129974, -0.010847441852092743, -0.06645778566598892, 0.044184610247612, -0.0641377717256546, 0.048505451530218124, 0.003972213249653578, 0.01931435614824295, 0.00587273295968771, 0.028253955766558647, 0.02588360384106636, 0.01694047451019287, 0.017444400116801262, 0.043134380131959915, -0.02387276105582714, 0.02806503139436245, -0.007198854349553585, 0.002961191814392805, 0.054314859211444855 ]
0.110265
following shorthand form. Note that you can not specify a weight with suggestion(s) in the shorthand form. [source,js] -------------------------------------------------- PUT music/\_doc/1?refresh { "suggest" : [ "Nevermind", "Nirvana" ] } -------------------------------------------------- // CONSOLE // TEST[continued] [[querying]] ==== Querying Suggesting works as usual, except that you have to specify the suggest type as `completion`. Suggestions are near real-time, which means new suggestions can be made visible by <> and documents once deleted are never shown. This request: [source,js] -------------------------------------------------- POST music/\_search?pretty { "suggest": { "song-suggest" : { "prefix" : "nir", <1> "completion" : { <2> "field" : "suggest" <3> } } } } -------------------------------------------------- // CONSOLE // TEST[continued] <1> Prefix used to search for suggestions <2> Type of suggestions <3> Name of the field to search for suggestions in returns this response: [source,js] -------------------------------------------------- { "\_shards" : { "total" : 5, "successful" : 5, "skipped" : 0, "failed" : 0 }, "hits": ... "took": 2, "timed\_out": false, "suggest": { "song-suggest" : [ { "text" : "nir", "offset" : 0, "length" : 3, "options" : [ { "text" : "Nirvana", "\_index": "music", "\_type": "\_doc", "\_id": "1", "\_score": 1.0, "\_source": { "suggest": ["Nevermind", "Nirvana"] } } ] } ] } } -------------------------------------------------- // TESTRESPONSE[s/"hits": .../"hits": "$body.hits",/] // TESTRESPONSE[s/"took": 2,/"took": "$body.took",/] IMPORTANT: `\_source` meta-field must be enabled, which is the default behavior, to enable returning `\_source` with suggestions. The configured weight for a suggestion is returned as `\_score`. The `text` field uses the `input` of your indexed suggestion. Suggestions return the full document `\_source` by default. The size of the `\_source` can impact performance due to disk fetch and network transport overhead. To save some network overhead, filter out unnecessary fields from the `\_source` using <> to minimize `\_source` size. Note that the \_suggest endpoint doesn't support source filtering but using suggest on the `\_search` endpoint does: [source,js] -------------------------------------------------- POST music/\_search { "\_source": "suggest", <1> "suggest": { "song-suggest" : { "prefix" : "nir", "completion" : { "field" : "suggest", <2> "size" : 5 <3> } } } } -------------------------------------------------- // CONSOLE // TEST[continued] <1> Filter the source to return only the `suggest` field <2> Name of the field to search for suggestions in <3> Number of suggestions to return Which should look like: [source,js] -------------------------------------------------- { "took": 6, "timed\_out": false, "\_shards" : { "total" : 5, "successful" : 5, "skipped" : 0, "failed" : 0 }, "hits": { "total" : 0, "max\_score" : 0.0, "hits" : [] }, "suggest": { "song-suggest" : [ { "text" : "nir", "offset" : 0, "length" : 3, "options" : [ { "text" : "Nirvana", "\_index": "music", "\_type": "\_doc", "\_id": "1", "\_score": 1.0, "\_source": { "suggest": ["Nevermind", "Nirvana"] } } ] } ] } } -------------------------------------------------- // TESTRESPONSE[s/"took": 6,/"took": $body.took,/] The basic completion suggester query supports the following parameters: `field`:: The name of the field on which to run the query (required). `size`:: The number of suggestions to return (defaults to `5`). `skip\_duplicates`:: Whether duplicate suggestions should be filtered out (defaults to `false`). NOTE: The completion suggester considers all documents in the index. See <> for an explanation of how to query a subset of documents instead. NOTE: In case of completion queries spanning more than one shard, the suggest is executed in two phases, where the last phase fetches the relevant documents from shards, implying executing completion requests against a single shard is more performant due to the document fetch overhead when the suggest spans multiple shards. To get best performance for completions, it is recommended to index completions into a single shard index. In case of high heap usage due to shard size, it is still recommended to
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/completion-suggest.asciidoc
6.2
elasticsearch-6-2
[ -0.09592226147651672, -0.01385260745882988, 0.04476979374885559, 0.11918363720178604, 0.04342779889702797, 0.0522998683154583, 0.09498347342014313, 0.00389780942350626, 0.07954017072916031, -0.0813920646905899, -0.03125612437725067, -0.014471331611275673, 0.042904987931251526, -0.05916949734091759, -0.005642687436193228, 0.04346052557229996, -0.013432023115456104, -0.02866935543715954, -0.03762205317616463, -0.07062822580337524, 0.04422006756067276, 0.059056200087070465, -0.001321192947216332, -0.007482750806957483, 0.051981326192617416, -0.03781137987971306, -0.06581952422857285, -0.050872188061475754, 0.046013422310352325, 0.038665078580379486, -0.009213912300765514, 0.012349363416433334, -0.07898632436990738, -0.04640837013721466, -0.06689298152923584, 0.02833988331258297, -0.13626524806022644, -0.01222612988203764, 0.013146019540727139, -0.006565943360328674, -0.04646069556474686, 0.07018528133630753, -0.07247015833854675, -0.012977071106433868, -0.05442606657743454, -0.08938351273536682, -0.08675957471132278, -0.026838505640625954, -0.054903678596019745, 0.0658077597618103, -0.09444466978311539, -0.06094897910952568, -0.027890129014849663, -0.03131604194641113, -0.005522444844245911, -0.03108692541718483, -0.07738979160785675, 0.03008541837334633, -0.010440448299050331, -0.03367862477898598, -0.009459935128688812, -0.08252818137407303, 0.010626164264976978, -0.027469847351312637, 0.03190285712480545, 0.005992312915623188, -0.017211802303791046, 0.0011676489375531673, -0.006124755367636681, 0.03688140958547592, 0.06670314818620682, -0.0015563378110527992, -0.04996654391288757, -0.038108523935079575, 0.06838139146566391, -0.016124965623021126, -0.047136660665273666, -0.0301836971193552, -0.06703699380159378, 0.0625782236456871, -0.02108626812696457, -0.07565893232822418, -0.032759636640548706, 0.0028679082170128822, 0.020929936319589615, 0.0023517278023064137, 0.032186109572649, -0.06264717876911163, 0.057468559592962265, -0.06088040769100189, -0.09709165245294571, -0.052594806998968124, -0.02971038408577442, 0.03359535336494446, -0.03171670809388161, 0.10102084279060364, -0.06500697880983353, -0.01431669294834137, -0.005524137988686562, 0.06011921912431717, 0.06095445901155472, 0.08231774717569351, -0.008942327462136745, 0.02426440268754959, -0.04035920649766922, -0.04446025192737579, -0.0028645796701312065, 0.08389435708522797, -0.0026529065798968077, 0.007404461968690157, -0.061781253665685654, 0.06695675849914551, -0.06021783500909805, 0.009201466105878353, -0.06604298204183578, 0.0521179623901844, 0.13438166677951813, -0.040104009211063385, 0.009220941923558712, 0.06667367368936539, 0.1370914727449417, 0.058288510888814926, -0.04628422111272812, -0.07770783454179764, 0.013629891909658909, -0.03034389205276966, 0.042314447462558746, -9.261495176834209e-33, 0.05499541759490967, -0.05900658294558525, -0.0017816571053117514, -0.0035806731320917606, 0.05383749678730965, 0.00935298390686512, -0.011995537206530571, 0.13414159417152405, -0.0818936675786972, -0.017148392274975777, 0.006154706701636314, 0.03315065801143646, -0.002752223052084446, -0.0409119687974453, -0.06554482132196426, -0.039019688963890076, 0.032135866582393646, 0.0979628935456276, -0.009362708777189255, -0.03380029276013374, 0.03352174162864685, 0.057098258286714554, -0.00973478239029646, -0.005897182039916515, 0.020124219357967377, -0.011093375273048878, 0.007794996257871389, 0.049773842096328735, -0.0698222890496254, -0.051927533000707626, -0.06688779592514038, -0.055732354521751404, -0.07902320474386215, -0.0341782346367836, -0.03734353184700012, 0.021736767143011093, -0.03126659244298935, -0.012882210314273834, -0.025059305131435394, -0.04591333866119385, 0.06442758440971375, 0.0172168780118227, -0.0034412697423249483, -0.13283653557300568, -0.0817902684211731, -0.03560581058263779, -0.05921473354101181, 0.05817060545086861, -0.055995453149080276, 0.01116807758808136, -0.0030160306487232447, 0.05262815207242966, -0.054951418191194534, 0.019668661057949066, 0.02235398441553116, 0.01399252936244011, -0.06455431878566742, 0.09635959565639496, 0.055261027067899704, 0.007742390502244234, 0.06863835453987122, 0.02257530763745308, 0.02289377897977829, 0.004321934189647436, 0.010859744623303413, 0.08111979067325592, 0.03942306339740753, 0.037087034434080124, 0.09330349415540695, -0.042366936802864075, -0.006007649935781956, -0.0014423562679439783, 0.05428595840930939, -0.025075070559978485, 0.05365341529250145, -0.09266587346792221, -0.09767965972423553, -0.10315679013729095, 0.017899414524435997, 0.029762104153633118, 0.0034942261409014463, -0.10045234858989716, -0.10287301987409592, 0.05936150252819061, -0.003946812357753515, 0.0182952843606472, 0.018245937302708626, -0.08451671898365021, -0.023296955972909927, 0.008933668956160545, -0.04333053156733513, 0.050193436443805695, -0.04678491875529289, -0.09951931238174438, -0.004702652804553509, 4.03144787493127e-33, 0.08973976224660873, -0.05348925292491913, -0.04232839494943619, 0.016138389706611633, 0.047818951308727264, -0.033884767442941666, -0.021868016570806503, 0.06974170356988907, 0.011441870592534542, -0.01646318845450878, -0.013631916604936123, -0.05847606062889099, -0.005654273089021444, -0.004791545681655407, -0.023058267310261726, 0.07869040966033936, -0.05537255108356476, -0.037113673985004425, -0.05794783681631088, 0.0021686723921447992, -0.028437642380595207, 0.04641585052013397, -0.04229077324271202, 0.041090212762355804, -0.036096204072237015, -0.015015858225524426, 0.025701282545924187, 0.07090368866920471, -0.06138185039162636, -0.0158555768430233, -0.04420416057109833, 0.0075186737813055515, -0.07654827833175659, -0.028872448951005936, 0.0379527285695076, 0.016832301393151283, 0.03821028023958206, 0.09614814817905426, -0.03145797923207283, 0.09613870084285736, 0.06593886017799377, 0.015702301636338234, 0.015324068255722523, 0.0765155553817749, -0.022376293316483498, -0.04764363914728165, 0.030183015391230583, 0.04611165076494217, 0.06343427300453186, -0.006312803830951452, 0.05312585458159447, -0.05767057090997696, -0.09889286011457443, -0.006200883071869612, -0.022251466289162636, 0.002252531936392188, -0.01822303608059883, -0.03385302424430847, -0.006705630570650101, -0.023397773504257202, -0.026752138510346413, -0.015158286318182945, -0.013910616748034954, -0.05860409885644913, 0.05614378675818443, -0.08562825620174408, 0.029290832579135895, -0.011601774953305721, 0.04188555106520653, -0.0317176952958107, -0.04724908620119095, -0.0054616546258330345, 0.14425009489059448, 0.01260649785399437, 0.0867849588394165, -0.004619041923433542, 0.054019395262002945, -0.07923316955566406, 0.06717035919427872, -0.06748108565807343, 0.03150474652647972, 0.006918103899806738, 0.03059672936797142, -0.03372390940785408, 0.004662234336137772, 0.011661808006465435, -0.09896765649318695, 0.08500898629426956, -0.03884458169341087, 0.002063146559521556, 0.007520634680986404, -0.02339252643287182, 0.06389765441417694, -0.015873290598392487, -0.04937995970249176, -5.277956560689745e-8, -0.05268716812133789, 0.05589865893125534, -0.07812429964542389, 0.05507589876651764, -0.005778620485216379, 0.004144518170505762, 0.04024561122059822, 0.06382110714912415, -0.03573210537433624, -0.03657306358218193, 0.06409497559070587, -0.0010514312889426947, 0.009646513499319553, -0.008854726329445839, -0.04336277022957802, -0.0788942202925682, 0.06066485494375229, -0.015282688662409782, -0.030325626954436302, -0.05482650548219681, -0.06099819391965866, -0.005140367429703474, 0.033013150095939636, 0.025941304862499237, 0.08034228533506393, 0.022934075444936752, 0.04119810461997986, 0.05093349888920784, 0.09318216890096664, 0.06727579236030579, -0.04247516766190529, 0.04881351441144943, 0.0031875772401690483, 0.008904949761927128, 0.008680988103151321, -0.06793740391731262, 0.04210863634943962, 0.006558873690664768, -0.05388345569372177, 0.007948901504278183, 0.054321516305208206, 0.008839612826704979, -0.06786181032657623, 0.03931738808751106, 0.018808715045452118, -0.025615639984607697, 0.021356018260121346, -0.048847559839487076, 0.07145730406045914, -0.05024313926696777, -0.005909227300435305, -0.07696115225553513, 0.051526281982660294, 0.024863870814442635, 0.0059239426627755165, 0.022465664893388748, 0.05233228951692581, 0.06980328261852264, -0.011906415224075317, -0.01492058765143156, 0.07122395932674408, -0.021166235208511353, 0.03450838103890419, 0.07181302458047867 ]
0.055674
a single shard is more performant due to the document fetch overhead when the suggest spans multiple shards. To get best performance for completions, it is recommended to index completions into a single shard index. In case of high heap usage due to shard size, it is still recommended to break index into multiple shards instead of optimizing for completion performance. [[skip\_duplicates]] ==== Skip duplicate suggestions Queries can return duplicate suggestions coming from different documents. It is possible to modify this behavior by setting `skip\_duplicates` to true. When set, this option filters out documents with duplicate suggestions from the result. [source,js] -------------------------------------------------- POST music/\_search?pretty { "suggest": { "song-suggest" : { "prefix" : "nor", "completion" : { "field" : "suggest", "skip\_duplicates": true } } } } -------------------------------------------------- // CONSOLE WARNING: when set to true this option can slow down search because more suggestions need to be visited to find the top N. [[fuzzy]] ==== Fuzzy queries The completion suggester also supports fuzzy queries - this means, you can have a typo in your search and still get results back. [source,js] -------------------------------------------------- POST music/\_search?pretty { "suggest": { "song-suggest" : { "prefix" : "nor", "completion" : { "field" : "suggest", "fuzzy" : { "fuzziness" : 2 } } } } } -------------------------------------------------- // CONSOLE Suggestions that share the longest prefix to the query `prefix` will be scored higher. The fuzzy query can take specific fuzzy parameters. The following parameters are supported: [horizontal] `fuzziness`:: The fuzziness factor, defaults to `AUTO`. See <> for allowed settings. `transpositions`:: if set to `true`, transpositions are counted as one change instead of two, defaults to `true` `min\_length`:: Minimum length of the input before fuzzy suggestions are returned, defaults `3` `prefix\_length`:: Minimum length of the input, which is not checked for fuzzy alternatives, defaults to `1` `unicode\_aware`:: If `true`, all measurements (like fuzzy edit distance, transpositions, and lengths) are measured in Unicode code points instead of in bytes. This is slightly slower than raw bytes, so it is set to `false` by default. NOTE: If you want to stick with the default values, but still use fuzzy, you can either use `fuzzy: {}` or `fuzzy: true`. [[regex]] ==== Regex queries The completion suggester also supports regex queries meaning you can express a prefix as a regular expression [source,js] -------------------------------------------------- POST music/\_search?pretty { "suggest": { "song-suggest" : { "regex" : "n[ever|i]r", "completion" : { "field" : "suggest" } } } } -------------------------------------------------- // CONSOLE The regex query can take specific regex parameters. The following parameters are supported: [horizontal] `flags`:: Possible flags are `ALL` (default), `ANYSTRING`, `COMPLEMENT`, `EMPTY`, `INTERSECTION`, `INTERVAL`, or `NONE`. See <> for their meaning `max\_determinized\_states`:: Regular expressions are dangerous because it's easy to accidentally create an innocuous looking one that requires an exponential number of internal determinized automaton states (and corresponding RAM and CPU) for Lucene to execute. Lucene prevents these using the `max\_determinized\_states` setting (defaults to 10000). You can raise this limit to allow more complex regular expressions to execute.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/suggesters/completion-suggest.asciidoc
6.2
elasticsearch-6-2
[ -0.03265586867928505, -0.020453687757253647, 0.09617099165916443, 0.02312150038778782, 0.022149045020341873, 0.007386248558759689, -0.019720803946256638, -0.036068204790353775, 0.11299343407154083, -0.07447788864374161, -0.01706552505493164, 0.04845252260565758, 0.04160785675048828, -0.03744244948029518, -0.020098598673939705, 0.00954215507954359, 0.004621902015060186, -0.03824939951300621, -0.014957396313548088, -0.08730299770832062, 0.035711705684661865, 0.00937933661043644, 0.04984261468052864, -0.03703676164150238, 0.003170881886035204, -0.018111249431967735, -0.08374468237161636, 0.009609385393559933, -0.008968662470579147, -0.0043535176664590836, 0.04381754621863365, 0.03212921321392059, -0.06591305136680603, -0.015135355293750763, -0.15064698457717896, 0.009165802039206028, -0.09213238209486008, 0.019731849431991577, -0.021805454045534134, 0.0007566165877506137, -0.04599452018737793, 0.042624928057193756, -0.06958295404911041, -0.020512061193585396, -0.0746249184012413, -0.05518845468759537, -0.06463627517223358, -0.06059310585260391, 0.019284285604953766, 0.021400824189186096, -0.09669753164052963, -0.055297479033470154, 0.0025289910845458508, -0.0017332654679194093, 0.04582942649722099, -0.01833098754286766, -0.1229606568813324, 0.05717672407627106, -0.002342574531212449, -0.06248202919960022, 0.008514772169291973, -0.06265122443437576, -0.019237656146287918, -0.05992288514971733, 0.12857504189014435, -0.0048299869522452354, 0.08940121531486511, -0.01914142817258835, 0.02990824170410633, 0.057677194476127625, 0.0777507796883583, 0.04167255759239197, -0.03514202684164047, 0.02677035890519619, 0.050172630697488785, 0.0654165968298912, -0.0398576483130455, -0.015023545362055302, -0.0622069351375103, 0.044962719082832336, -0.07138653844594955, -0.0760611891746521, -0.0006412367802113295, -0.03478717431426048, -0.03144829347729683, -0.043200865387916565, 0.0012273222673684359, -0.06318163126707077, -0.0031845439225435257, -0.06452546268701553, -0.017065932974219322, -0.05434415861964226, 0.020376011729240417, -0.013379158452153206, 0.029588736593723297, 0.059534378349781036, -0.028571084141731262, 0.07853103429079056, 0.015827948227524757, -0.010326140560209751, 0.05391912907361984, 0.014123390428721905, 0.02121782675385475, -0.0323028638958931, 0.02462213858962059, -0.059969741851091385, -0.046788882464170456, 0.0722934827208519, -0.02715294249355793, -0.013698813505470753, 0.03365946188569069, 0.03534424304962158, -0.03765009716153145, 0.018067868426442146, -0.017348075285553932, 0.12368982285261154, 0.09807811677455902, -0.05391192063689232, 0.012627607211470604, 0.07050319015979767, 0.05059867724776268, 0.013725177384912968, 0.08362963050603867, -0.01434266846626997, -0.047158025205135345, -0.027094697579741478, -0.06499387323856354, 1.085179283138688e-33, 0.04760878160595894, 0.02430761232972145, 0.04214910417795181, -0.0706545040011406, 0.0283771101385355, -0.0017208188073709607, -0.04412806034088135, 0.10113000869750977, -0.08877592533826828, -0.026426376774907112, -0.06405427306890488, 0.048771318048238754, -0.014122957363724709, -0.07285041362047195, -0.0356241911649704, -0.07976444065570831, 0.06998477131128311, 0.09482600539922714, -0.08527079224586487, 0.020529476925730705, 0.03496981039643288, 0.02893885225057602, 0.018590353429317474, 0.003308336716145277, 0.017033105716109276, -0.046407390385866165, 0.023609448224306107, -0.022914357483386993, -0.009004389867186546, -0.02697531320154667, -0.061137206852436066, -0.028354065492749214, -0.0009229551069438457, 0.032495178282260895, -0.023056238889694214, 0.06845955550670624, -0.027732910588383675, -0.017855999991297722, -0.02600378543138504, -0.10978614538908005, 0.043462567031383514, 0.02561093121767044, 0.018844248726963997, -0.0923183485865593, -0.06527700275182724, 0.028058988973498344, -0.0775027647614479, 0.005111989099532366, -0.048280127346515656, 0.030123664066195488, 0.030626263469457626, 0.057381074875593185, -0.011951080523431301, 0.09995274245738983, 0.03565002977848053, -0.0038067384157329798, 0.03344893082976341, -0.0030870751943439245, 0.03721126914024353, 0.05970040336251259, 0.042320188134908676, 0.01009382028132677, 0.008849460631608963, 0.049825847148895264, -0.02349145896732807, 0.045135267078876495, 0.09476514160633087, 0.1047142818570137, 0.09187188744544983, 0.04748433455824852, 0.0031922145280987024, 0.03479090332984924, 0.013899033889174461, -0.08827473223209381, 0.037747859954833984, -0.12561143934726715, -0.03226255252957344, -0.11048070341348648, 0.04743529111146927, -0.0304236002266407, -0.08704593777656555, -0.06415461003780365, -0.06492869555950165, -0.025682667270302773, -0.04167007654905319, 0.11525505781173706, 0.03126484900712967, -0.06448426842689514, -0.03167852386832237, -0.04126584157347679, -0.022164585068821907, 0.07489658147096634, -0.03227650374174118, -0.10489042103290558, -0.01724221743643284, -1.9319778628222165e-33, 0.08370674401521683, -0.13618050515651703, 0.044224996119737625, 0.09226448088884354, 0.06743842363357544, -0.013402380049228668, -0.011399658396840096, -0.028514450415968895, 0.008356853388249874, -0.07531541585922241, 0.03270219638943672, -0.07543350756168365, 0.04820036515593529, -0.0351756326854229, -0.05476615950465202, 0.08624914288520813, 0.0006486995262093842, -0.10174519568681717, 0.018218593671917915, 0.013226129114627838, -0.03199564665555954, -0.012845841236412525, 0.03448493406176567, 0.09686598181724548, -0.08343131095170975, -0.012645300477743149, 0.005238621961325407, -0.04683578386902809, 0.0088187325745821, -0.00948000606149435, 0.017542097717523575, 0.0020321893971413374, -0.08334468305110931, -0.11261681467294693, -0.025103779509663582, 0.02069271355867386, 0.02069975435733795, 0.1114434227347374, 0.0045836446806788445, 0.1282658576965332, -0.000582891283556819, 0.001487300731241703, -0.056703947484493256, 0.018206141889095306, -0.06353515386581421, -0.03775256499648094, -0.008943813852965832, 0.10616043955087662, 0.046350304037332535, -0.04962245747447014, 0.014842044562101364, -0.007248065434396267, -0.07869907468557358, 0.08058007061481476, -0.0012483084574341774, -0.013799781911075115, -0.02796095423400402, 0.04915734380483627, -0.07303648442029953, 0.04799928888678551, -0.023480208590626717, -0.00624606478959322, -0.04433632269501686, -0.03465487062931061, 0.020383767783641815, -0.04610265791416168, -0.01822757162153721, -0.01679828017950058, 0.028515446931123734, 0.008120059035718441, -0.07943778485059738, -0.013696829788386822, 0.04514491558074951, 0.04031535983085632, 0.03111027553677559, -0.017313135787844658, 0.053913556039333344, -0.015547098591923714, 0.07843554019927979, 0.009470350109040737, -0.010563026182353497, 0.08877561241388321, -0.01364506408572197, 0.02483946457505226, 0.011737195774912834, -0.038181036710739136, -0.03993189334869385, 0.08640101552009583, -0.0505906380712986, 0.033470772206783295, 0.005469316616654396, 0.016428420320153236, -0.02659488469362259, -0.011287684552371502, -0.006312072277069092, -4.668166297960852e-8, 0.006254476495087147, 0.04968368634581566, -0.06511558592319489, 0.054212525486946106, -0.0032121867407113314, -0.04416971281170845, 0.023506131023168564, 0.07858092337846756, -0.027849670499563217, -0.022084875032305717, 0.04999254271388054, 0.0027151128742843866, -0.0797336995601654, 0.0020106781739741564, 0.0041416110470891, -0.02039959467947483, 0.035621050745248795, 0.059379320591688156, -0.03983728960156441, 0.002883519511669874, 0.012089335359632969, 0.025949127972126007, 0.0015617834869772196, 0.006956326309591532, 0.010092059150338173, 0.07880035787820816, 0.028686588630080223, 0.006453841459006071, 0.06711126863956451, 0.03129713609814644, -0.04967604577541351, -0.022697005420923233, 0.008991053327918053, -0.05054815113544464, 0.049181487411260605, 0.009485351853072643, -0.007806133478879929, 0.015291603282094002, -0.038894932717084885, 0.06390077620744705, 0.05251950025558472, -0.04725397750735283, 0.006326587870717049, 0.026449674740433693, 0.01800232008099556, -0.016181927174329758, 0.011894634924829006, 0.009629425592720509, 0.04800226911902428, 0.04020857810974121, -0.00838968064635992, -0.02859274484217167, 0.06884711235761642, 0.019851142540574074, 0.06039310246706009, 0.05341794714331627, 0.02226773463189602, 0.026519129052758217, 0.0688273087143898, -0.006613494362682104, 0.11349214613437653, -0.12272031605243683, 0.03825332969427109, 0.03764883056282997 ]
-0.014235
[[search-request-sort]] === Sort Allows to add one or more sort on specific fields. Each sort can be reversed as well. The sort is defined on a per field level, with special field name for `\_score` to sort by score, and `\_doc` to sort by index order. Assuming the following index mapping: [source,js] -------------------------------------------------- PUT /my\_index { "mappings": { "\_doc": { "properties": { "post\_date": { "type": "date" }, "user": { "type": "keyword" }, "name": { "type": "keyword" }, "age": { "type": "integer" } } } } } -------------------------------------------------- // CONSOLE [source,js] -------------------------------------------------- GET /my\_index/\_search { "sort" : [ { "post\_date" : {"order" : "asc"}}, "user", { "name" : "desc" }, { "age" : "desc" }, "\_score" ], "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE // TEST[continued] NOTE: `\_doc` has no real use-case besides being the most efficient sort order. So if you don't care about the order in which documents are returned, then you should sort by `\_doc`. This especially helps when <>. ==== Sort Values The sort values for each document returned are also returned as part of the response. ==== Sort Order The `order` option can have the following values: [horizontal] `asc`:: Sort in ascending order `desc`:: Sort in descending order The order defaults to `desc` when sorting on the `\_score`, and defaults to `asc` when sorting on anything else. ==== Sort mode option Elasticsearch supports sorting by array or multi-valued fields. The `mode` option controls what array value is picked for sorting the document it belongs to. The `mode` option can have the following values: [horizontal] `min`:: Pick the lowest value. `max`:: Pick the highest value. `sum`:: Use the sum of all values as sort value. Only applicable for number based array fields. `avg`:: Use the average of all values as sort value. Only applicable for number based array fields. `median`:: Use the median of all values as sort value. Only applicable for number based array fields. ===== Sort mode example usage In the example below the field price has multiple prices per document. In this case the result hits will be sorted by price ascending based on the average price per document. [source,js] -------------------------------------------------- PUT /my\_index/\_doc/1?refresh { "product": "chocolate", "price": [20, 4] } POST /\_search { "query" : { "term" : { "product" : "chocolate" } }, "sort" : [ {"price" : {"order" : "asc", "mode" : "avg"}} ] } -------------------------------------------------- // CONSOLE [[nested-sorting]] ==== Sorting within nested objects. Elasticsearch also supports sorting by fields that are inside one or more nested objects. The sorting by nested field support has a `nested` sort option with the following properties: `path`:: Defines on which nested object to sort. The actual sort field must be a direct field inside this nested object. When sorting by nested field, this field is mandatory. `filter`:: A filter that the inner objects inside the nested path should match with in order for its field values to be taken into account by sorting. Common case is to repeat the query / filter inside the nested filter or query. By default no `nested\_filter` is active. `nested`:: Same as top-level `nested` but applies to another nested path within the current nested object. [WARNING] .Nested sort options before Elasticseach 6.1 ============================================ The `nested\_path` and `nested\_filter` options have been deprecated in favor of the options documented above. ============================================ ===== Nested sorting examples In the below example `offer` is a field of type `nested`. The nested `path` needs to be specified; otherwise, Elasticsearch doesn't know on what nested level sort values need to be captured. [source,js] -------------------------------------------------- POST /\_search { "query" :
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/sort.asciidoc
6.2
elasticsearch-6-2
[ -0.005601842422038317, 0.08339439332485199, 0.07242512702941895, 0.06543583422899246, -0.029056645929813385, 0.0762714073061943, -0.047056980431079865, 0.043098028749227524, 0.04957154765725136, 0.028488365933299065, -0.0403251126408577, 0.05280167981982231, 0.015875304117798805, 0.02311977930366993, -0.061311062425374985, 0.0357811264693737, -0.09659026563167572, 0.021969327703118324, -0.001804102212190628, -0.06757024675607681, 0.051145292818546295, 0.0679960548877716, -0.013469439931213856, -0.0681687667965889, -0.021214192733168602, 0.0094459792599082, -0.09234432876110077, -0.029956825077533722, -0.006323866080492735, 0.0445735901594162, -0.02754228748381138, 0.011564241722226143, 0.030786771327257156, 0.07799334824085236, -0.07076086103916168, -0.02227211184799671, -0.022978108376264572, -0.07998691499233246, 0.07366082072257996, 0.04937819018959999, -0.02488970384001732, 0.0473361611366272, 0.02323116920888424, -0.07860022038221359, -0.03841688111424446, -0.05181262269616127, -0.022985894232988358, -0.06012684106826782, -0.034803085029125214, 0.042751993983983994, -0.10642624646425247, -0.0009686311823315918, -0.05067729949951172, 0.029741067439317703, -0.012950871139764786, 0.04990265518426895, -0.0774288922548294, 0.005575589369982481, -0.008173069916665554, -0.06657218188047409, 0.008280301466584206, -0.08717062324285507, 0.024464480578899384, -0.046292200684547424, 0.05375486984848976, -0.07813043147325516, -0.002721342258155346, 0.017348777502775192, 0.045249421149492264, -0.012579277157783508, 0.09181978553533554, 0.0170073714107275, 0.05338826775550842, -0.08410440385341644, 0.04226795583963394, 0.03588447347283363, -0.07302572578191757, -0.027319423854351044, -0.027450349181890488, 0.010774259455502033, -0.07699885219335556, -0.09311763942241669, -0.0462033636868, -0.00687910383567214, 0.004937309771776199, -0.09401123970746994, -0.004122248385101557, -0.11975463479757309, 0.0375954695045948, -0.02514638938009739, -0.0787319615483284, -0.07147079706192017, 0.008486214093863964, 0.0503569133579731, 0.0785735622048378, 0.04115646705031395, 0.043406497687101364, -0.016576452180743217, 0.01142103411257267, 0.012779428623616695, -0.0006280005909502506, 0.003273117123171687, -0.00543317710980773, -0.059194277971982956, 0.07640624046325684, 0.00317450356669724, -0.06351578235626221, 0.016545742750167847, -0.05730302631855011, -0.021163644269108772, -0.0339360237121582, 0.10690028965473175, -0.03279304876923561, -0.002403420861810446, -0.07850862294435501, 0.07447122037410736, 0.02594923973083496, -0.03384414315223694, 0.020402103662490845, 0.06449252367019653, 0.06097550690174103, 0.05068108066916466, -0.01588081382215023, -0.0738004595041275, 0.02116108126938343, 0.09766435623168945, 0.08147475123405457, 2.0966613152945573e-33, 0.0962485671043396, 0.016837390139698982, 0.02677829936146736, -0.020601779222488403, -0.030152177438139915, 0.046436239033937454, 0.0657879039645195, 0.0329454280436039, -0.04421505331993103, -0.046823419630527496, -0.04417255148291588, 0.10589615255594254, -0.0479075089097023, -0.05118008702993393, -0.04861106723546982, -0.062119532376527786, 0.016419190913438797, 0.016507238149642944, -0.033604130148887634, -0.03424561023712158, 0.0879455953836441, -0.035704173147678375, -0.04687202349305153, -0.02318614535033703, 0.01597394421696663, -0.06174219027161598, -0.05026831850409508, -0.04477331414818764, -0.10777163505554199, -0.029400119557976723, -0.009180392138659954, -0.009545478038489819, -0.01783985272049904, -0.036629389971494675, 0.07614708691835403, 0.031229548156261444, -0.0023816425818949938, 0.05023069307208061, -0.03269625082612038, -0.00029661989537999034, 0.00993181113153696, -0.012723171152174473, -0.019324254244565964, -0.1395440548658371, -0.021905671805143356, 0.019056104123592377, -0.06142054870724678, 0.004243811126798391, 0.05686028674244881, 0.022560998797416687, -0.0790727287530899, -0.01347177755087614, 0.0012119056191295385, 0.029683826491236687, 0.09065169841051102, -0.041554223746061325, 0.004675623960793018, 0.10276824235916138, 0.0016650981269776821, -0.04937951639294624, 0.03482091799378395, 0.0009265130502171814, 0.04641050100326538, 0.006541998125612736, 0.036783214658498764, -0.042455434799194336, 0.05847538262605667, 0.08462276309728622, 0.029299195855855942, 0.03983006998896599, 0.041688982397317886, 0.07471355050802231, -0.000846307841129601, 0.0008695391588844359, 0.03137347474694252, -0.014169760048389435, -0.02604522928595543, -0.04522310197353363, -0.007930506952106953, -0.036814846098423004, -0.025505492463707924, -0.010228315368294716, -0.055520690977573395, 0.031146561726927757, 0.00659688375890255, 0.11068981140851974, -0.051592275500297546, -0.0003388796467334032, -0.02179659716784954, -0.08417229354381561, 0.0058896602131426334, 0.018353810533881187, -0.04096066206693649, -0.084096759557724, 0.00041200604755431414, -2.662435378881963e-33, -0.004828602075576782, -0.10782049596309662, 0.031494125723838806, 0.04573766514658928, 0.07542014867067337, -0.08872561156749725, 0.03492307290434837, -0.005230189301073551, 0.009264851920306683, 0.10016883909702301, 0.005885268095880747, -0.044589538127183914, 0.02208448015153408, -0.03270271420478821, 0.027055323123931885, 0.04657137766480446, -0.09295132011175156, -0.03610861673951149, 0.0272594653069973, -0.006287705153226852, -0.019957859069108963, 0.045242950320243835, -0.021660922095179558, 0.11225612461566925, -0.02862389013171196, -0.05416520684957504, 0.035313431173563004, -0.005096921231597662, -0.07092008739709854, 0.034889694303274155, 0.03431272134184837, -0.01185608096420765, -0.05438892915844917, 0.051271699368953705, -0.0831882432103157, -0.01793401502072811, 0.002412172732874751, 0.03034789115190506, -0.021431075409054756, 0.13375599682331085, -0.07415632158517838, 0.05479539558291435, -0.024163324385881424, -0.016743449494242668, 0.03770843893289566, -0.010048553347587585, 0.03398571163415909, 0.033058132976293564, -0.02738608606159687, -0.05062779039144516, 0.03239253908395767, 0.06597700715065002, -0.09938976168632507, -0.004917064681649208, -0.038446299731731415, -0.07453072816133499, -0.05272969603538513, 0.008481866680085659, -0.036915913224220276, 0.062464095652103424, 0.02357860654592514, 0.043555162847042084, 0.019234543666243553, -0.016968727111816406, 0.01975484937429428, -0.0783015638589859, -0.08790730684995651, -0.06516247242689133, -0.06177190691232681, -0.015290658921003342, -0.011499764397740364, -0.08676813542842865, 0.1107783392071724, 0.04293246567249298, 0.015355654060840607, -0.011785514652729034, 0.0767364650964737, 0.07634518295526505, 0.09793289750814438, -0.0703519731760025, -0.011187671683728695, 0.029764071106910706, 0.030384201556444168, 0.12287973612546921, -0.026534428820014, 0.009705285541713238, -0.026662930846214294, 0.05814748257398605, -0.07652891427278519, 0.018866224214434624, 0.003182588377967477, -0.08159536123275757, 0.012704674154520035, -0.038485437631607056, 0.013399535790085793, -5.217460241624394e-8, -0.03491587191820145, 0.008742081932723522, -0.07766593247652054, 0.10126946866512299, -0.07263285666704178, 0.0237641129642725, 0.08056256175041199, 0.08847509324550629, 0.00434022257104516, -0.03909099102020264, 0.08931875228881836, 0.08737357705831528, -0.006242925766855478, -0.0033625653013587, -0.005640270654112101, -0.018907006829977036, -0.04757144674658775, 0.001934647443704307, -0.03995823487639427, -0.018580369651317596, 0.07779896259307861, -0.006432147230952978, 0.07199364900588989, 0.002550467848777771, 0.12004152685403824, 0.05006418749690056, 0.029028665274381638, 0.03843408450484276, 0.030446957796812057, 0.025623811408877373, -0.01790522038936615, 0.036718860268592834, 0.0043676868081092834, -0.0020061132963746786, 0.02774474211037159, -0.024030687287449837, -0.037173520773649216, 0.019558414816856384, -0.08839516341686249, 0.05062040314078331, 0.0005271011032164097, 0.027540067210793495, -0.014087463729083538, 0.03271764516830444, 0.06203559786081314, 0.002176879206672311, 0.02195945382118225, 0.00885345321148634, 0.10367845743894577, -0.03055589087307453, -0.017322465777397156, -0.06348539888858795, 0.05652736499905586, -0.015161560848355293, -0.011748087592422962, 0.04323979839682579, 0.043017882853746414, 0.060654062777757645, 0.010012112557888031, -0.07943952083587646, 0.055003661662340164, -0.027010316029191017, 0.007583118975162506, 0.030680077150464058 ]
-0.021827
favor of the options documented above. ============================================ ===== Nested sorting examples In the below example `offer` is a field of type `nested`. The nested `path` needs to be specified; otherwise, Elasticsearch doesn't know on what nested level sort values need to be captured. [source,js] -------------------------------------------------- POST /\_search { "query" : { "term" : { "product" : "chocolate" } }, "sort" : [ { "offer.price" : { "mode" : "avg", "order" : "asc", "nested": { "path": "offer", "filter": { "term" : { "offer.color" : "blue" } } } } } ] } -------------------------------------------------- // CONSOLE In the below example `parent` and `child` fields are of type `nested`. The `nested\_path` needs to be specified at each level; otherwise, Elasticsearch doesn't know on what nested level sort values need to be captured. [source,js] -------------------------------------------------- POST /\_search { "query": { "nested": { "path": "parent", "query": { "bool": { "must": {"range": {"parent.age": {"gte": 21}}}, "filter": { "nested": { "path": "parent.child", "query": {"match": {"parent.child.name": "matt"}} } } } } } }, "sort" : [ { "parent.child.age" : { "mode" : "min", "order" : "asc", "nested": { "path": "parent", "filter": { "range": {"parent.age": {"gte": 21}} }, "nested": { "path": "parent.child", "filter": { "match": {"parent.child.name": "matt"} } } } } } ] } -------------------------------------------------- // CONSOLE Nested sorting is also supported when sorting by scripts and sorting by geo distance. ==== Missing Values The `missing` parameter specifies how docs which are missing the field should be treated: The `missing` value can be set to `\_last`, `\_first`, or a custom value (that will be used for missing docs as the sort value). The default is `\_last`. For example: [source,js] -------------------------------------------------- GET /\_search { "sort" : [ { "price" : {"missing" : "\_last"} } ], "query" : { "term" : { "product" : "chocolate" } } } -------------------------------------------------- // CONSOLE NOTE: If a nested inner object doesn't match with the `nested\_filter` then a missing value is used. ==== Ignoring Unmapped Fields By default, the search request will fail if there is no mapping associated with a field. The `unmapped\_type` option allows to ignore fields that have no mapping and not sort by them. The value of this parameter is used to determine what sort values to emit. Here is an example of how it can be used: [source,js] -------------------------------------------------- GET /\_search { "sort" : [ { "price" : {"unmapped\_type" : "long"} } ], "query" : { "term" : { "product" : "chocolate" } } } -------------------------------------------------- // CONSOLE If any of the indices that are queried doesn't have a mapping for `price` then Elasticsearch will handle it as if there was a mapping of type `long`, with all documents in this index having no value for this field. [[geo-sorting]] ==== Geo Distance Sorting Allow to sort by `\_geo\_distance`. Here is an example, assuming `pin.location` is a field of type `geo\_point`: [source,js] -------------------------------------------------- GET /\_search { "sort" : [ { "\_geo\_distance" : { "pin.location" : [-70, 40], "order" : "asc", "unit" : "km", "mode" : "min", "distance\_type" : "arc" } } ], "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE `distance\_type`:: How to compute the distance. Can either be `arc` (default), or `plane` (faster, but inaccurate on long distances and close to the poles). `mode`:: What to do in case a field has several geo points. By default, the shortest distance is taken into account when sorting in ascending order and the longest distance when sorting in descending order. Supported values are `min`, `max`, `median` and `avg`. `unit`:: The unit to use when computing sort values. The default is `m` (meters). NOTE: geo distance
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/sort.asciidoc
6.2
elasticsearch-6-2
[ -0.0006026285700500011, 0.0803600624203682, 0.06745690107345581, 0.0694238543510437, 0.005471701733767986, 0.03696078807115555, -0.05268356576561928, 0.023097485303878784, 0.07809454202651978, 0.01456126756966114, -0.04840250313282013, 0.007148078177124262, -0.02673744596540928, 0.03485972806811333, -0.014045663177967072, 0.0306868739426136, -0.0636645257472992, -0.01879902184009552, -0.03947041183710098, -0.07096108049154282, 0.10906900465488434, 0.014099277555942535, 0.009772831574082375, -0.10761705785989761, -0.017504369840025902, 0.022834448143839836, -0.054180193692445755, -0.009920192882418633, 0.038036320358514786, 0.00806870311498642, -0.04654521495103836, -0.0060328650288283825, 0.08329537510871887, 0.09920406341552734, -0.031169265508651733, -0.048382580280303955, -0.026645276695489883, -0.07837287336587906, -0.02501004934310913, 0.03257149085402489, 0.007621238473802805, 0.10421078652143478, 0.014613594859838486, -0.14051613211631775, -0.03808964043855667, -0.1259884387254715, 0.010402010753750801, -0.06992128491401672, -0.04502260684967041, 0.034420136362314224, -0.05888836458325386, -0.023594241589307785, -0.034697066992521286, 0.024000583216547966, -0.054781414568424225, 0.07480300962924957, -0.0828426256775856, -0.08104947209358215, -0.013599262572824955, -0.08170972019433975, -0.00811529066413641, -0.08444247394800186, -0.012190315872430801, -0.05957924947142601, -0.007991239428520203, -0.02099638804793358, 0.046366993337869644, 0.01944098249077797, 0.035575371235609055, 0.026978401467204094, 0.11428794264793396, -0.029196912422776222, 0.01317634992301464, -0.04311243072152138, 0.06721880286931992, 0.029042495414614677, 0.025458035990595818, -0.03915894404053688, -0.0049195438623428345, 0.013879903592169285, -0.08984637260437012, -0.1091194674372673, -0.1400700956583023, -0.021135639399290085, 0.03851694613695145, -0.06783419847488403, 0.003485865192487836, -0.1353284865617752, 0.07597143948078156, 0.008195632137358189, -0.07586238533258438, -0.11479448527097702, -0.03643610328435898, -0.0109307412058115, 0.06157686188817024, -0.031207209452986717, 0.030196618288755417, 0.0244548711925745, 0.010655788704752922, -0.029248762875795364, 0.012262512929737568, -0.0654020830988884, 0.0016115038888528943, -0.04092187061905861, 0.0012236741604283452, -0.04263072460889816, -0.031487490981817245, 0.04339819774031639, 0.009525745175778866, 0.04983130097389221, -0.08349166065454483, 0.05227009952068329, 0.027299389243125916, 0.025469781830906868, -0.07456091046333313, 0.078698068857193, 0.007400678936392069, -0.0628323033452034, 0.06095542013645172, 0.0713762640953064, 0.06121370941400528, 0.03710735961794853, 0.04211156815290451, 0.001108465250581503, 0.053599581122398376, 0.059813499450683594, 0.03339965641498566, 5.4044025014886545e-33, 0.037280648946762085, 0.040225181728601456, 0.051824819296598434, -0.021397210657596588, -0.0007935536559671164, 0.13945108652114868, 0.0241300817579031, 0.0023150788620114326, -0.041712693870067596, 0.011886540800333023, -0.04960332065820694, 0.08801779896020889, -0.07282647490501404, -0.007346408441662788, 0.0007536948542110622, -0.049179382622241974, 0.02754715271294117, -0.022331859916448593, -0.062394533306360245, -0.010353046469390392, 0.00290051382035017, 0.021481459960341454, -0.049356888979673386, 0.0057695358991622925, -0.046410996466875076, -0.05974248796701431, 0.016350625082850456, -0.023541072383522987, -0.026925310492515564, 0.0062178513035178185, -0.057010866701602936, -0.04237046837806702, -0.014077277854084969, 0.0025556853506714106, -0.03816622495651245, 0.10028655081987381, -0.013832943513989449, 0.019006963819265366, 0.013140146620571613, 0.020260954275727272, 0.029148714616894722, 0.014695278368890285, 0.0005849470617249608, -0.07116687297821045, -0.017421307042241096, -0.023202229291200638, -0.02565952017903328, 0.026093723252415657, 0.05473634600639343, 0.033837687224149704, -0.08904150873422623, -0.031604837626218796, 0.08345948159694672, 0.007739990018308163, 0.10251941531896591, -0.007027785759419203, 0.024340761825442314, 0.07758460193872452, -0.030832218006253242, -0.0034164453390985727, 0.019544310867786407, -0.02913575991988182, 0.10621481388807297, -0.03804878145456314, -0.010926869697868824, -0.0340043306350708, 0.03742286562919617, 0.043792687356472015, -0.03748519346117973, 0.0446561761200428, -0.012827431783080101, 0.08884738385677338, 0.008045951835811138, 0.010135356336832047, 0.04419228434562683, -0.0006397433462552726, -0.0006402715807780623, 0.03314245119690895, 0.010169458575546741, -0.06264708936214447, -0.021700995042920113, -0.03474161773920059, 0.0071752918884158134, 0.1370750367641449, -0.08994010835886002, 0.06355170905590057, -0.017756668850779533, 0.03543337062001228, -0.03432197496294975, -0.07154234498739243, -0.04671870917081833, 0.011115762405097485, 0.001751512405462563, -0.019270870834589005, 0.059244681149721146, -6.287927932795687e-33, -0.016211101785302162, -0.03871408477425575, 0.0784720927476883, 0.0189069714397192, 0.02898714691400528, -0.04504698887467384, 0.037689171731472015, -0.013772780075669289, 0.002579055493697524, 0.06481648981571198, -0.0177252646535635, 0.011605789884924889, -0.005776422098278999, -0.042579177767038345, 0.01262575015425682, 0.024319389835000038, -0.01912224292755127, -0.060553211718797684, 0.09602401405572891, -0.012554001063108444, -0.04010004922747612, 0.026995612308382988, -0.007888145744800568, 0.1101761907339096, -0.05993807688355446, -0.03968792036175728, 0.04055039584636688, 0.06813400983810425, -0.06294608116149902, 0.02161659114062786, 0.007382705342024565, 0.003786242101341486, 0.016787497326731682, 0.051815491169691086, -0.08052099496126175, -0.009098397567868233, 0.0751008689403534, -0.012869144789874554, -0.003365235636010766, 0.0804799497127533, -0.04389598220586777, 0.045946840196847916, -0.0328248105943203, 0.013730996288359165, 0.07157611101865768, -0.056271031498909, 0.062423788011074066, 0.04333648458123207, -0.00975946057587862, -0.06285525113344193, -0.010736317373812199, 0.08950261771678925, -0.10567750036716461, 0.03307636082172394, -0.08345652371644974, -0.010435392148792744, -0.09745199233293533, 0.02335253544151783, -0.041665658354759216, 0.022396482527256012, -0.013915483839809895, 0.06765438616275787, 0.02166404016315937, -0.08165912330150604, 0.0076836347579956055, -0.08618796616792679, -0.035573165863752365, -0.07741385698318481, -0.07201449573040009, -0.05588630586862564, -0.015930604189634323, -0.07317810505628586, 0.0797421932220459, 0.04637306183576584, 0.038769979029893875, -0.05405079945921898, 0.02102516032755375, 0.04788495972752571, 0.10019184648990631, -0.08785583078861237, -0.027017582207918167, 0.024685151875019073, 0.017873361706733704, 0.14377380907535553, 0.0008979550329968333, 0.02043987438082695, -0.04668140411376953, 0.09048675000667572, -0.02816034108400345, 0.01392260193824768, 0.008983050473034382, -0.14156858623027802, -0.028184685856103897, 0.00032432583975605667, 0.005436704959720373, -5.770062472265636e-8, -0.01598847098648548, 0.0008857581997290254, -0.02487741783261299, 0.08301235735416412, 0.02514810673892498, -0.03554093465209007, 0.058492809534072876, 0.0364689975976944, -0.007014438044279814, 0.005568002816289663, -0.014953085221350193, 0.06256940960884094, -0.11449317634105682, 0.0030977348797023296, 0.00945537444204092, 0.0038608757313340902, -0.02538936957716942, -0.005752822384238243, -0.04568909853696823, 0.020701175555586815, -0.012635655701160431, 0.0325443409383297, 0.00783848948776722, 0.06446667015552521, 0.045187827199697495, 0.0020003688987344503, 0.040601201355457306, 0.04016394168138504, 0.05409914255142212, 0.026955621317029, -0.06693650037050247, 0.033681128174066544, -0.0030966964550316334, 0.021328935399651527, -0.037906136363744736, -0.011405380442738533, -0.02989923395216465, 0.04120786860585213, -0.0644342228770256, 0.022453876212239265, 0.007870658300817013, -0.01738104782998562, -0.013705501332879066, -0.015003498643636703, 0.0011796372709795833, 0.0418088324368, -0.005525344517081976, 0.009440048597753048, 0.09406395256519318, 0.007734410464763641, -0.018106307834386826, -0.02225380949676037, -0.01322367787361145, -0.0068727522157132626, -0.031510330736637115, -0.011696899309754372, -0.04816189780831337, -0.0319075882434845, 0.054662708193063736, -0.0031948727555572987, 0.10562045127153397, -0.13062165677547455, -0.060789428651332855, 0.01853642426431179 ]
-0.035671
geo points. By default, the shortest distance is taken into account when sorting in ascending order and the longest distance when sorting in descending order. Supported values are `min`, `max`, `median` and `avg`. `unit`:: The unit to use when computing sort values. The default is `m` (meters). NOTE: geo distance sorting does not support configurable missing values: the distance will always be considered equal to +Infinity+ when a document does not have values for the field that is used for distance computation. The following formats are supported in providing the coordinates: ===== Lat Lon as Properties [source,js] -------------------------------------------------- GET /\_search { "sort" : [ { "\_geo\_distance" : { "pin.location" : { "lat" : 40, "lon" : -70 }, "order" : "asc", "unit" : "km" } } ], "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE ===== Lat Lon as String Format in `lat,lon`. [source,js] -------------------------------------------------- GET /\_search { "sort" : [ { "\_geo\_distance" : { "pin.location" : "40,-70", "order" : "asc", "unit" : "km" } } ], "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE ===== Geohash [source,js] -------------------------------------------------- GET /\_search { "sort" : [ { "\_geo\_distance" : { "pin.location" : "drm3btev3e86", "order" : "asc", "unit" : "km" } } ], "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE ===== Lat Lon as Array Format in `[lon, lat]`, note, the order of lon/lat here in order to conform with http://geojson.org/[GeoJSON]. [source,js] -------------------------------------------------- GET /\_search { "sort" : [ { "\_geo\_distance" : { "pin.location" : [-70, 40], "order" : "asc", "unit" : "km" } } ], "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE ==== Multiple reference points Multiple geo points can be passed as an array containing any `geo\_point` format, for example [source,js] -------------------------------------------------- GET /\_search { "sort" : [ { "\_geo\_distance" : { "pin.location" : [[-70, 40], [-71, 42]], "order" : "asc", "unit" : "km" } } ], "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE and so forth. The final distance for a document will then be `min`/`max`/`avg` (defined via `mode`) distance of all points contained in the document to all points given in the sort request. ==== Script Based Sorting Allow to sort based on custom scripts, here is an example: [source,js] -------------------------------------------------- GET /\_search { "query" : { "term" : { "user" : "kimchy" } }, "sort" : { "\_script" : { "type" : "number", "script" : { "lang": "painless", "source": "doc['field\_name'].value \* params.factor", "params" : { "factor" : 1.1 } }, "order" : "asc" } } } -------------------------------------------------- // CONSOLE ==== Track Scores When sorting on a field, scores are not computed. By setting `track\_scores` to true, scores will still be computed and tracked. [source,js] -------------------------------------------------- GET /\_search { "track\_scores": true, "sort" : [ { "post\_date" : {"order" : "desc"} }, { "name" : "desc" }, { "age" : "desc" } ], "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE ==== Memory Considerations When sorting, the relevant sorted field values are loaded into memory. This means that per shard, there should be enough memory to contain them. For string based types, the field sorted on should not be analyzed / tokenized. For numeric types, if possible, it is recommended to explicitly set the type to narrower types (like `short`, `integer` and `float`).
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/sort.asciidoc
6.2
elasticsearch-6-2
[ -0.04494126886129379, -0.004065839573740959, 0.007408574689179659, 0.004347173031419516, -0.004184602294117212, 0.02306491509079933, -0.028668692335486412, 0.03948187828063965, 0.10592612624168396, -0.05765453726053238, 0.027366729453206062, 0.07697958499193192, -0.015884924679994583, 0.027233988046646118, -0.0744633600115776, -0.013289272785186768, -0.01573685184121132, -0.05649172142148018, -0.06227247416973114, -0.05775916203856468, 0.11113104969263077, -0.006390691734850407, 0.06901487708091736, 0.05872716009616852, 0.06498988717794418, -0.00010556131019257009, -0.014644874259829521, 0.015254179015755653, -0.013113128952682018, 0.024530529975891113, 0.0035207972396165133, 0.01651095412671566, 0.048088524490594864, 0.04238644614815712, -0.07408174872398376, -0.003080467227846384, -0.028817206621170044, -0.032485973089933395, 0.005020628217607737, 0.01343299075961113, -0.016904687508940697, 0.03316756337881088, 0.06755460053682327, -0.022050658240914345, 0.002240382134914398, -0.0014141706051304936, -0.069432333111763, -0.0134578263387084, -0.03151221200823784, 0.05207651108503342, -0.08652312308549881, 0.04990587383508682, -0.09305883944034576, 0.027587655931711197, -0.026192836463451385, 0.004809530917555094, -0.0326501727104187, -0.0054291049018502235, 0.07248211652040482, -0.018199210986495018, 0.03447551280260086, -0.04913216456770897, 0.019093897193670273, -0.015863602980971336, 0.06259315460920334, -0.13657021522521973, 0.028531184419989586, 0.016647225245833397, -0.026293307542800903, -0.022756051272153854, 0.07107625156641006, -0.013999535702168941, -0.014588951133191586, 0.017494669184088707, 0.051277633756399155, -0.00715898722410202, -0.039029840379953384, 0.01202835701406002, -0.05104042962193489, 0.0015246274415403605, -0.009558738209307194, -0.06245984137058258, 0.025057515129446983, 0.07299760729074478, -0.02999158948659897, -0.009223496541380882, -0.008586656302213669, 0.015979215502738953, 0.056647446006536484, -0.09826474636793137, 0.007795373909175396, -0.060672227293252945, -0.12454330176115036, 0.053861021995544434, 0.04001165181398392, -0.014127826318144798, 0.008410913869738579, 0.05292391777038574, -0.05274682492017746, 0.00708560086786747, 0.03788702189922333, 0.012112094089388847, -0.031536951661109924, -0.020666303113102913, 0.11907397210597992, 0.0035618082620203495, -0.056266363710165024, -0.013518168590962887, 0.02340959943830967, 0.013921136036515236, 0.009467349387705326, 0.0405038446187973, -0.06211457774043083, 0.010031633079051971, -0.0947747528553009, 0.006503233220428228, 0.05594083294272423, -0.07092922180891037, 0.0414678156375885, 0.0231142770498991, 0.01917228288948536, -0.014035637490451336, -0.015032918192446232, 0.0033806520514190197, 0.006457725539803505, 0.10968580842018127, 0.09870743006467819, 1.5474957011873242e-33, 0.012583494186401367, -0.026233632117509842, 0.08055587112903595, -0.08301277458667755, -0.06708936393260956, 0.01567738689482212, -0.08220039308071136, 0.009566863998770714, -0.04401072487235069, -0.00218685669824481, -0.07735634595155716, 0.05222452059388161, 0.0347515270113945, -0.07751788198947906, 0.02436133474111557, -0.04751448333263397, 0.08406516909599304, -0.015067747794091702, -0.08810905367136002, 0.0477464534342289, 0.006205533165484667, -0.08249640464782715, -0.04094436392188072, 0.005904509220272303, 0.02454686351120472, -0.02964976616203785, -0.08170861005783081, 0.005817282013595104, -0.10204271227121353, -0.012551641091704369, -0.046392325311899185, 0.013360154815018177, -0.022948414087295532, -0.04676531255245209, 0.09172412008047104, -0.0031332604121416807, -0.016113806515932083, -0.030343584716320038, -0.024675944820046425, -0.06869472563266754, 0.011299628764390945, 0.0008969611953943968, -0.04519045725464821, -0.08011751621961594, -0.010913566686213017, 0.047443438321352005, -0.005419845227152109, 0.0264875665307045, 0.07837745547294617, 0.041512131690979004, -0.07612419128417969, 0.047376904636621475, 0.014654154889285564, -0.022715860977768898, 0.09090343862771988, -0.01106197852641344, 0.09085924178361893, 0.008001572452485561, -0.018718013539910316, 0.0068920026533305645, -0.011529178358614445, 0.03202987089753151, 0.08693507313728333, 0.004393529146909714, 0.07061031460762024, -0.10594064742326736, 0.014078019186854362, 0.04718770086765289, 0.04487079009413719, 0.04728419706225395, 0.026547107845544815, 0.03741428256034851, 0.04384590685367584, 0.052344247698783875, 0.02855518087744713, -0.03946291655302048, 0.020910192281007767, -0.01624901220202446, -0.0007630789186805487, -0.05277155339717865, -0.04968733340501785, 0.030105406418442726, -0.0398557111620903, 0.035371046513319016, -0.0438394621014595, 0.02703012339770794, 0.036372266709804535, -0.017920594662427902, -0.05365126579999924, -0.06975799053907394, -0.052688244730234146, 0.021088799461722374, -0.04361104220151901, -0.07183125615119934, -0.043249212205410004, -2.723899958105545e-33, -0.02422315999865532, -0.025784801691770554, 0.03489938750863075, 0.08063945174217224, 0.0009379450930282474, -0.09084329754114151, 0.03934231773018837, 0.07905223220586777, 0.04203832149505615, 0.1025695651769638, -0.031762368977069855, -0.039496369659900665, 0.035551976412534714, -0.04307125136256218, 0.12418574094772339, 0.14397211372852325, -0.009899397380650043, -0.13481591641902924, -0.00607367092743516, -0.05204736813902855, 0.04544913396239281, -0.016129188239574432, -0.026460586115717888, 0.005880081560462713, -0.06511884927749634, -0.02612195909023285, 0.09855660796165466, -0.05369241163134575, -0.12706010043621063, -0.08477648347616196, -0.040240202099084854, -0.028774796053767204, -0.04641341045498848, 0.014047627337276936, -0.14504294097423553, -0.03046679124236107, 0.029441561549901962, 0.077214315533638, 0.006929883733391762, 0.04294634982943535, -0.05978138744831085, 0.04875391349196434, -0.0020478833466768265, -0.017532147467136383, 0.003677690401673317, 0.017834769561886787, 0.057997047901153564, -0.0012642079964280128, -0.04694709554314613, -0.08100847899913788, 0.05246851220726967, 0.061700575053691864, -0.050672367215156555, 0.054813139140605927, -0.04669198393821716, 0.0027667658869177103, -0.12527254223823547, 0.04452592134475708, -0.027895299717783928, -0.03977475315332413, 0.013732598163187504, -0.0737699642777443, 0.07083588093519211, 0.06062747538089752, 0.00901638064533472, 0.0069122957065701485, -0.05697996914386749, 0.03651759773492813, 0.0012863395968452096, -0.016971949487924576, 0.012443800456821918, 0.021459028124809265, 0.0782562643289566, 0.04094507917761803, -0.067545086145401, -0.024959886446595192, 0.05990394204854965, 0.05700163170695305, 0.06695622950792313, -0.04767880588769913, 0.02285769023001194, 0.06012648716568947, -0.013962420634925365, 0.1204574778676033, 0.03324102610349655, 0.051285117864608765, 0.04691775515675545, 0.020506370812654495, -0.03755021467804909, 0.036517295986413956, -0.02015235275030136, 0.02544192411005497, 0.005457366816699505, -0.05726996064186096, -0.07205409556627274, -5.537504677022298e-8, -0.10609260201454163, -0.029753534123301506, -0.09903787076473236, 0.015198216773569584, -0.0020647954661399126, 0.030120059847831726, 0.08172864466905594, 0.07590052485466003, -0.010048535652458668, 0.047504011541604996, 0.05121253430843353, 0.05423688888549805, -0.06549554318189621, 0.05181421339511871, -0.010385308414697647, -0.07103289663791656, -0.004123109392821789, -0.04840970039367676, -0.03895171731710434, 0.046104613691568375, 0.026190659031271935, 0.04827048256993294, 0.005276598501950502, 0.04236462712287903, 0.0384402796626091, 0.0237444881349802, 0.03959071263670921, 0.07372694462537766, 0.13673585653305054, -0.020448192954063416, -0.032009609043598175, 0.028428640216588974, 0.022197050973773003, -0.009653407149016857, -0.054163165390491486, -0.004004579968750477, -0.06056718900799751, 0.06843123584985733, -0.030880779027938843, 0.06281626224517822, -0.042095281183719635, -0.0593215711414814, -0.025839954614639282, 0.0022515947930514812, 0.059410564601421356, 0.005767992231994867, 0.06545236706733704, -0.01691952534019947, 0.028785603120923042, -0.02690136805176735, -0.018756475299596786, -0.05380311980843544, -0.05900042876601219, -0.018870782107114792, 0.0841875821352005, -0.050645023584365845, -0.02142343297600746, -0.06514403223991394, 0.054856184870004654, -0.06922624260187149, -0.019138839095830917, 0.010318391025066376, -0.06981170922517776, 0.02043445035815239 ]
0.058411
sorted on should not be analyzed / tokenized. For numeric types, if possible, it is recommended to explicitly set the type to narrower types (like `short`, `integer` and `float`).
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/sort.asciidoc
6.2
elasticsearch-6-2
[ -0.0010403681080788374, 0.009418259374797344, 0.038490790873765945, -0.001777532510459423, -0.019259104505181313, -0.0138609753921628, -0.01261479314416647, 0.02439868077635765, -0.008947822265326977, 0.005086270626634359, 0.009167619049549103, 0.07653262466192245, -0.02540736272931099, 0.04299238696694374, -0.09081652760505676, -0.0262284092605114, -0.030037444084882736, -0.013328655622899532, -0.008289004676043987, -0.05307209491729736, 0.025043873116374016, 0.03390416502952576, -0.0640498474240303, 0.030080704018473625, 0.030861925333738327, -0.050381552428007126, -0.06507674604654312, 0.042376209050416946, 0.04928544536232948, -0.015445702709257603, -0.1144411712884903, 0.08743565529584885, 0.05781245976686478, 0.03461040183901787, -0.004003787413239479, -0.016023797914385796, -0.04259154200553894, -0.03903700038790703, 0.03700515627861023, 0.011692021042108536, -0.013881441205739975, 0.010590399615466595, 0.08904435485601425, 0.019065601751208305, -0.07929057627916336, -0.010067573748528957, -0.02116445079445839, -0.05361568182706833, -0.05609915032982826, -0.006876940373331308, -0.0776575431227684, 0.13158604502677917, -0.02737412601709366, 0.06624710559844971, -0.09863677620887756, -0.03723049536347389, -0.06148460507392883, -0.012597468681633472, 0.05433998256921768, -0.025597665458917618, -0.07916995137929916, -0.0011020073434337974, 0.03632526099681854, -0.05799184739589691, 0.03766012191772461, -0.057978712022304535, 0.05003964155912399, -0.03736929967999458, -0.011545280925929546, 0.0699349120259285, 0.07885190099477768, 0.0179916825145483, -0.040667179971933365, 0.0917595624923706, -0.048479653894901276, 0.03596692904829979, -0.013242936693131924, -0.020586909726262093, -0.08575142174959183, -0.06586483865976334, -0.08597292751073837, -0.08181053400039673, 0.010450262576341629, 0.005237022880464792, 0.06894589960575104, -0.07829666882753372, 0.00943683460354805, -0.01675509475171566, -0.0060673984698951244, 0.06697838008403778, 0.031621579080820084, 0.048514336347579956, 0.055905334651470184, 0.04584797844290733, 0.08076662570238113, -0.012215928174555302, 0.08056895434856415, 0.08769412338733673, -0.010740447789430618, 0.05582055822014809, -0.011419005692005157, 0.044203050434589386, -0.0100091602653265, 0.05597870424389839, 0.04753829166293144, -0.04116930440068245, 0.02229279838502407, -0.07322724908590317, 0.006387012545019388, -0.06308362632989883, 0.036454956978559494, 0.017413077875971794, -0.03093421272933483, -0.014807530678808689, -0.08173920214176178, 0.024316193535923958, -0.01912715844810009, -0.017037782818078995, -0.034019727259874344, -0.006493547931313515, -0.029125409200787544, -0.018463611602783203, 0.0031676802318543196, 0.024814030155539513, -0.022024936974048615, 0.10939598828554153, 0.06344147771596909, -7.96803886588095e-34, -0.06517868489027023, -0.0020761671476066113, 0.021038062870502472, -0.07943107932806015, -0.07231312990188599, 0.0629584863781929, -0.05590511113405228, -0.020504148676991463, -0.052606090903282166, 0.003763046581298113, 0.00030858154059387743, 0.0759095773100853, -0.00319748860783875, -0.02580345794558525, 0.036599915474653244, -0.04917758330702782, 0.12737023830413818, -0.012755329720675945, -0.1725090593099594, -0.0816836804151535, 0.06768401712179184, -0.0486249141395092, -0.059520233422517776, 0.00611314969137311, 0.013955908827483654, 0.019008027389645576, -0.025163967162370682, -0.05054202675819397, 0.00950586423277855, 0.013794819824397564, -0.05672368034720421, -0.06136378273367882, 0.020518485456705093, -0.03488600626587868, 0.08180558681488037, 0.04776553064584732, 0.016840970143675804, 0.0526992529630661, 0.030180122703313828, -0.052924733608961105, -0.02650022692978382, 0.03397173807024956, 0.0043089743703603745, -0.06980748474597931, 0.0636395588517189, 0.04797454550862312, -0.007680332288146019, 0.11557862162590027, 0.04755987599492073, -0.006527087185531855, -0.0351349376142025, -0.026232315227389336, 0.04931554198265076, 0.0689421147108078, 0.04679638147354126, -0.07304418832063675, 0.06415260583162308, 0.032989151775836945, -0.034689921885728836, 0.023607054725289345, -0.017935140058398247, 0.02848370186984539, 0.10206455737352371, -0.09068533033132553, -0.032411154359579086, -0.0014910612953826785, -0.007255838252604008, 0.01632821187376976, 0.07648281753063202, 0.03980693593621254, 0.023934336379170418, 0.10612157732248306, 0.019987795501947403, 0.10115959495306015, 0.04737650975584984, 0.0329822301864624, 0.04409436509013176, -0.04480043426156044, -0.02262074127793312, -0.08629874885082245, 0.08344192802906036, 0.017607184126973152, 0.08381106704473495, 0.002478575799614191, -0.041099585592746735, -0.05581479147076607, -0.04665062576532364, 0.0437781848013401, -0.0023970522452145815, -0.0012332869227975607, 0.024031274020671844, 0.026646312326192856, 0.058675721287727356, -0.009199841879308224, -0.04328601434826851, -4.684795441135471e-34, -0.14272283017635345, 0.05093875154852867, 0.021202821284532547, 0.024128537625074387, -0.05715788155794144, -0.033679038286209106, -0.04798441752791405, -0.00781758688390255, 0.006478107068687677, 0.003629483515396714, 0.05742092430591583, -0.04714295640587807, -0.06583663821220398, -0.03213409334421158, 0.09152717143297195, -0.003935254644602537, -0.0866205245256424, -0.03488316386938095, 0.022807005792856216, 0.016103938221931458, -0.04250805824995041, -0.030773408710956573, 0.014863023534417152, 0.08734229952096939, -0.023414969444274902, 0.10202860087156296, 0.09306255728006363, -0.003481387160718441, -0.03313884139060974, -0.020137596875429153, -0.018198754638433456, -0.010756959207355976, -0.09940659254789352, -0.013947758823633194, -0.04561895132064819, -0.10854848474264145, 0.01377197913825512, 0.025138618424534798, 0.016233393922448158, 0.05267398804426193, -0.018891552463173866, 0.02021903358399868, -0.004580540116876364, 0.005865296348929405, 0.0022446266375482082, -0.04080810025334358, 0.016655322164297104, 0.017289957031607628, 0.0074541522189974785, -0.07715097814798355, 0.02809111587703228, 0.08077546954154968, -0.01955416426062584, -0.009533503092825413, -0.015828916803002357, 0.03250317648053169, -0.04152776673436165, 0.09413598477840424, -0.08461315184831619, -0.015931861475110054, -0.0039879814721643925, -0.011334340088069439, 0.06387627869844437, -0.06406695395708084, -0.02205735631287098, -0.08115586638450623, -0.016968969255685806, -0.0674537643790245, -0.038885824382305145, -0.03416619077324867, -0.0024195220321416855, -0.010419588536024094, -0.002127433894202113, -0.011082318611443043, -0.10035552084445953, -0.06795654445886612, 0.043816667050123215, 0.07085897773504257, 0.08643428981304169, 0.020352421328425407, 0.033638227730989456, 0.0682409405708313, 0.02054012194275856, 0.013796684332191944, -0.03153691440820694, 0.03336217254400253, 0.03025469183921814, 0.02185341902077198, -0.05672173947095871, 0.04415759816765785, -0.002390979789197445, -0.01242908462882042, 0.031398579478263855, 0.008451185189187527, -0.05587054044008255, -3.5301518153119105e-8, 0.08722005784511566, -0.12673862278461456, -0.038516949862241745, 0.05289917066693306, 0.009321922436356544, 0.020392974838614464, -0.07784505933523178, 0.02168436162173748, -0.00853922963142395, 0.0066233850084245205, 0.004838138353079557, 0.025268016383051872, -0.04887964949011803, -0.01691032201051712, 0.049469638615846634, -0.05382777377963066, 0.022050999104976654, -0.1450294405221939, -0.06880185753107071, -0.035871248692274094, -0.05821646749973297, 0.04652290791273117, -0.009563202038407326, 0.00039828167064115405, -0.0048874905332922935, 0.015832047909498215, 0.006257335189729929, 0.09901490807533264, 0.05709094554185867, -0.009948644787073135, 0.02600378356873989, 0.12182535231113434, -0.015493876300752163, -0.017437506467103958, -0.038727954030036926, 0.021007874980568886, 0.04797018691897392, 0.07087446749210358, 0.007537534460425377, -0.08123836666345596, -0.058227747678756714, 0.0005253056297078729, 0.015397916547954082, 0.009670228697359562, 0.05387543514370918, -0.02729034796357155, 0.013821168802678585, 0.03523281216621399, 0.08101893216371536, -0.012244791723787785, -0.0609099417924881, -0.01593559794127941, 0.004070448689162731, 0.06097659096121788, -0.0005839522927999496, 0.009824478067457676, -0.06474288552999496, 0.033829525113105774, -0.006614577490836382, -0.055352408438920975, 0.030741997063159943, -0.1592361032962799, -0.048305731266736984, 0.026128333061933517 ]
-0.016493
[[search-request-from-size]] === From / Size Pagination of results can be done by using the `from` and `size` parameters. The `from` parameter defines the offset from the first result you want to fetch. The `size` parameter allows you to configure the maximum amount of hits to be returned. Though `from` and `size` can be set as request parameters, they can also be set within the search body. `from` defaults to `0`, and `size` defaults to `10`. [source,js] -------------------------------------------------- GET /\_search { "from" : 0, "size" : 10, "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE Note that `from` + `size` can not be more than the `index.max\_result\_window` index setting which defaults to 10,000. See the <> or <> API for more efficient ways to do deep scrolling.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/from-size.asciidoc
6.2
elasticsearch-6-2
[ -0.013873985968530178, 0.0642157793045044, -0.02330184355378151, 0.019256245344877243, -0.06487568467855453, 0.05839571729302406, -0.021010739728808403, 0.017324356362223625, 0.018100569024682045, -0.03234749659895897, -0.01167039480060339, -0.01738657057285309, 0.019330330193042755, -0.06502354145050049, -0.02661416493356228, -0.019385255873203278, -0.017616700381040573, 0.06970024108886719, -0.01887134462594986, -0.06048809364438057, 0.10849011689424515, 0.08781784027814865, 0.0407874658703804, -0.043170809745788574, -0.023892439901828766, -0.05652729421854019, -0.10231342911720276, -0.10058113187551498, 0.04131592810153961, 0.016594476997852325, 0.0074360850267112255, -0.016393830999732018, -0.012602522037923336, 0.08304257690906525, -0.012617260217666626, -0.09355085343122482, -0.11845886707305908, -0.028706811368465424, 0.059446364641189575, 0.024225905537605286, 0.06682759523391724, 0.08831851929426193, -0.07147902250289917, -0.08758243918418884, -0.0020685624331235886, -0.017731159925460815, -0.08636226505041122, 0.03941648080945015, 0.008489208295941353, -0.02535073086619377, -0.07780340313911438, -0.0029556958470493555, -0.011121655814349651, 0.03092336468398571, 0.07054360955953598, -0.061159029603004456, -0.09675994515419006, -0.009350430220365524, -0.013712645508348942, -0.04032086580991745, -0.014994666911661625, -0.10588298738002777, 0.0006102041224949062, -0.03770262002944946, -0.00963331013917923, -0.07893924415111542, 0.008404136635363102, 0.012059910222887993, 0.04840708151459694, 0.050386324524879456, 0.026577036827802658, -0.023202862590551376, 0.0435803085565567, -0.020902710035443306, 0.03954807296395302, -0.028961392119526863, -0.06737230718135834, -0.020245229825377464, -0.055134449154138565, 0.042259346693754196, -0.08651599287986755, -0.09404163062572479, -0.0034383235033601522, 0.010181603953242302, -0.03882019221782684, -0.030200084671378136, -0.011275580152869225, -0.060141198337078094, 0.08629105240106583, -0.06589608639478683, -0.030238166451454163, -0.026674674823880196, -0.07183302193880081, 0.02402002550661564, 0.011952118016779423, -0.015867670997977257, -0.004175455309450626, -0.029224056750535965, 0.029312532395124435, -0.0468498058617115, 0.06416372209787369, -0.02157064899802208, 0.02841026894748211, -0.04482858255505562, -0.04610252380371094, -0.042767442762851715, -0.021306993439793587, 0.01650744304060936, -0.010376526042819023, 0.05987374484539032, -0.014239674434065819, 0.09367745369672775, -0.023028915748000145, -0.020633259788155556, -0.067135289311409, -0.04965383931994438, 0.040206268429756165, -0.07342465221881866, 0.02355838194489479, 0.02732126973569393, 0.10596859455108643, 0.06605063378810883, -0.08411678671836853, 0.0039113289676606655, -0.021809455007314682, 0.02947215922176838, 0.04812423139810562, 1.2073597067856758e-33, 0.027516575530171394, -0.006727657280862331, 0.07138475030660629, -0.033368755131959915, -0.04474031180143356, 0.06822753697633743, 0.023427501320838928, 0.04357993230223656, -0.05277968943119049, 0.019076086580753326, -0.09004376083612442, 0.06239829584956169, -0.06571892648935318, -0.0051023392006754875, -0.024206670001149178, -0.012649782933294773, 0.028177564963698387, -0.014197868295013905, -0.01682034134864807, 0.04460907727479935, -0.0006042830646038055, -0.0037418173160403967, -0.01348371896892786, 0.020037556067109108, 0.03879551216959953, -0.06913807988166809, -0.08479820191860199, 0.001265269354917109, -0.1520828902721405, -0.028333986178040504, -0.06165815889835358, 0.04345070570707321, -0.04461335018277168, -0.02902601845562458, 0.04844606667757034, 0.03003271482884884, -0.009912061505019665, 0.08440078794956207, -0.09824960678815842, -0.009938799776136875, -0.02098245918750763, 0.03901131823658943, 0.026463160291314125, -0.09379231929779053, -0.06408147513866425, -0.03446003794670105, -0.021821660920977592, -0.03105657547712326, 0.009387558326125145, 0.04056823253631592, -0.023700742051005363, 0.053432971239089966, -0.0007300130091607571, 0.023261699825525284, 0.10322790592908859, -0.06843642145395279, 0.06116817891597748, 0.08479149639606476, 0.0036937384866178036, 0.07706664502620697, 0.004851219244301319, -0.04163195565342903, 0.07725773751735687, 0.04694464057683945, 0.01303423848003149, 0.05238472297787666, 0.02536616288125515, 0.0886683464050293, -0.02053600735962391, 0.03947598859667778, 0.061061274260282516, -0.008186149410903454, 0.122596375644207, -0.0025961194187402725, 0.0247135479003191, -0.04979533329606056, -0.02649202011525631, 0.011139416135847569, 0.014715535566210747, 0.0068451641127467155, 0.04373793676495552, -0.07238049805164337, -0.054499320685863495, 0.03988644480705261, 0.0011218470754101872, 0.07291849702596664, -0.038127947598695755, 0.00001082197832147358, -0.015085581690073013, -0.01404853817075491, -0.03958474099636078, 0.022220032289624214, 0.013798017986118793, -0.06666537374258041, -0.08101484179496765, -4.543693782873067e-33, 0.05614152550697327, -0.05270032957196236, 0.07134229689836502, 0.008704141713678837, 0.022105077281594276, -0.03030402585864067, 0.004235642962157726, 0.08206922560930252, -0.005012308247387409, 0.04148272052407265, 0.006146062631160021, -0.014100369065999985, 0.09185752272605896, -0.047726381570100784, -0.01922311633825302, 0.10268639028072357, 0.005038837436586618, -0.05785328522324562, -0.010419147089123726, 0.007527514826506376, 0.014954357407987118, -0.01887495443224907, -0.05131101608276367, 0.01599900610744953, -0.04382391646504402, -0.032308757305145264, 0.09571819752454758, 0.02300955355167389, -0.05612438917160034, 0.005002561490982771, -0.05586628243327141, -0.08350169658660889, -0.0600956566631794, -0.014581999741494656, -0.05073923245072365, -0.0041908277198672295, 0.01312309131026268, 0.09842690825462341, 0.021794898435473442, 0.12298224866390228, -0.0277396347373724, 0.002794588217511773, 0.04588930308818817, -0.012193318456411362, 0.011618908494710922, -0.07714850455522537, 0.012878105975687504, 0.05981903523206711, 0.0044365134090185165, -0.09441080689430237, 0.05078544095158577, 0.060594506561756134, -0.04657701775431633, 0.07755418121814728, -0.05189891904592514, -0.0777590200304985, -0.07439713925123215, 0.0010447780368849635, -0.012293225154280663, -0.06706254184246063, -0.06845255196094513, -0.012819789350032806, -0.05314778909087181, -0.016034888103604317, 0.008487037383019924, -0.04183269292116165, -0.05622272193431854, -0.03644457086920738, -0.01818188466131687, 0.015227030031383038, -0.03884381800889969, -0.008340610191226006, 0.16535085439682007, 0.0707840621471405, -0.0339726097881794, 0.008724036626517773, -0.04440286010503769, -0.025428524240851402, 0.11274771392345428, 0.011031942442059517, -0.030554257333278656, 0.021809179335832596, 0.06541691720485687, 0.10844254493713379, 0.0008526931633241475, 0.043624360114336014, -0.05272413417696953, 0.05248990282416344, 0.010812533088028431, -0.012020977213978767, 0.030988594517111778, -0.10636050999164581, 0.006120148580521345, 0.020935621112585068, 0.0070100510492920876, -5.1528150635249403e-8, -0.07533648610115051, -0.015990406274795532, -0.03286786004900932, 0.060495175421237946, 0.019915953278541565, 0.06639270484447479, 0.06717507541179657, 0.09147751331329346, -0.0565909706056118, 0.0020600890275090933, 0.07198411971330643, 0.1305740475654602, 0.052125174552202225, 0.0247330404818058, -0.003625986399129033, -0.061301086097955704, 0.00039299207855947316, -0.034583695232868195, -0.001986035145819187, -0.052691053599119186, 0.013065272010862827, -0.0024436695966869593, 0.015367405489087105, 0.0005837709177285433, 0.10557183623313904, 0.014097691513597965, -0.06700002402067184, 0.08771245926618576, -0.029245251789689064, -0.057994402945041656, -0.004125063773244619, 0.000983630889095366, -0.03216167539358139, 0.02772977389395237, 0.03889551758766174, -0.0712256133556366, -0.05318150296807289, 0.023085886612534523, -0.046717319637537, -0.0004727591876871884, -0.02499980479478836, -0.04845942556858063, 0.010527454316616058, 0.05017295479774475, -0.06308586895465851, 0.009713701903820038, -0.020885542035102844, -0.025173190981149673, 0.08299591392278671, -0.06633403897285461, 0.11993694305419922, -0.07581759989261627, -0.016721554100513458, -0.015865527093410492, -0.01149120181798935, -0.050347987562417984, -0.015568171627819538, -0.009776505641639233, -0.02161797322332859, 0.021116698160767555, 0.06549859791994095, 0.028146252036094666, -0.02416199818253517, 0.054770875722169876 ]
0.007794
[[search-request-docvalue-fields]] === Doc value Fields Allows to return the <> representation of a field for each hit, for example: [source,js] -------------------------------------------------- GET /\_search { "query" : { "match\_all": {} }, "docvalue\_fields" : ["test1", "test2"] } -------------------------------------------------- // CONSOLE Doc value fields can work on fields that are not stored. Note that if the fields parameter specifies fields without docvalues it will try to load the value from the fielddata cache causing the terms for that field to be loaded to memory (cached), which will result in more memory consumption.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/docvalue-fields.asciidoc
6.2
elasticsearch-6-2
[ -0.0006422945880331099, 0.12165747582912445, -0.0010197445517405868, 0.09264952689409256, 0.024864133447408676, -0.010797843337059021, 0.00445889588445425, 0.053713761270046234, 0.10746924579143524, -0.01447116769850254, -0.06851570308208466, 0.01204640232026577, -0.020843645557761192, -0.04937290400266647, 0.054910432547330856, 0.019226690754294395, -0.036603495478630066, 0.00010301989823346958, -0.10335634648799896, -0.04460868984460831, 0.043608441948890686, 0.03890331834554672, -0.035547006875276566, -0.026400873437523842, -0.03348295018076897, 0.02483334392309189, -0.08534612506628036, -0.07042364776134491, 0.03611540421843529, 0.05974532291293144, 0.002700677141547203, 0.0034731696359813213, -0.05924401432275772, 0.04954254999756813, 0.011092870496213436, 0.03007473796606064, -0.019319474697113037, -0.008950861170887947, 0.044868405908346176, 0.010278183035552502, 0.0024250943679362535, 0.04443943500518799, -0.06631232053041458, -0.03821147233247757, 0.03509403392672539, -0.058771852403879166, -0.05046400427818298, -0.04496290162205696, -0.01610971800982952, -0.016174359247088432, -0.0933312326669693, 0.02271651290357113, -0.062405552715063095, 0.036059148609638214, 0.08017074316740036, 0.028233978897333145, -0.06605733186006546, 0.02305568754673004, -0.06589974462985992, 0.005091071128845215, -0.013699264265596867, -0.1130647361278534, 0.017840245738625526, -0.0026939730159938335, -0.008325043134391308, -0.04724988341331482, 0.042877376079559326, -0.03753828629851341, 0.020584404468536377, 0.0029765996150672436, 0.009523818269371986, 0.05762062966823578, 0.014050694182515144, -0.03900012746453285, 0.006229157093912363, 0.09539750963449478, -0.0470639169216156, -0.04199161008000374, 0.021441085264086723, -0.02271786704659462, -0.025273358449339867, -0.10795274376869202, -0.0797421857714653, 0.0004141243116464466, -0.013187143951654434, -0.031521402299404144, -0.006218793336302042, -0.06357919424772263, 0.08524905890226364, -0.015523930080235004, -0.028954923152923584, -0.0879271999001503, 0.004781016614288092, 0.04677716642618179, 0.021992750465869904, 0.04992718994617462, 0.04561948776245117, -0.0457550585269928, 0.038826365023851395, -0.017108967527747154, 0.06775908172130585, 0.010079961270093918, 0.06895402073860168, -0.014947635121643543, -0.017818380147218704, 0.003361661685630679, -0.015296275727450848, 0.009571920149028301, -0.08651987463235855, 0.004118636716157198, 0.006653512362390757, 0.07907149195671082, -0.009308290667831898, 0.040182676166296005, -0.01960253342986107, 0.10230377316474915, 0.03519754484295845, -0.08098427206277847, -0.01722244918346405, 0.10792682319879532, 0.08599910140037537, 0.02473105676472187, -0.051876798272132874, -0.02779535762965679, -0.01974061317741871, -0.0054825684055686, 0.02651527151465416, -4.41219453592444e-33, 0.08611965924501419, -0.032711196690797806, -0.015664145350456238, -0.036864180117845535, -0.05811487138271332, 0.05218437314033508, 0.051931414753198624, 0.11716088652610779, -0.02813800238072872, 0.007174818776547909, -0.057852089405059814, 0.09483609348535538, -0.0374235063791275, -0.1007622480392456, 0.01462662685662508, -0.019211262464523315, -0.03979141265153885, -0.0024804614949971437, -0.009853808209300041, 0.0685272291302681, 0.06324080377817154, -0.015680111944675446, -0.03413623571395874, 0.04098350554704666, 0.022100333124399185, -0.048342496156692505, -0.03805932030081749, -0.025619180873036385, -0.13603384792804718, -0.01318022608757019, -0.06074753776192665, 0.02250107377767563, 0.02516620047390461, 0.01476582232862711, 0.09623682498931885, 0.04141192510724068, 0.008653631433844566, 0.029294682666659355, -0.04406137391924858, -0.015042770653963089, -0.031095067039132118, 0.023041360080242157, 0.057373277842998505, -0.11381331831216812, -0.06661597639322281, -0.14085757732391357, -0.09331049770116806, 0.0013231044868007302, -0.0008900829707272351, -0.0029354828875511885, 0.026614300906658173, 0.10808959603309631, -0.05312376841902733, 0.00425700331106782, 0.09350845962762833, -0.029556194320321083, 0.010189504362642765, 0.07382331043481827, -0.014014462940394878, 0.08107899129390717, -0.0042649200186133385, -0.01069100946187973, 0.03328915685415268, 0.009942572563886642, -0.023762648925185204, 0.055710453540086746, 0.008810282684862614, 0.060686782002449036, -0.03732333332300186, 0.029325392097234726, 0.08728516846895218, 0.016871575266122818, 0.013399611227214336, -0.03540444001555443, 0.06437131762504578, -0.06706032902002335, -0.00650925375521183, -0.03002236783504486, -0.05686739459633827, -0.0041883764788508415, -0.029758501797914505, 0.0018607284873723984, -0.05853980407118797, 0.09918764233589172, -0.02756524085998535, 0.03187507018446922, -0.014647060073912144, -0.04384481534361839, -0.04538289085030556, -0.05350414663553238, 0.021058950573205948, 0.037555545568466187, -0.0882953330874443, -0.16790270805358887, 0.008833427913486958, 1.5284819882272775e-33, 0.058055829256772995, -0.11300703883171082, -0.014138026162981987, 0.07130411267280579, 0.01635877415537834, -0.05487183481454849, 0.04688500985503197, -0.0024076851550489664, 0.019842984154820442, 0.030159521847963333, 0.00023398637131322175, -0.019729817286133766, -0.04240356385707855, -0.06400012969970703, -0.028086286038160324, 0.06635183840990067, -0.04897550120949745, -0.06174034997820854, 0.04679648578166962, -0.0005409445147961378, 0.039249349385499954, 0.04766560345888138, 0.01926436834037304, 0.0824255496263504, -0.08096563071012497, -0.050920743495225906, -0.05286382883787155, -0.03332200273871422, -0.018908292055130005, 0.03207814320921898, 0.005095791071653366, -0.005158917512744665, -0.03931951895356178, 0.0005887121660634875, -0.008645043708384037, -0.009530885145068169, 0.08035401254892349, 0.07797309756278992, 0.0035687964409589767, 0.07002038508653641, 0.029378676787018776, 0.016917942091822624, -0.01909831166267395, 0.048103854060173035, 0.006500767078250647, -0.04202033951878548, -0.01955406740307808, 0.054670028388500214, 0.05530352145433426, -0.008377826772630215, 0.06609425693750381, -0.02197439782321453, -0.07839255034923553, 0.06838162988424301, -0.04936399310827255, -0.10494456440210342, -0.09627044200897217, -0.05388467013835907, -0.06481367349624634, 0.040960583835840225, 0.025942953303456306, 0.02571684680879116, -0.0653066635131836, 0.01975112408399582, 0.03289268910884857, 0.001944724004715681, -0.03081263229250908, -0.014713121578097343, -0.005816350691020489, -0.00784414354711771, -0.0011569319758564234, -0.11034198850393295, 0.09438859671354294, 0.07316955924034119, 0.026921892538666725, 0.052625857293605804, -0.018176350742578506, -0.05233239009976387, 0.08910591900348663, 0.008979849517345428, 0.036304254084825516, 0.018048055469989777, 0.02983192168176174, 0.041203051805496216, -0.06310776621103287, 0.04492194578051567, -0.09929647296667099, 0.0896269902586937, -0.0868273600935936, -0.02512167952954769, 0.024923525750637054, -0.027947990223765373, -0.0399957075715065, -0.04620448127388954, 0.061394136399030685, -4.9177788952192714e-8, -0.07386423647403717, -0.013689103536307812, -0.06758861243724823, 0.029493212699890137, -0.04764273390173912, -0.030849481001496315, 0.03729802370071411, 0.1328587532043457, 0.03581996634602547, -0.0459706112742424, 0.04310951381921768, 0.032780494540929794, -0.042762551456689835, -0.04663319140672684, -0.02145443670451641, 0.047389134764671326, 0.011304447427392006, -0.057939738035202026, -0.01440923847258091, -0.01334508415311575, 0.024069515988230705, -0.04394349083304405, -0.030132194980978966, -0.008121771737933159, 0.0873936340212822, 0.013915776275098324, 0.039943356066942215, 0.04269114136695862, 0.08991607278585434, -0.015244429931044579, -0.013272052630782127, -0.015715735033154488, -0.004726662300527096, -0.003185576992109418, 0.0681987926363945, 0.010648692026734352, 0.00795695185661316, -0.04591892287135124, -0.054348379373550415, 0.07875128835439682, 0.017363624647259712, 0.012424669228494167, -0.05709242448210716, 0.030335601419210434, 0.027535689994692802, -0.033029429614543915, -0.03021656535565853, 0.05057390406727791, 0.0703236386179924, -0.095743827521801, 0.02450137957930565, -0.05267410725355148, 0.006262861657887697, -0.023982619866728783, -0.11895567178726196, -0.03992292284965515, 0.08303087949752808, 0.0515257827937603, 0.039937615394592285, -0.04453236609697342, 0.055931925773620605, -0.009930663742125034, 0.007038524374365807, 0.04804658144712448 ]
0.021153
[[search-request-index-boost]] === Index Boost Allows to configure different boost level per index when searching across more than one indices. This is very handy when hits coming from one index matter more than hits coming from another index (think social graph where each user has an index). deprecated[5.2.0, This format is deprecated. Please use array format instead.] [source,js] -------------------------------------------------- GET /\_search { "indices\_boost" : { "index1" : 1.4, "index2" : 1.3 } } -------------------------------------------------- // CONSOLE // TEST[setup:index\_boost warning:Object format in indices\_boost is deprecated, please use array format instead] You can also specify it as an array to control the order of boosts. [source,js] -------------------------------------------------- GET /\_search { "indices\_boost" : [ { "alias1" : 1.4 }, { "index\*" : 1.3 } ] } -------------------------------------------------- // CONSOLE // TEST[continued] This is important when you use aliases or wildcard expression. If multiple matches are found, the first match will be used. For example, if an index is included in both `alias1` and `index\*`, boost value of `1.4` is applied.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/index-boost.asciidoc
6.2
elasticsearch-6-2
[ -0.03723178431391716, 0.06630634516477585, -0.006721532437950373, 0.10225225985050201, 0.04155314341187477, 0.014310149475932121, 0.0007019708282314241, -0.025040291249752045, -0.006186820100992918, -0.057369787245988846, -0.0443987138569355, -0.04641428589820862, -0.006921892520040274, -0.007676905952394009, 0.0019747125916182995, 0.03990354388952255, -0.07555989176034927, 0.002724653109908104, 0.043016333132982254, -0.03646276891231537, 0.07298284024000168, -0.025022415444254875, -0.043356962502002716, 0.0027041996363550425, -0.0015410842606797814, -0.00989797804504633, -0.07001921534538269, -0.03968710079789162, -0.0005098424735479057, 0.03803570568561554, -0.003308072919026017, -0.056894730776548386, -0.07888941466808319, 0.016786247491836548, -0.04211783409118652, -0.0457022450864315, -0.028045570477843285, -0.06723693013191223, 0.042315658181905746, -0.004535744432359934, 0.03718902915716171, 0.06142647564411163, -0.0711866244673729, -0.10866599529981613, -0.01715068891644478, -0.0281772892922163, -0.08549204468727112, -0.0034651511814445257, -0.04145340994000435, -0.06342373043298721, -0.11559829860925674, -0.016943978145718575, -0.027736220508813858, -0.027243850752711296, 0.08644117414951324, 0.026233023032546043, -0.07563485950231552, -0.04834040254354477, 0.07326900959014893, 0.013700521551072598, 0.04153217002749443, -0.059013038873672485, 0.05829234421253204, -0.07081538438796997, 0.010925197042524815, -0.07806632667779922, -0.0034522495698183775, -0.03185084089636803, -0.008782855235040188, 0.08003000915050507, 0.014236293733119965, 0.04405936598777771, -0.02162216231226921, -0.011665121652185917, 0.04462403804063797, 0.030880363658070564, -0.05498296394944191, -0.015214449726045132, 0.031430307775735855, 0.0004535880289040506, -0.12144150584936142, -0.07843395322561264, 0.012134939432144165, -0.040527645498514175, -0.012375786900520325, -0.056974928826093674, -0.06568235903978348, -0.14207200706005096, 0.004445752128958702, -0.06128934025764465, 0.02041383646428585, 0.006338478997349739, -0.028653034940361977, 0.055800169706344604, 0.06735234707593918, 0.035920027643442154, -0.00645463215187192, 0.008172065950930119, 0.030962634831666946, 0.016654841601848602, -0.05396568402647972, -0.09908194839954376, 0.00750840874388814, 0.02137550339102745, -0.018498947843909264, -0.0008303282083943486, 0.0026348200626671314, -0.018867434933781624, -0.016254417598247528, 0.016508154571056366, -0.028837330639362335, 0.08401106297969818, -0.00347251258790493, -0.0053110732696950436, -0.03970857337117195, 0.035367950797080994, 0.021789388731122017, -0.04016309976577759, 0.10180725157260895, 0.11495444923639297, 0.08740178495645523, -0.009931490756571293, -0.02329501323401928, 0.004895432852208614, 0.027295947074890137, 0.038483791053295135, 0.012697609141469002, 2.4222828931994275e-34, 0.1022210419178009, -0.036886245012283325, -0.044954124838113785, 0.0005700818146578968, -0.023787613958120346, 0.06816452741622925, 0.016874436289072037, 0.06386080384254456, -0.049811363220214844, 0.007378918118774891, -0.07702868431806564, 0.09500649571418762, -0.018084542825818062, -0.012114478275179863, 0.007565690670162439, -0.0543159581720829, 0.08650707453489304, 0.030018221586942673, 0.04412102699279785, -0.06075354665517807, 0.05628597363829613, -0.0061335209757089615, -0.005095113534480333, 0.013603960163891315, -0.0021449539344757795, -0.0005246869404800236, -0.04528036341071129, -0.07335615903139114, -0.026872728019952774, -0.0071013011038303375, -0.017193082720041275, 0.061092816293239594, -0.00881263054907322, -0.020365756005048752, 0.09545743465423584, 0.03854214400053024, 0.02502261847257614, 0.10164538770914078, -0.10967854410409927, -0.00242231204174459, 0.024120112881064415, 0.009059661999344826, 0.015007112175226212, -0.1266346275806427, -0.06070356443524361, 0.059764426201581955, -0.06790506839752197, -0.056629423052072525, -0.0010359878651797771, -0.017346583306789398, -0.08900655061006546, 0.096759133040905, -0.03601893037557602, 0.027458742260932922, 0.020061727613210678, -0.00045941813732497394, 0.018320977687835693, 0.09251918643712997, 0.0026328808162361383, -0.0007867022068239748, 0.007242129649966955, -0.01158855389803648, 0.0674445778131485, -0.008604981005191803, -0.03678514435887337, 0.003837199416011572, 0.006537156645208597, 0.06389760971069336, 0.03118743561208248, 0.05686003714799881, 0.031411442905664444, 0.05903228744864464, 0.038607969880104065, -0.022309741005301476, -0.009714128449559212, -0.12172556668519974, -0.0755070149898529, 0.04124891385436058, -0.014796528033912182, -0.08876070380210876, -0.06612510979175568, -0.07024149596691132, -0.013135550543665886, -0.013189204968512058, 0.04004950821399689, 0.00758258206769824, -0.0556170791387558, -0.03582127392292023, -0.0007297921692952514, 0.018568694591522217, -0.06823579967021942, 0.030016930773854256, -0.025016190484166145, -0.09750556945800781, -0.07762262970209122, -4.532784460613467e-33, 0.03430795297026634, -0.04624340683221817, 0.0381150022149086, 0.03769752010703087, 0.04577945917844772, -0.03818189352750778, 0.06922595947980881, -0.061672184616327286, -0.03933341056108475, 0.07212629169225693, 0.028687169775366783, 0.006008962169289589, 0.061644334346055984, -0.009983830153942108, -0.0006270891753956676, 0.07677443325519562, -0.08139374107122421, -0.04152044281363487, -0.0036765853874385357, -0.04728738218545914, -0.04021928086876869, 0.09078793227672577, -0.06335172802209854, 0.07618697732686996, -0.0411311537027359, -0.06520987302064896, 0.01862480863928795, 0.000032263014873024076, 0.005590124521404505, -0.030205773189663887, -0.007783044129610062, 0.0063665080815553665, -0.009799046441912651, 0.04300668463110924, -0.029355449602007866, -0.012993176467716694, -0.01467970386147499, -0.07137515395879745, 0.014257517643272877, 0.13362184166908264, 0.028900880366563797, 0.05633625015616417, 0.017463896423578262, 0.05751373991370201, 0.03576112911105156, 0.029384426772594452, 0.034529909491539, 0.05192115157842636, -0.028914140537381172, -0.08148197829723358, 0.010069639421999454, -0.02651204727590084, -0.046979308128356934, 0.057349205017089844, -0.0541471429169178, -0.07337363064289093, -0.021798817440867424, 0.03835589438676834, -0.04462936148047447, 0.08463630080223083, 0.00885069090873003, 0.011357128620147705, -0.031451284885406494, 0.027480602264404297, 0.056111257523298264, -0.09428216516971588, -0.01446017250418663, -0.07359109818935394, 0.06378311663866043, 0.004508603364229202, 0.014330338686704636, -0.0468144491314888, 0.10682551562786102, 0.03999761864542961, 0.002929821377620101, 0.0008090290939435363, 0.03183548152446747, 0.05619646608829498, 0.06233183667063713, -0.025443634018301964, -0.031133610755205154, 0.015097038820385933, 0.04702359810471535, 0.05488184839487076, -0.07627574354410172, 0.04427220672369003, 0.05862652510404587, 0.18805307149887085, -0.11107758432626724, -0.016887983307242393, 0.025121750310063362, -0.06794729828834534, -0.053717777132987976, 0.0006784512079320848, 0.025386543944478035, -5.4884107925090575e-8, -0.035217203199863434, 0.0048981900326907635, -0.09197413921356201, 0.07206988334655762, -0.0209176167845726, 0.003654202912002802, 0.037857480347156525, 0.014122724533081055, -0.04377848654985428, -0.04704704508185387, 0.002744050929322839, 0.04386269301176071, -0.01938464678823948, 0.009790082462131977, 0.008214309811592102, -0.11148671060800552, -0.10351631790399551, -0.009191390126943588, -0.0068802302703261375, 0.048201847821474075, -0.032724130898714066, 0.02934057079255581, -0.012711966410279274, 0.0073885186575353146, 0.05333872511982918, -0.0050117638893425465, -0.019116997718811035, 0.008116654120385647, 0.03702153265476227, 0.015824420377612114, -0.05181806907057762, 0.047299280762672424, 0.03832858428359032, 0.0006070730742067099, 0.06906164437532425, 0.07103632390499115, -0.03443954512476921, 0.05172528699040413, -0.026902252808213234, 0.05569060146808624, 0.07419397681951523, -0.02021084912121296, 0.006094194483011961, -0.01656232215464115, -0.03737227991223335, 0.008943029679358006, -0.060784485191106796, -0.03240177035331726, 0.07822947204113007, -0.037451572716236115, -0.048124607652425766, -0.04836273565888405, -0.043481986969709396, 0.04556124284863472, 0.01090216264128685, -0.04382630065083504, -0.08590802550315857, 0.02774720825254917, 0.004536173772066832, -0.03184356912970543, 0.1630440652370453, -0.10142169147729874, -0.0675668939948082, 0.01339755579829216 ]
0.020905
[[search-request-stored-fields]] === Fields WARNING: The `stored\_fields` parameter is about fields that are explicitly marked as stored in the mapping, which is off by default and generally not recommended. Use <> instead to select subsets of the original source document to be returned. Allows to selectively load specific stored fields for each document represented by a search hit. [source,js] -------------------------------------------------- GET /\_search { "stored\_fields" : ["user", "postDate"], "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE `\*` can be used to load all stored fields from the document. An empty array will cause only the `\_id` and `\_type` for each hit to be returned, for example: [source,js] -------------------------------------------------- GET /\_search { "stored\_fields" : [], "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE If the requested fields are not stored (`store` mapping set to `false`), they will be ignored. Stored field values fetched from the document itself are always returned as an array. On the contrary, metadata fields like `\_routing` are never returned as an array. Also only leaf fields can be returned via the `field` option. So object fields can't be returned and such requests will fail. Script fields can also be automatically detected and used as fields, so things like `\_source.obj1.field1` can be used, though not recommended, as `obj1.field1` will work as well. ==== Disable stored fields entirely To disable the stored fields (and metadata fields) entirely use: `\_none\_`: [source,js] -------------------------------------------------- GET /\_search { "stored\_fields": "\_none\_", "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE NOTE: <> and <> parameters cannot be activated if `\_none\_` is used.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/stored-fields.asciidoc
6.2
elasticsearch-6-2
[ 0.008224481716752052, 0.08834788203239441, 0.0157149825245142, 0.11013400554656982, -0.006042733322829008, 0.01804562658071518, -0.026189757511019707, 0.056243445724248886, 0.0501323826611042, -0.04594956338405609, -0.017600899562239647, -0.04700080677866936, 0.002593353856354952, -0.0803670808672905, 0.0050172810442745686, 0.04974408075213432, -0.06484227627515793, -0.004588800016790628, -0.0033982237800955772, -0.012625010684132576, -0.011302756145596504, 0.032749924808740616, 0.0059735821560025215, -0.03578491508960724, -0.02047206461429596, 0.0017032199539244175, -0.08766303211450577, -0.08862859010696411, -0.02386108599603176, 0.09788662940263748, -0.03285934403538704, 0.011954139918088913, -0.045174919068813324, 0.039293400943279266, 0.03841886669397354, -0.00778833357617259, -0.04604057967662811, -0.023726897314190865, 0.029077308252453804, 0.037195198237895966, -0.028264859691262245, -0.014147769659757614, -0.02150912769138813, -0.007456718012690544, -0.020566940307617188, -0.05518408864736557, -0.03691960871219635, -0.047743797302246094, -0.017627229914069176, 0.022590812295675278, -0.11792612075805664, 0.005857616662979126, -0.05761026218533516, 0.029743608087301254, 0.050954919308423996, 0.011804388836026192, -0.08214564621448517, 0.011755195446312428, -0.009126981720328331, -0.07347937673330307, -0.033084314316511154, -0.09424921125173569, 0.006481301039457321, 0.007634452544152737, -0.021117422729730606, -0.05811654403805733, -0.034083716571331024, -0.015912383794784546, 0.05129479616880417, -0.01599779725074768, 0.04953435808420181, 0.005973126273602247, 0.00997036974877119, -0.04021701589226723, 0.07103651762008667, 0.039661187678575516, -0.040105849504470825, -0.0026728324592113495, -0.004499857313930988, -0.05113424360752106, -0.00901427399367094, -0.10338959097862244, -0.07796016335487366, -0.049946129322052, -0.02715778537094593, -0.048950180411338806, -0.05289753898978233, -0.10705866664648056, 0.09415265172719955, -0.048751894384622574, -0.055511217564344406, -0.09204421937465668, 0.009945903904736042, 0.016845865175127983, -0.0011862317332997918, 0.01048347819596529, 0.030057813972234726, -0.019369354471564293, 0.06851726025342941, 0.015894541516900063, 0.023925771936774254, 0.00782329123467207, 0.061086490750312805, -0.03361736238002777, -0.018936745822429657, 0.0013458030298352242, -0.012339865788817406, 0.033370088785886765, -0.05281919986009598, 0.036907926201820374, -0.030497318133711815, 0.051098525524139404, -0.015698140487074852, -0.009627334773540497, 0.010340581648051739, 0.035360511392354965, 0.04480212181806564, -0.09030462056398392, -0.04761263355612755, 0.14628900587558746, 0.08507458120584488, 0.038862042129039764, -0.048221345990896225, 0.012656991370022297, -0.0399465449154377, 0.015095610171556473, 0.07315292209386826, 3.5476708789629535e-34, 0.10907341539859772, 0.004182697739452124, 0.014757510274648666, -0.005805452819913626, -0.06589166074991226, 0.047543298453092575, 0.050679661333560944, 0.06934963911771774, -0.01492317020893097, 0.025011444464325905, -0.06718792021274567, 0.0802563726902008, -0.04012681543827057, -0.049994081258773804, -0.029828425496816635, 0.025783564895391464, -0.04423984885215759, -0.010621006600558758, 0.03326597064733505, 0.04485844448208809, 0.07650086283683777, 0.00017451787425670773, -0.021618740633130074, 0.033853672444820404, 0.02167702652513981, -0.06113668531179428, -0.024755436927080154, -0.010622324422001839, -0.11483456194400787, -0.018552761524915695, -0.060184184461832047, 0.0030260602943599224, 0.04945575073361397, -0.024144722148776054, 0.03073768876492977, 0.05916721373796463, -0.014428699389100075, 0.03849372640252113, -0.07745380699634552, 0.02321743778884411, 0.056515470147132874, -0.021569445729255676, 0.09093263000249863, -0.1105320081114769, -0.06811349093914032, -0.08221166580915451, -0.0695439949631691, 0.007437061984091997, 0.024981455877423286, -0.010396331548690796, -0.04686492681503296, 0.04848996549844742, -0.06925034523010254, -0.028057530522346497, 0.11678381264209747, 0.007431107107549906, -0.052868347615003586, 0.08948667347431183, -0.011291716247797012, -0.013276470825076103, 0.04596555605530739, 0.01274530403316021, 0.03874358907341957, -0.015165464952588081, 0.009350932203233242, -0.01824890822172165, 0.011769450269639492, 0.08528203517198563, -0.06122089922428131, 0.027286186814308167, 0.02572580985724926, 0.0005941268755123019, 0.05411649867892265, -0.03674200549721718, 0.05983855202794075, -0.0785321518778801, -0.012136800214648247, -0.020198239013552666, -0.013925621286034584, 0.04957552254199982, -0.016284869983792305, -0.019958382472395897, -0.09899114072322845, 0.06755684316158295, -0.002408409956842661, 0.12698011100292206, -0.009157692082226276, -0.02451411262154579, -0.04175402596592903, -0.03231308236718178, 0.0195955540984869, -0.022632792592048645, -0.10388197749853134, -0.11411113291978836, 0.0012856952380388975, -3.631933711943253e-33, 0.07224584370851517, -0.13055206835269928, 0.001332046347670257, 0.005833670496940613, 0.057427242398262024, -0.029218565672636032, 0.026932157576084137, 0.040773097425699234, 0.012935208156704903, 0.03695725277066231, 0.023239972069859505, -0.06161051616072655, 0.031854402273893356, -0.05170002579689026, -0.023402677848935127, 0.06206956133246422, -0.07456465065479279, -0.07300099730491638, -0.015293591655790806, 0.008864210918545723, 0.008161642588675022, 0.007351535838097334, -0.054824162274599075, 0.08711016923189163, -0.019106026738882065, -0.06164363771677017, -0.006556997075676918, 0.0009613553411327302, -0.062192123383283615, 0.0396970696747303, -0.03774472698569298, -0.004032765980809927, -0.08770661056041718, 0.03263482823967934, -0.03986261039972305, 0.0075683509930968285, 0.046277936547994614, 0.10277953743934631, -0.00015213330334518105, 0.08602770417928696, -0.04595189541578293, 0.03040744736790657, -0.027774952352046967, 0.004285873379558325, 0.061340223997831345, 0.020314963534474373, -0.0009533674456179142, 0.055724136531353, 0.056753888726234436, -0.010469319298863411, 0.027956727892160416, -0.03200026974081993, -0.08888498693704605, 0.005287392530590296, -0.050718385726213455, -0.08401942998170853, -0.04621994122862816, -0.07077313214540482, -0.009760585613548756, -0.021877171471714973, -0.008745301514863968, 0.0008123800507746637, -0.010809078812599182, -0.021557290107011795, -0.01239825040102005, -0.08819647133350372, 0.0036267598625272512, 0.039146825671195984, -0.006473274901509285, -0.09298712015151978, -0.01158025674521923, -0.08363879472017288, 0.12419914454221725, 0.02560862898826599, 0.054226353764534, 0.06159154698252678, 0.014872473664581776, -0.02047041989862919, 0.08556029945611954, -0.04922006279230118, 0.04170762002468109, 0.012426731176674366, 0.05064724013209343, 0.10337372869253159, -0.011430892162024975, 0.03941316530108452, -0.04977145791053772, 0.09504494071006775, -0.07118350267410278, -0.070103719830513, 0.04163162782788277, -0.08789028972387314, -0.022153513506054878, -0.04815411940217018, 0.025992905721068382, -5.6940798742743937e-8, -0.03645647317171097, 0.07600332051515579, -0.055781830102205276, 0.031919047236442566, -0.028964383527636528, 0.06138630956411362, 0.07526377588510513, 0.08304361999034882, -0.015609838999807835, -0.06600432097911835, 0.028212081640958786, 0.10089626908302307, 0.02932618372142315, -0.02439833991229534, -0.04798296466469765, 0.015536236576735973, -0.010393541306257248, 0.001770260976627469, 0.00267668510787189, 0.022157859057188034, 0.0708780288696289, -0.06559489667415619, 0.02542283572256565, 0.0033673932775855064, 0.119817353785038, 0.04626407101750374, -0.051513075828552246, -0.010738936252892017, 0.041761718690395355, -0.018672196194529533, -0.02558448538184166, 0.01777665875852108, -0.013094943016767502, -0.014284960925579071, 0.029229918494820595, -0.030954131856560707, 0.06552842259407043, -0.026008745655417442, -0.13357560336589813, 0.08443278819322586, 0.05178152397274971, 0.037211887538433075, -0.06233597174286842, 0.0191107876598835, -0.07104280591011047, -0.030273551121354103, 0.010245791636407375, 0.05619167163968086, 0.11268792301416397, -0.0174483060836792, 0.02746061235666275, -0.045971762388944626, 0.024310875684022903, 0.015621162950992584, -0.0606415756046772, -0.05016941577196121, 0.10051926225423813, 0.08353082835674286, 0.009011073969304562, -0.06836479902267456, 0.04515011981129646, 0.009277435019612312, -0.01589013822376728, 0.06705587357282639 ]
-0.007925
[[search-request-script-fields]] === Script Fields Allows to return a <> (based on different fields) for each hit, for example: [source,js] -------------------------------------------------- GET /\_search { "query" : { "match\_all": {} }, "script\_fields" : { "test1" : { "script" : { "lang": "painless", "source": "doc['price'].value \* 2" } }, "test2" : { "script" : { "lang": "painless", "source": "doc['price'].value \* params.factor", "params" : { "factor" : 2.0 } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] Script fields can work on fields that are not stored (`my\_field\_name` in the above case), and allow to return custom values to be returned (the evaluated value of the script). Script fields can also access the actual `\_source` document and extract specific elements to be returned from it by using `params['\_source']`. Here is an example: [source,js] -------------------------------------------------- GET /\_search { "query" : { "match\_all": {} }, "script\_fields" : { "test1" : { "script" : "params['\_source']['message']" } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] Note the `\_source` keyword here to navigate the json-like model. It's important to understand the difference between `doc['my\_field'].value` and `params['\_source']['my\_field']`. The first, using the doc keyword, will cause the terms for that field to be loaded to memory (cached), which will result in faster execution, but more memory consumption. Also, the `doc[...]` notation only allows for simple valued fields (you can't return a json object from it) and makes sense only for non-analyzed or single term based fields. However, using `doc` is still the recommended way to access values from the document, if at all possible, because `\_source` must be loaded and parsed every time it's used. Using `\_source` is very slow.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/script-fields.asciidoc
6.2
elasticsearch-6-2
[ -0.020487423986196518, 0.09062133729457855, 0.025166694074869156, 0.0678807869553566, 0.020534619688987732, 0.045551616698503494, 0.016603028401732445, 0.06515826284885406, 0.06021123751997948, -0.05459007993340492, -0.03492436930537224, -0.0380701944231987, 0.018129875883460045, -0.04245627298951149, 0.07553163915872574, 0.043104179203510284, -0.09080586582422256, -0.007249661721289158, -0.04846034198999405, -0.08472294360399246, 0.030039124190807343, 0.04500674456357956, -0.02880413830280304, -0.03928060084581375, -0.03956933319568634, 0.0412149652838707, -0.02641412243247032, -0.030232157558202744, 0.0019848986994475126, 0.06948461383581161, -0.02778751403093338, -0.0067399428226053715, -0.054122619330883026, 0.05832645669579506, 0.06958447396755219, 0.027960700914263725, -0.03606351837515831, 0.0011600274592638016, 0.02353932522237301, 0.04847530648112297, 0.019273849204182625, -0.002021872205659747, -0.05603964626789093, -0.14928250014781952, 0.05739757791161537, -0.07937800139188766, -0.033268436789512634, 0.031689152121543884, -0.0033739679493010044, 0.025179553776979446, -0.07784523814916611, -0.026455838233232498, -0.007563041057437658, 0.012017104774713516, 0.048575080931186676, -0.002313116332516074, -0.0586232990026474, -0.012891273014247417, -0.011030398309230804, -0.06849812716245651, -0.04681752994656563, -0.11500508338212967, 0.0021647969260811806, 0.00382600468583405, 0.01006560679525137, -0.04650384187698364, -0.04924687743186951, 0.01662437431514263, -0.023367436602711678, 0.013683679513633251, -0.023444127291440964, 0.01575160026550293, 0.04061615467071533, -0.07423786073923111, 0.044348981231451035, 0.04256827011704445, -0.04000774770975113, -0.066108338534832, 0.008260326460003853, -0.0011787754483520985, -0.05026310682296753, -0.15346930921077728, -0.1264715939760208, 0.029722344130277634, 0.0057542347349226475, -0.05754471197724342, 0.025209125131368637, -0.020122772082686424, 0.11486738920211792, -0.032557252794504166, -0.06972697377204895, -0.05848744884133339, 0.02433009259402752, 0.03251040354371071, 0.05416887626051903, 0.07906188815832138, 0.011552420444786549, -0.054367177188396454, 0.045477092266082764, 0.016852347180247307, 0.04572753235697746, -0.04600558429956436, 0.07947465777397156, -0.07688829302787781, -0.023968372493982315, 0.020482927560806274, -0.04051241651177406, 0.007371638435870409, -0.006745347287505865, -0.015057584270834923, -0.07024480402469635, 0.054265234619379044, -0.00038689273060299456, 0.009683499112725258, -0.014219333417713642, 0.01809586212038994, 0.1177913248538971, -0.051852837204933167, -0.0027142625767737627, 0.04967181384563446, 0.09415382146835327, 0.03350560739636421, -0.07542700320482254, -0.02422332763671875, 0.01241640467196703, 0.0006170059205032885, -0.004807352554053068, -1.893577768458714e-33, 0.05894948169589043, -0.034533966332674026, 0.0026542432606220245, -0.07293032854795456, -0.054046470671892166, 0.06690637767314911, 0.05640272796154022, 0.0935330018401146, -0.00785864982753992, 0.03760925680398941, -0.05100966617465019, 0.09384134411811829, -0.04873465374112129, -0.05154747888445854, -0.04098464548587799, -0.031325530260801315, -0.037879761308431625, -0.038348130881786346, 0.025527769699692726, 0.015172907151281834, 0.01470900233834982, -0.015199951827526093, -0.03900061547756195, 0.06965143233537674, -0.03436774015426636, -0.07009651511907578, -0.009866621345281601, -0.02248571068048477, -0.11033475399017334, -0.03439522534608841, -0.047001633793115616, -0.02882612682878971, -0.011792252771556377, -0.018027981743216515, 0.014527669176459312, 0.04434496536850929, -0.005968140903860331, -0.002601624233648181, -0.036818668246269226, -0.0013918023323640227, -0.05286332219839096, -0.01328041311353445, 0.05626055225729942, -0.06862688809633255, -0.03877371549606323, -0.0836271196603775, -0.11751347035169601, 0.008602272719144821, 0.02975938655436039, 0.002559140557423234, -0.062075965106487274, 0.059225231409072876, 0.015705060213804245, -0.038791779428720474, 0.08133634179830551, -0.013108029961585999, -0.04972708970308304, 0.07976891845464706, -0.009435183368623257, 0.01157089602202177, -0.009296413511037827, -0.01502447109669447, 0.025287223979830742, 0.027356334030628204, 0.006100362166762352, 0.04482265189290047, 0.03260791301727295, 0.06360194832086563, -0.014422247186303139, 0.04572605341672897, 0.0348045788705349, 0.010945097543299198, 0.04571923241019249, 0.0217109527438879, 0.04625887796282768, -0.04521288350224495, -0.013474508188664913, 0.020494133234024048, 0.0296006016433239, 0.009936369024217129, -0.04240678250789642, -0.0026370615232735872, -0.03875673562288284, 0.09089240431785583, 0.01239397469907999, 0.10420673340559006, -0.046298135071992874, -0.06286627799272537, -0.075715571641922, -0.08250700682401657, -0.0038338552694767714, 0.026414256542921066, -0.10382474958896637, -0.1324271559715271, 0.06532833725214005, -1.1055530797968345e-33, 0.05419303476810455, -0.02474636770784855, 0.042350076138973236, 0.030139034613966942, 0.043002817779779434, -0.06760375946760178, 0.03339063376188278, -0.044031742960214615, 0.07762065529823303, 0.12341678887605667, -0.013523384928703308, -0.03127118572592735, 0.01462644338607788, -0.08866822719573975, 0.016593340784311295, 0.0854630172252655, -0.05347071960568428, 0.005589173641055822, 0.06476125866174698, -0.023459354415535927, -0.014278754591941833, 0.08195305615663528, -0.019632866606116295, 0.06807821989059448, -0.08574143052101135, -0.07884825766086578, 0.013235407881438732, 0.007457371801137924, -0.10024663805961609, 0.04735405743122101, -0.008455940522253513, -0.026558298617601395, -0.017865044996142387, 0.08926136791706085, -0.044531453400850296, -0.0019075364107266068, 0.06375309079885483, 0.03287916257977486, 0.004896368831396103, 0.06023235246539116, -0.01935419626533985, 0.026637649163603783, 0.0321173332631588, 0.026337498798966408, 0.030575459823012352, -0.005992756690829992, 0.03454708680510521, 0.06770934164524078, -0.006100690457969904, -0.055362552404403687, -0.004990774672478437, 0.04921526461839676, -0.10387952625751495, 0.038884662091732025, -0.07162290811538696, -0.1157320886850357, -0.04795359820127487, -0.04327777400612831, -0.0834275409579277, -0.00395795376971364, -0.0003166766546200961, 0.030764752998948097, 0.03682739660143852, 0.04454344883561134, 0.05106206238269806, -0.07781406491994858, -0.01150326058268547, -0.03080781362950802, -0.03220430389046669, -0.05411281809210777, -0.01794278807938099, -0.08797501772642136, 0.13077698647975922, 0.03384533151984215, 0.014145391061902046, 0.04352668672800064, -0.021122941747307777, -0.008622605353593826, 0.07838241010904312, 0.01359766349196434, 0.05550467222929001, -0.019389856606721878, 0.04452284798026085, 0.08778096735477448, -0.0914238691329956, 0.035724956542253494, -0.048978470265865326, 0.10840390622615814, -0.020828841254115105, -0.04313499853014946, 0.014805673621594906, -0.04712964594364166, 0.025304332375526428, 0.005688923876732588, 0.027058476582169533, -4.806974018833898e-8, -0.05801481753587723, 0.008912128396332264, -0.06407161802053452, 0.028338894248008728, -0.08692947030067444, 0.029855959117412567, 0.042954981327056885, 0.07928697764873505, -0.0330258309841156, -0.023238377645611763, 0.04044600576162338, 0.04946104437112808, 0.008350545540452003, 0.009952414780855179, -0.054581817239522934, 0.023258572444319725, -0.060149144381284714, 0.017447402700781822, -0.015420620329678059, 0.03884241729974747, 0.10944845527410507, -0.007605559658259153, 0.003354863030835986, 0.0369378961622715, 0.13856558501720428, 0.019222714006900787, -0.025558054447174072, -0.008818858303129673, 0.0484166145324707, 0.03437928110361099, -0.018173428252339363, -0.017144624143838882, -0.005698223132640123, -0.028511878103017807, 0.02406959980726242, -0.035359639674425125, 0.0394505113363266, 0.015228232368826866, -0.064388707280159, 0.09105992317199707, 0.018170354887843132, 0.03926150128245354, -0.10112790763378143, 0.018036749213933945, 0.02569710835814476, -0.03838999941945076, -0.04031655192375183, -0.012137259356677532, 0.09228631854057312, -0.06465829163789749, 0.01598934270441532, -0.03887670487165451, 0.03721807152032852, -0.05646153911948204, -0.07552175968885422, -0.06072162836790085, 0.018784694373607635, 0.053976207971572876, 0.014964712783694267, -0.03760518506169319, 0.06057925149798393, -0.029284946620464325, 0.02987786754965782, 0.03714689239859581 ]
0.006472
[[search-request-inner-hits]] === Inner hits The <> and <> features allow the return of documents that have matches in a different scope. In the parent/child case, parent documents are returned based on matches in child documents or child documents are returned based on matches in parent documents. In the nested case, documents are returned based on matches in nested inner objects. In both cases, the actual matches in the different scopes that caused a document to be returned are hidden. In many cases, it's very useful to know which inner nested objects (in the case of nested) or children/parent documents (in the case of parent/child) caused certain information to be returned. The inner hits feature can be used for this. This feature returns per search hit in the search response additional nested hits that caused a search hit to match in a different scope. Inner hits can be used by defining an `inner\_hits` definition on a `nested`, `has\_child` or `has\_parent` query and filter. The structure looks like this: [source,js] -------------------------------------------------- "" : { "inner\_hits" : { } } -------------------------------------------------- // NOTCONSOLE If `inner\_hits` is defined on a query that supports it then each search hit will contain an `inner\_hits` json object with the following structure: [source,js] -------------------------------------------------- "hits": [ { "\_index": ..., "\_type": ..., "\_id": ..., "inner\_hits": { "": { "hits": { "total": ..., "hits": [ { "\_type": ..., "\_id": ..., ... }, ... ] } } }, ... }, ... ] -------------------------------------------------- // NOTCONSOLE ==== Options Inner hits support the following options: [horizontal] `from`:: The offset from where the first hit to fetch for each `inner\_hits` in the returned regular search hits. `size`:: The maximum number of hits to return per `inner\_hits`. By default the top three matching hits are returned. `sort`:: How the inner hits should be sorted per `inner\_hits`. By default the hits are sorted by the score. `name`:: The name to be used for the particular inner hit definition in the response. Useful when multiple inner hits have been defined in a single search request. The default depends in which query the inner hit is defined. For `has\_child` query and filter this is the child type, `has\_parent` query and filter this is the parent type and the nested query and filter this is the nested path. Inner hits also supports the following per document features: \* <> \* <> \* <> \* <> \* <> \* <> [[nested-inner-hits]] ==== Nested inner hits The nested `inner\_hits` can be used to include nested inner objects as inner hits to a search hit. [source,js] -------------------------------------------------- PUT test { "mappings": { "\_doc": { "properties": { "comments": { "type": "nested" } } } } } PUT test/\_doc/1?refresh { "title": "Test title", "comments": [ { "author": "kimchy", "number": 1 }, { "author": "nik9000", "number": 2 } ] } POST test/\_search { "query": { "nested": { "path": "comments", "query": { "match": {"comments.number" : 2} }, "inner\_hits": {} <1> } } } -------------------------------------------------- // CONSOLE <1> The inner hit definition in the nested query. No other options need to be defined. An example of a response snippet that could be generated from the above search request: [source,js] -------------------------------------------------- { ..., "hits": { "total": 1, "max\_score": 1.0, "hits": [ { "\_index": "test", "\_type": "\_doc", "\_id": "1", "\_score": 1.0, "\_source": ..., "inner\_hits": { "comments": { <1> "hits": { "total": 1, "max\_score": 1.0, "hits": [ { "\_index": "test", "\_type": "\_doc", "\_id": "1", "\_nested": { "field": "comments", "offset": 1 }, "\_score": 1.0, "\_source": { "author": "nik9000", "number": 2 } } ] } } } } ] } } -------------------------------------------------- // TESTRESPONSE[s/"\_source": \.\.\./"\_source": $body.hits.hits.0.\_source/] // TESTRESPONSE[s/\.\.\./"timed\_out": false, "took": $body.took, "\_shards":
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/inner-hits.asciidoc
6.2
elasticsearch-6-2
[ -0.11398366093635559, 0.10159534960985184, 0.06522104144096375, 0.10247170925140381, 0.08654838800430298, -0.049965307116508484, -0.042808543890714645, -0.008165153674781322, 0.09409860521554947, -0.04815222695469856, -0.03396821394562721, -0.024074608460068703, 0.018773958086967468, -0.04077621549367905, 0.052247967571020126, 0.03192326799035072, 0.013174175284802914, -0.02139211818575859, -0.029569100588560104, -0.04521104693412781, 0.06045231223106384, 0.016977934166789055, -0.006365954875946045, -0.06908535957336426, -0.036737047135829926, 0.06142053008079529, -0.06522488594055176, -0.06130728870630264, 0.05890219658613205, 0.03302904963493347, 0.075674869120121, 0.102475106716156, -0.04840578883886337, 0.04230063408613205, -0.04106317460536957, 0.029026249423623085, 0.016338946297764778, -0.03678036481142044, 0.03244291990995407, -0.04730718582868576, 0.00574927544221282, 0.0638326033949852, -0.02059750445187092, -0.09101373702287674, -0.023697875440120697, -0.031449925154447556, -0.061590101569890976, -0.017988130450248718, -0.07712894678115845, -0.0170447938144207, -0.13246001303195953, -0.06762896478176117, -0.06429043412208557, 0.07852434366941452, 0.06132441759109497, 0.011090165004134178, -0.05952451378107071, -0.026733696460723877, -0.01247793436050415, -0.013320086523890495, 0.0030642966739833355, -0.10373147577047348, -0.03508497402071953, -0.04603861644864082, 0.06247720867395401, -0.04178876429796219, -0.010918708518147469, -0.03195349499583244, 0.0288205835968256, 0.02496163174510002, 0.08955399692058563, 0.035901132971048355, 0.0012228683335706592, -0.022344985976815224, 0.07912318408489227, 0.013257522135972977, -0.04313962906599045, -0.06695178896188736, 0.01022416539490223, -0.07113128155469894, -0.04504511505365372, -0.019243525341153145, -0.04881154000759125, -0.014172221533954144, 0.05957840755581856, 0.00912665668874979, 0.056087151169776917, -0.10775568336248398, 0.07782604545354843, 0.029365520924329758, -0.008356309495866299, -0.1099751815199852, 0.0036449949257075787, 0.043987300246953964, -0.007164503913372755, -0.03344196826219559, 0.057061709463596344, -0.017188750207424164, 0.06358975172042847, -0.014995075762271881, 0.06764426827430725, 0.00045753023005090654, 0.08427710831165314, -0.05666206404566765, 0.007297399919480085, -0.007464327849447727, -0.015549545176327229, 0.03437144681811333, 0.014326851814985275, -0.024094274267554283, -0.0837007388472557, 0.05285828560590744, 0.020272601395845413, -0.03898019343614578, -0.09250638633966446, -0.052835751324892044, 0.09153846651315689, -0.018616659566760063, 0.040141478180885315, 0.046525515615940094, 0.05871699005365372, 0.04054682329297066, -0.014132126234471798, -0.05249471589922905, 0.01725279726088047, -0.02762461267411709, -0.0964740589261055, 6.757393193207246e-33, 0.07566650211811066, -0.053694069385528564, -0.06742727011442184, -0.006722584366798401, -0.015117750503122807, 0.04880526661872864, 0.037486594170331955, 0.044576261192560196, -0.04557090252637863, 0.04305514320731163, -0.040870971977710724, 0.06666561216115952, -0.020136618986725807, -0.032236143946647644, 0.029947716742753983, 0.02642277255654335, -0.06784942746162415, 0.011086942628026009, -0.050282783806324005, 0.030684256926178932, -0.04383699223399162, 0.018855949863791466, -0.002441809978336096, 0.03333207592368126, 0.0825895294547081, 0.00043646941776387393, -0.004917147569358349, -0.06452664732933044, -0.14186491072177887, 0.013132200576364994, -0.018188364803791046, 0.024588342756032944, -0.02696220949292183, 0.027383778244256973, 0.05429408699274063, 0.10722991079092026, 0.037829142063856125, -0.05968363583087921, -0.06712580472230911, -0.02858779951930046, -0.061031442135572433, -0.05214625224471092, 0.03318486735224724, -0.08054531365633011, -0.0723293200135231, -0.061108656227588654, -0.11893922090530396, 0.014340241439640522, 0.055661413818597794, 0.01534668356180191, 0.016353430226445198, 0.07462313771247864, 0.01717354729771614, -0.01620926894247532, 0.027905629947781563, 0.04903419315814972, -0.04680359736084938, 0.07141640037298203, 0.002130352659150958, 0.07810968160629272, 0.114372119307518, -0.09617240726947784, 0.04143579676747322, -0.04313921183347702, -0.054806094616651535, 0.028181148692965508, 0.008951437659561634, 0.027465064078569412, 0.0952872782945633, 0.004620788153260946, 0.011880053207278252, 0.05798915773630142, -0.004391354974359274, -0.02445460669696331, 0.02373172529041767, -0.08211558312177658, -0.055337902158498764, -0.02465168572962284, 0.08031768351793289, -0.06903349608182907, -0.04466591402888298, 0.0016109934076666832, -0.03275604918599129, 0.042248714715242386, -0.051381830126047134, 0.04477306827902794, -0.014640698209404945, -0.09497220069169998, -0.10689134895801544, 0.004988981410861015, -0.017404906451702118, -0.015307082794606686, -0.08304208517074585, -0.05678381025791168, 0.059934068471193314, -8.716785788342546e-33, 0.026218848302960396, -0.04822742938995361, 0.012565942481160164, -0.041673216968774796, -0.05013512447476387, -0.060308411717414856, 0.017153535038232803, -0.020019318908452988, 0.037309929728507996, 0.03679872304201126, 0.002892205258831382, -0.007622460834681988, -0.024639038369059563, -0.050021566450595856, -0.02780502289533615, 0.08412177860736847, 0.012720107100903988, -0.11190962046384811, 0.05512770637869835, -0.020029714331030846, 0.03916078060865402, 0.020852072164416313, -0.0337345115840435, 0.09594564884901047, -0.021567797288298607, -0.058248333632946014, 0.0017587818438187242, -0.013573897071182728, 0.02492099069058895, 0.0028453452978283167, 0.02689179964363575, -0.012327469885349274, -0.04230450466275215, 0.0593932569026947, -0.0386013500392437, -0.0358603410422802, 0.014515643008053303, -0.0513080470263958, 0.04985739663243294, 0.017990130931138992, 0.030650673434138298, 0.03309325501322746, 0.03044307604432106, 0.05863410234451294, -0.015583110973238945, 0.015264468267560005, 0.0386354960501194, 0.13688643276691437, 0.04696645960211754, -0.08493587374687195, 0.04588167741894722, -0.01579793356359005, -0.0357067845761776, 0.05131583288311958, -0.06948424130678177, -0.029644675552845, 0.010352076031267643, -0.07963509112596512, 0.01785922795534134, 0.05394928157329559, 0.008241979405283928, 0.02709897793829441, -0.06911823153495789, 0.06396185606718063, -0.04451244696974754, -0.04114976152777672, -0.07029599696397781, -0.05450965464115143, 0.032105181366205215, -0.054948702454566956, -0.035792067646980286, -0.06127374619245529, 0.07349098473787308, -0.036097463220357895, 0.009114188142120838, 0.0010751637164503336, 0.0050731259398162365, -0.08829634636640549, 0.015926897525787354, -0.022692270576953888, -0.04366821050643921, -0.00414725486189127, 0.008416172116994858, 0.08612252026796341, 0.01284659281373024, -0.020594865083694458, -0.050955139100551605, 0.045321863144636154, -0.017851701006293297, -0.025587165728211403, 0.017239760607481003, -0.020497146993875504, -0.07227295637130737, -0.003356560366228223, 0.020550500601530075, -6.059101309574544e-8, -0.09751755744218826, -0.036884333938360214, -0.08259764313697815, 0.018861357122659683, 0.0034737656824290752, 0.025701574981212616, 0.06556712090969086, 0.08357764035463333, -0.07206632196903229, -0.04281234368681908, 0.01687704771757126, 0.016080496832728386, -0.02677997574210167, -0.03399769589304924, 0.038877878338098526, -0.025646258145570755, -0.0024990709498524666, -0.013264215551316738, -0.04240044951438904, 0.07009101659059525, 0.034744396805763245, -0.007416088599711657, 0.023891335353255272, 0.06699520349502563, 0.010428391396999359, 0.02654033526778221, 0.005235118791460991, 0.05144159123301506, 0.019935892894864082, -0.0005940135451965034, -0.038535669445991516, 0.11105157434940338, -0.02629990689456463, 0.05689733102917671, 0.016207989305257797, 0.0824136808514595, 0.018302418291568756, 0.0530998557806015, -0.06694328784942627, 0.029675818979740143, 0.0745663270354271, -0.024935374036431313, -0.018602494150400162, 0.024753428995609283, -0.01711122691631317, 0.05342511460185051, 0.023712309077382088, -0.05853549763560295, 0.09496842324733734, -0.026352249085903168, 0.018304480239748955, -0.07977179437875748, -0.018277134746313095, 0.04495478421449661, -0.04414224624633789, -0.015835056081414223, 0.016180027276277542, -0.008709133602678776, 0.0706460028886795, 0.016697954386472702, 0.11276718974113464, 0.04425041005015373, 0.06318867951631546, 0.07829628139734268 ]
0.091124
{ "total": 1, "max\_score": 1.0, "hits": [ { "\_index": "test", "\_type": "\_doc", "\_id": "1", "\_nested": { "field": "comments", "offset": 1 }, "\_score": 1.0, "\_source": { "author": "nik9000", "number": 2 } } ] } } } } ] } } -------------------------------------------------- // TESTRESPONSE[s/"\_source": \.\.\./"\_source": $body.hits.hits.0.\_source/] // TESTRESPONSE[s/\.\.\./"timed\_out": false, "took": $body.took, "\_shards": $body.\_shards/] <1> The name used in the inner hit definition in the search request. A custom key can be used via the `name` option. The `\_nested` metadata is crucial in the above example, because it defines from what inner nested object this inner hit came from. The `field` defines the object array field the nested hit is from and the `offset` relative to its location in the `\_source`. Due to sorting and scoring the actual location of the hit objects in the `inner\_hits` is usually different than the location a nested inner object was defined. By default the `\_source` is returned also for the hit objects in `inner\_hits`, but this can be changed. Either via `\_source` filtering feature part of the source can be returned or be disabled. If stored fields are defined on the nested level these can also be returned via the `fields` feature. An important default is that the `\_source` returned in hits inside `inner\_hits` is relative to the `\_nested` metadata. So in the above example only the comment part is returned per nested hit and not the entire source of the top level document that contained the comment. [[nested-inner-hits-source]] ==== Nested inner hits and +\_source+ Nested document don't have a `\_source` field, because the entire source of document is stored with the root document under its `\_source` field. To include the source of just the nested document, the source of the root document is parsed and just the relevant bit for the nested document is included as source in the inner hit. Doing this for each matching nested document has an impact on the time it takes to execute the entire search request, especially when `size` and the inner hits' `size` are set higher than the default. To avoid the relatively expensive source extraction for nested inner hits, one can disable including the source and solely rely on doc values fields. Like this: [source,js] -------------------------------------------------- PUT test { "mappings": { "\_doc": { "properties": { "comments": { "type": "nested" } } } } } PUT test/\_doc/1?refresh { "title": "Test title", "comments": [ { "author": "kimchy", "text": "comment text" }, { "author": "nik9000", "text": "words words words" } ] } POST test/\_search { "query": { "nested": { "path": "comments", "query": { "match": {"comments.text" : "words"} }, "inner\_hits": { "\_source" : false, "docvalue\_fields" : ["comments.text.keyword"] } } } } -------------------------------------------------- // CONSOLE //// Response not included in text but tested for completeness sake. [source,js] -------------------------------------------------- { ..., "hits": { "total": 1, "max\_score": 1.0444683, "hits": [ { "\_index": "test", "\_type": "\_doc", "\_id": "1", "\_score": 1.0444683, "\_source": ..., "inner\_hits": { "comments": { <1> "hits": { "total": 1, "max\_score": 1.0444683, "hits": [ { "\_index": "test", "\_type": "\_doc", "\_id": "1", "\_nested": { "field": "comments", "offset": 1 }, "\_score": 1.0444683, "fields": { "comments.text.keyword": [ "words words words" ] } } ] } } } } ] } } -------------------------------------------------- // TESTRESPONSE[s/"\_source": \.\.\./"\_source": $body.hits.hits.0.\_source/] // TESTRESPONSE[s/\.\.\./"timed\_out": false, "took": $body.took, "\_shards": $body.\_shards/] //// [[hierarchical-nested-inner-hits]] ==== Hierarchical levels of nested object fields and inner hits. If a mapping has multiple levels of hierarchical nested object fields each level can be accessed via dot notated path. For example if there is a `comments` nested field that contains a `votes` nested field and votes should directly be returned with the root hits then the following path can be defined:
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/inner-hits.asciidoc
6.2
elasticsearch-6-2
[ -0.013872439973056316, 0.07211139053106308, 0.014803467318415642, 0.10162416100502014, 0.030288532376289368, 0.004766963422298431, 0.027223173528909683, 0.01569186896085739, 0.08517182618379593, 0.03741936385631561, -0.008812420070171356, -0.08210904151201248, 0.044294971972703934, 0.014349383302032948, 0.00899747759103775, 0.06016170233488083, -0.039514388889074326, -0.010590696707367897, -0.05478876456618309, -0.02694670855998993, 0.03740011528134346, 0.06637639552354813, 0.03103761188685894, -0.03693901002407074, -0.008379192091524601, 0.006160713266581297, -0.09188612550497055, 0.03503846377134323, 0.006282372400164604, 0.0668787881731987, -0.0031214512418955564, -0.011201238259673119, -0.008699566125869751, 0.052578479051589966, 0.0553528293967247, -0.008102305233478546, 0.03296174854040146, -0.021980026736855507, 0.05658083036541939, 0.04909907653927803, 0.061886414885520935, -0.008363841101527214, -0.004038118291646242, -0.08000291138887405, 0.024011854082345963, -0.08676648885011673, -0.03280332311987877, -0.012745643965899944, -0.04318634420633316, -0.012725905515253544, -0.09161541610956192, -0.05189733952283859, -0.01789945177733898, 0.05951165407896042, 0.052525848150253296, 0.020252851769328117, -0.05244460701942444, 0.00410778634250164, -0.0493878498673439, -0.09174828976392746, 0.07472940534353256, -0.14778709411621094, -0.017120318487286568, -0.04369232431054115, -0.068167544901371, -0.06509020924568176, -0.05618178844451904, 0.050707925111055374, 0.016288770362734795, 0.05225706472992897, -0.0015407274477183819, 0.04746513068675995, -0.003730674972757697, 0.020393747836351395, 0.08216427266597748, 0.061980102211236954, -0.06146297603845596, -0.027663443237543106, 0.033866025507450104, -0.06627818197011948, -0.09127485752105713, -0.13204069435596466, -0.014737037941813469, 0.0021788133308291435, 0.020969673991203308, -0.002203428652137518, 0.05316808074712753, 0.030327562242746353, -0.014895519241690636, -0.05129673331975937, -0.0806097462773323, -0.030741242691874504, 0.0619063526391983, 0.02573811635375023, 0.03850791975855827, 0.08315367251634598, -0.04943370819091797, -0.0509132519364357, 0.08086259663105011, 0.053258009254932404, 0.012337855063378811, 0.02284410409629345, -0.004288974218070507, -0.07286199927330017, -0.003961001057177782, 0.01804456114768982, -0.0025515849702060223, 0.017743565142154694, -0.0658639520406723, -0.007252123206853867, 0.014763537794351578, 0.10671108961105347, -0.021228710189461708, 0.00265682814642787, -0.006168358027935028, -0.015735579654574394, -0.00021970533998683095, -0.033999621868133545, 0.0407586432993412, 0.056061360985040665, 0.14904938638210297, -0.0029340621549636126, -0.055151164531707764, 0.00510449567809701, 0.024164078757166862, 0.014915437437593937, 0.023853441700339317, -9.456694095311911e-34, 0.11111114919185638, 0.012699373997747898, -0.002431528875604272, -0.03686003014445305, 0.0004543001123238355, 0.024170638993382454, 0.037839967757463455, 0.10076214373111725, -0.0010648589814081788, 0.014957856386899948, -0.09439092874526978, -0.003787766443565488, 0.030780719593167305, -0.06355070322751999, -0.021528473123908043, -0.022532081231474876, 0.001210083719342947, 0.053494956344366074, -0.0022955727763473988, 0.017120199277997017, 0.05592203885316849, -0.014744105748832226, -0.06135266274213791, 0.03747287765145302, 0.010888446122407913, -0.04177434369921684, -0.03248760849237442, -0.038557108491659164, -0.13596895337104797, -0.023009344935417175, -0.011808140203356743, -0.03277333825826645, -0.0061217667534947395, 0.005395499523729086, 0.05906000733375549, 0.005325491074472666, -0.01457249466329813, 0.02261178381741047, -0.05691748484969139, 0.033352725207805634, -0.021690260618925095, -0.002344609471037984, -0.012438167817890644, -0.04999914392828941, -0.09452634304761887, -0.010462167672812939, -0.08001699298620224, -0.033295489847660065, 0.05254444107413292, -0.010363440029323101, -0.0567394383251667, 0.04417331516742706, 0.0492168590426445, -0.04117443040013313, -0.0012010122882202268, -0.018312325701117516, -0.030293049290776253, 0.05054463446140289, -0.0017962168203666806, -0.02359485626220703, -0.0365501344203949, -0.0005282468046061695, 0.03549545630812645, 0.014305945485830307, 0.0393468476831913, 0.01918070763349533, 0.02036048099398613, 0.005057147704064846, 0.007795470766723156, 0.014953638426959515, 0.01684115268290043, 0.1053033322095871, -0.010448936372995377, -0.02274180017411709, -0.0412660576403141, -0.10673275589942932, 0.0012398989638313651, -0.0024124360643327236, -0.004292753059417009, 0.01437628734856844, 0.010827917605638504, -0.03458492457866669, -0.06484442949295044, 0.008270815014839172, -0.0625690296292305, 0.11164023727178574, -0.03765774518251419, -0.08309155702590942, -0.11432516574859619, -0.11454682797193527, -0.01862543635070324, -0.02494574896991253, -0.08278494328260422, -0.16054055094718933, -0.025524448603391647, -3.5274783196564748e-34, 0.06159574165940285, -0.011201154440641403, -0.0018857399700209498, -0.019191384315490723, 0.03769392892718315, -0.03429766744375229, 0.07179707288742065, 0.040738873183727264, 0.02810843288898468, 0.04872945323586464, 0.049894675612449646, -0.09673178195953369, -0.019608814269304276, -0.046306900680065155, -0.041131872683763504, 0.03125171363353729, -0.0737508162856102, -0.09283991158008575, 0.04415582865476608, -0.05135598033666611, 0.013282726518809795, 0.061506226658821106, 0.02886088192462921, 0.06665393710136414, -0.053204137831926346, -0.056166280061006546, 0.02063623070716858, -0.029602045193314552, -0.03757980093359947, 0.020261533558368683, 0.04122697561979294, 0.02045566961169243, -0.047158390283584595, 0.07060757279396057, -0.04426742345094681, -0.029853645712137222, 0.012785599566996098, -0.0017826096154749393, 0.004854714963585138, 0.08755294978618622, 0.058366626501083374, 0.07693443447351456, -0.03662438690662384, 0.01489374227821827, 0.03289274498820305, 0.006385466083884239, 0.06733360886573792, 0.06947145611047745, -0.06402267515659332, -0.03459217771887779, -0.015033427625894547, -0.048930369317531586, -0.10094510018825531, 0.1114223524928093, 0.0010241544805467129, -0.06376542896032333, 0.008192427456378937, -0.09445534646511078, -0.06668510288000107, -0.02870776504278183, -0.03238080441951752, 0.09821195900440216, -0.02595876157283783, 0.07034610211849213, 0.05761802941560745, -0.05246369540691376, -0.05375593900680542, -0.0508292093873024, -0.08310674875974655, -0.00047127186553552747, -0.002567821880802512, -0.02060636132955551, 0.06224958598613739, 0.028268825262784958, 0.053588926792144775, 0.03951730206608772, 0.007437839172780514, 0.04620939493179321, 0.014679206535220146, 0.04612552374601364, -0.05155292525887489, -0.03687569126486778, 0.020600030198693275, 0.13038483262062073, -0.02098451368510723, -0.006126053631305695, 0.008399954065680504, 0.11363371461629868, -0.03930522873997688, 0.012439423240721226, -0.005367459263652563, -0.02232307568192482, 0.04669293016195297, -0.023305000737309456, 0.031491219997406006, -4.989571067426368e-8, -0.10693875700235367, 0.029507163912057877, -0.08230326324701309, 0.054093264043331146, -0.05158257484436035, 0.08169946819543839, 0.05934124439954758, 0.04735816270112991, -0.0309351347386837, -0.02557905577123165, 0.0019246985903009772, -0.011751820333302021, -0.01169083546847105, -0.04695376753807068, -0.06671617180109024, -0.043308258056640625, -0.03938010334968567, 0.042809195816516876, -0.02278563193976879, -0.015905173495411873, 0.04951115697622299, 0.033844880759716034, -0.00007763396570226178, -0.04294898360967636, 0.10858222842216492, 0.08733347803354263, -0.01849484257400036, 0.024686219170689583, -0.05757042393088341, -0.04492920637130737, 0.014814912341535091, 0.010328729636967182, -0.009786252863705158, -0.05126040801405907, 0.003948680590838194, 0.0410141721367836, 0.03319832310080528, 0.05200854688882828, -0.03224950656294823, 0.09377530217170715, -0.008858773857355118, 0.015978405252099037, -0.07250822335481644, 0.02342318370938301, 0.04084400087594986, -0.09540050476789474, -0.07036608457565308, 0.06454131752252579, 0.06646331399679184, -0.08362647891044617, 0.02954312413930893, -0.0586632676422596, -0.0164999607950449, -0.020354317501187325, -0.0643695667386055, -0.009902874939143658, 0.06631623208522797, 0.00898935366421938, -0.037196606397628784, 0.04455007240176201, 0.1380884200334549, -0.0019404735649004579, -0.028296608477830887, 0.03959975764155388 ]
0.032101
mapping has multiple levels of hierarchical nested object fields each level can be accessed via dot notated path. For example if there is a `comments` nested field that contains a `votes` nested field and votes should directly be returned with the root hits then the following path can be defined: [source,js] -------------------------------------------------- PUT test { "mappings": { "\_doc": { "properties": { "comments": { "type": "nested", "properties": { "votes": { "type": "nested" } } } } } } } PUT test/\_doc/1?refresh { "title": "Test title", "comments": [ { "author": "kimchy", "text": "comment text", "votes": [] }, { "author": "nik9000", "text": "words words words", "votes": [ {"value": 1 , "voter": "kimchy"}, {"value": -1, "voter": "other"} ] } ] } POST test/\_search { "query": { "nested": { "path": "comments.votes", "query": { "match": { "comments.votes.voter": "kimchy" } }, "inner\_hits" : {} } } } -------------------------------------------------- // CONSOLE Which would look like: [source,js] -------------------------------------------------- { ..., "hits": { "total": 1, "max\_score": 0.6931472, "hits": [ { "\_index": "test", "\_type": "\_doc", "\_id": "1", "\_score": 0.6931472, "\_source": ..., "inner\_hits": { "comments.votes": { <1> "hits": { "total": 1, "max\_score": 0.6931472, "hits": [ { "\_index": "test", "\_type": "\_doc", "\_id": "1", "\_nested": { "field": "comments", "offset": 1, "\_nested": { "field": "votes", "offset": 0 } }, "\_score": 0.6931472, "\_source": { "value": 1, "voter": "kimchy" } } ] } } } } ] } } -------------------------------------------------- // TESTRESPONSE[s/"\_source": \.\.\./"\_source": $body.hits.hits.0.\_source/] // TESTRESPONSE[s/\.\.\./"timed\_out": false, "took": $body.took, "\_shards": $body.\_shards/] This indirect referencing is only supported for nested inner hits. [[parent-child-inner-hits]] ==== Parent/child inner hits The parent/child `inner\_hits` can be used to include parent or child: [source,js] -------------------------------------------------- PUT test { "mappings": { "\_doc": { "properties": { "my\_join\_field": { "type": "join", "relations": { "my\_parent": "my\_child" } } } } } } PUT test/\_doc/1?refresh { "number": 1, "my\_join\_field": "my\_parent" } PUT test/\_doc/2?routing=1&refresh { "number": 1, "my\_join\_field": { "name": "my\_child", "parent": "1" } } POST test/\_search { "query": { "has\_child": { "type": "my\_child", "query": { "match": { "number": 1 } }, "inner\_hits": {} <1> } } } -------------------------------------------------- // CONSOLE <1> The inner hit definition like in the nested example. An example of a response snippet that could be generated from the above search request: [source,js] -------------------------------------------------- { ..., "hits": { "total": 1, "max\_score": 1.0, "hits": [ { "\_index": "test", "\_type": "\_doc", "\_id": "1", "\_score": 1.0, "\_source": { "number": 1, "my\_join\_field": "my\_parent" }, "inner\_hits": { "my\_child": { "hits": { "total": 1, "max\_score": 1.0, "hits": [ { "\_index": "test", "\_type": "\_doc", "\_id": "2", "\_score": 1.0, "\_routing": "1", "\_source": { "number": 1, "my\_join\_field": { "name": "my\_child", "parent": "1" } } } ] } } } } ] } } -------------------------------------------------- // TESTRESPONSE[s/"\_source": \.\.\./"\_source": $body.hits.hits.0.\_source/] // TESTRESPONSE[s/\.\.\./"timed\_out": false, "took": $body.took, "\_shards": $body.\_shards/]
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/inner-hits.asciidoc
6.2
elasticsearch-6-2
[ -0.03345222398638725, 0.006561518181115389, 0.08810529112815857, 0.09409983456134796, 0.004984868690371513, -0.006448585540056229, -0.0917569100856781, 0.028818318620324135, 0.08805127441883087, 0.020023398101329803, -0.039087582379579544, 0.03579384461045265, 0.026032406836748123, 0.044508036226034164, 0.03794446960091591, 0.1365770548582077, -0.04558389633893967, 0.0025378610007464886, -0.0024343510158360004, -0.06696021556854248, 0.05857788398861885, 0.011459301225841045, 0.011315077543258667, -0.023526012897491455, 0.006001413334161043, 0.06422623246908188, -0.08216284960508347, 0.0009585700463503599, 0.003708957228809595, 0.05851330608129501, 0.03520292416214943, -0.027902010828256607, -0.08403330296278, 0.04321961849927902, -0.021017983555793762, 0.06342761963605881, 0.06315919011831284, -0.029421642422676086, 0.08869744837284088, 0.04576064273715019, 0.06728152185678482, 0.027580613270401955, 0.010006205178797245, -0.12377876043319702, 0.04845429211854935, -0.09133406728506088, 0.017317865043878555, -0.017601098865270615, -0.05960343778133392, 0.021580621600151062, -0.0486222542822361, -0.04370792582631111, -0.033973947167396545, 0.022172315046191216, 0.04141602665185928, 0.08630911260843277, -0.014658236876130104, 0.04152816906571388, -0.02186482772231102, -0.015980690717697144, 0.033214036375284195, -0.0855296328663826, 0.020797817036509514, -0.042027562856674194, -0.0161491297185421, -0.01270466111600399, -0.08739917725324631, 0.011828562244772911, 0.010352843441069126, 0.042940497398376465, 0.08945703506469727, 0.01698070764541626, 0.08180766552686691, -0.07548581063747406, 0.06814062595367432, 0.006266495678573847, -0.05149078741669655, -0.009832208976149559, 0.07118440419435501, -0.0910143181681633, -0.05979425832629204, -0.056462112814188004, -0.03607282415032387, -0.007867432199418545, 0.06285549700260162, -0.028633996844291687, 0.05779570713639259, -0.06024160981178284, -0.013888699002563953, 0.014574757777154446, -0.08294759690761566, -0.15709993243217468, 0.04277333244681358, 0.06593041121959686, 0.00109823455568403, 0.01681393012404442, 0.01951001212000847, -0.03387846052646637, 0.060390129685401917, 0.009182804264128208, 0.010946523398160934, 0.012665320187807083, 0.013939734548330307, -0.06977403163909912, 0.054197631776332855, 0.03373472020030022, -0.04715749993920326, -0.004791661631315947, -0.1137448325753212, 0.04033819958567619, -0.06769818067550659, 0.07583649456501007, -0.03129495307803154, 0.040926914662122726, -0.08737009018659592, -0.013350659050047398, -0.04531915485858917, -0.05967335402965546, 0.039793744683265686, 0.1196620762348175, 0.16214652359485626, -0.04556052386760712, -0.0015065111219882965, -0.006046902853995562, 0.06327848881483078, -0.026089783757925034, -0.016873158514499664, -1.3590896706894357e-33, 0.04971674457192421, -0.016890324652194977, 0.015412339940667152, 0.03714004531502724, 0.028816385194659233, 0.057735562324523926, 0.03657882288098335, 0.017932161688804626, -0.06417162716388702, -0.01686849631369114, 0.005819676909595728, 0.05523950234055519, -0.05140972509980202, -0.050762373954057693, -0.008017286658287048, -0.006235980428755283, 0.01243238989263773, -0.01018314715474844, -0.05190681666135788, -0.01354648731648922, -0.006849636323750019, 0.05787027254700661, -0.08006074279546738, -0.04526003822684288, 0.020012592896819115, -0.051997460424900055, -0.04066780209541321, -0.01740693673491478, -0.11149678379297256, 0.0020174174569547176, -0.012516943737864494, -0.0025699972175061703, 0.0072180223651230335, 0.03610359504818916, -0.038965512067079544, 0.043151676654815674, 0.015786761417984962, -0.042015835642814636, -0.10431608557701111, -0.0203036330640316, 0.08186930418014526, -0.02543730102479458, -0.0281363595277071, -0.05944211781024933, -0.07928454875946045, -0.008726613596081734, -0.03133340924978256, 0.04254961013793945, 0.010073990561068058, 0.02328362502157688, -0.026794616132974625, 0.047268107533454895, 0.027642060071229935, -0.03488979488611221, 0.053957514464855194, -0.04209752380847931, -0.054785314947366714, 0.02995108813047409, 0.010221924632787704, -0.05670078098773956, 0.005989986937493086, 0.015037138015031815, 0.028744490817189217, -0.0012064774055033922, -0.011906435713171959, -0.007037802133709192, 0.023578714579343796, 0.05923529714345932, 0.015867872163653374, 0.020302753895521164, 0.026402084156870842, 0.13478566706180573, -0.10415931791067123, -0.029034707695245743, -0.03148876130580902, -0.05750013887882233, -0.06586381793022156, -0.032858673483133316, 0.012866477482020855, -0.009550008922815323, -0.05853797122836113, -0.0644468367099762, -0.09062689542770386, 0.05960734561085701, -0.012351919896900654, 0.05264470353722572, -0.02118249237537384, -0.00442493474110961, -0.0651557669043541, -0.07758134603500366, -0.015793338418006897, -0.007634640205651522, -0.022544007748365402, -0.10601114481687546, 0.032661765813827515, -2.560467764268357e-34, 0.04225005954504013, -0.0904257595539093, 0.011870617046952248, 0.058190133422613144, 0.014635693281888962, -0.060137808322906494, 0.06621254235506058, 0.037290871143341064, 0.01247579324990511, 0.06590544432401657, -0.06851157546043396, -0.0320257842540741, 0.0645415186882019, -0.004009835887700319, 0.035278499126434326, 0.012915387749671936, -0.09530419111251831, -0.05147448182106018, 0.10166667401790619, -0.02305637113749981, 0.03463798016309738, 0.08673274517059326, 0.009779034182429314, 0.11655936390161514, -0.05126933008432388, -0.052462320774793625, -0.04635605588555336, -0.028607862070202827, -0.04731256887316704, 0.03176264837384224, 0.03319550305604935, -0.009499559178948402, -0.0384535938501358, 0.03550514578819275, 0.0051004826091229916, 0.012421396560966969, 0.010842278599739075, -0.02216249890625477, 0.0037304579745978117, 0.03317391499876976, 0.00597700709477067, 0.026145344600081444, -0.003886735998094082, 0.014797260984778404, 0.021150866523385048, 0.0576394647359848, 0.09838730841875076, 0.08572865277528763, -0.02220229059457779, -0.010851841419935226, 0.03200399503111839, -0.022217517718672752, -0.03275541961193085, 0.06984557956457138, -0.03604859858751297, -0.04019714891910553, -0.09164588898420334, -0.09676654636859894, 0.0005832055467180908, 0.006713188719004393, 0.022457672283053398, -0.016957229003310204, -0.050266072154045105, 0.0507301427423954, -0.013241124339401722, -0.10472165793180466, -0.0945613831281662, -0.049140725284814835, 0.004569872282445431, -0.002908406313508749, -0.035236358642578125, -0.03074885718524456, 0.04888855293393135, 0.043813832104206085, 0.12772545218467712, -0.011631344445049763, 0.04025828093290329, -0.019518138840794563, 0.03667445480823517, -0.06980013102293015, -0.03342991694808006, -0.025973808020353317, -0.014894329942762852, 0.08277986198663712, 0.05977249890565872, -0.036198318004608154, 0.00739010376855731, 0.07081221789121628, -0.04892725870013237, 0.018775416538119316, 0.029778219759464264, -0.008128789253532887, -0.047730833292007446, -0.028476905077695847, -0.012645426206290722, -5.435299854639197e-8, -0.12694883346557617, 0.005294635891914368, -0.03890347108244896, 0.03429180756211281, -0.05377636477351189, -0.021767508238554, 0.12136277556419373, 0.07215654850006104, 0.021394997835159302, 0.008862992748618126, 0.031765636056661606, 0.05152686685323715, -0.009084978140890598, -0.0727149173617363, -0.0035121296532452106, -0.05092855170369148, 0.010410171933472157, 0.04518769308924675, -0.026300707831978798, 0.06824404001235962, 0.031387824565172195, -0.013813991099596024, -0.015812186524271965, 0.054730381816625595, 0.09830829501152039, 0.004828179255127907, 0.0053973631002008915, -0.029954267665743828, -0.02007591724395752, -0.05023585259914398, -0.02885744534432888, 0.029485860839486122, 0.0016675745137035847, 0.08621008694171906, -0.05198882147669792, 0.010155406780540943, 0.10419066995382309, 0.0639718696475029, -0.0020797981414943933, 0.07957287132740021, 0.043365079909563065, -0.026618311181664467, -0.07141638547182083, 0.0037826078478246927, -0.02628905139863491, 0.02878911793231964, -0.03595968708395958, 0.06951209902763367, 0.04658220335841179, -0.055269259959459305, -0.04076925665140152, -0.03034787066280842, -0.028259459882974625, -0.05909297615289688, -0.031963638961315155, 0.03409741446375847, 0.07033343613147736, 0.055875543504953384, -0.0022457630839198828, -0.0028709126636385918, 0.08610258251428604, 0.03127749264240265, 0.03544000908732414, -0.004254218656569719 ]
0.006066
[[search-request-scroll]] === Scroll While a `search` request returns a single ``page'' of results, the `scroll` API can be used to retrieve large numbers of results (or even all results) from a single search request, in much the same way as you would use a cursor on a traditional database. Scrolling is not intended for real time user requests, but rather for processing large amounts of data, e.g. in order to reindex the contents of one index into a new index with a different configuration. .Client support for scrolling and reindexing \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Some of the officially supported clients provide helpers to assist with scrolled searches and reindexing of documents from one index to another: Perl:: See https://metacpan.org/pod/Search::Elasticsearch::Client::5\_0::Bulk[Search::Elasticsearch::Client::5\_0::Bulk] and https://metacpan.org/pod/Search::Elasticsearch::Client::5\_0::Scroll[Search::Elasticsearch::Client::5\_0::Scroll] Python:: See http://elasticsearch-py.readthedocs.org/en/master/helpers.html[elasticsearch.helpers.\*] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* NOTE: The results that are returned from a scroll request reflect the state of the index at the time that the initial `search` request was made, like a snapshot in time. Subsequent changes to documents (index, update or delete) will only affect later search requests. In order to use scrolling, the initial search request should specify the `scroll` parameter in the query string, which tells Elasticsearch how long it should keep the ``search context'' alive (see <>), eg `?scroll=1m`. [source,js] -------------------------------------------------- POST /twitter/\_search?scroll=1m { "size": 100, "query": { "match" : { "title" : "elasticsearch" } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] The result from the above request includes a `\_scroll\_id`, which should be passed to the `scroll` API in order to retrieve the next batch of results. [source,js] -------------------------------------------------- POST /\_search/scroll <1> { "scroll" : "1m", <2> "scroll\_id" : "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==" <3> } -------------------------------------------------- // CONSOLE // TEST[continued s/DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==/$body.\_scroll\_id/] <1> `GET` or `POST` can be used and the URL should not include the `index` or `type` name -- this is specified in the original `search` request instead. <2> The `scroll` parameter tells Elasticsearch to keep the search context open for another `1m`. <3> The `scroll\_id` parameter The `size` parameter allows you to configure the maximum number of hits to be returned with each batch of results. Each call to the `scroll` API returns the next batch of results until there are no more results left to return, ie the `hits` array is empty. IMPORTANT: The initial search request and each subsequent scroll request each return a `\_scroll\_id`, which may change with each request -- only the most recent `\_scroll\_id` should be used. NOTE: If the request specifies aggregations, only the initial search response will contain the aggregations results. NOTE: Scroll requests have optimizations that make them faster when the sort order is `\_doc`. If you want to iterate over all documents regardless of the order, this is the most efficient option: [source,js] -------------------------------------------------- GET /\_search?scroll=1m { "sort": [ "\_doc" ] } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] [[scroll-search-context]] ==== Keeping the search context alive The `scroll` parameter (passed to the `search` request and to every `scroll` request) tells Elasticsearch how long it should keep the search context alive. Its value (e.g. `1m`, see <>) does not need to be long enough to process all data -- it just needs to be long enough to process the previous batch of results. Each `scroll` request (with the `scroll` parameter) sets a new expiry time. Normally, the background merge process optimizes the index by merging together smaller segments to create new bigger segments, at which time the smaller segments are deleted. This process continues during scrolling, but an open search context prevents the old segments from being deleted while they are still in use. This is how Elasticsearch is able to return the results of the initial search request, regardless of subsequent
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/scroll.asciidoc
6.2
elasticsearch-6-2
[ -0.07813703268766403, 0.05155516788363457, -0.049810368567705154, 0.04376072436571121, -0.04094589501619339, -0.008475277572870255, -0.0014163358137011528, 0.003044800367206335, -0.007993847131729126, 0.007349343039095402, -0.03303280100226402, 0.06876642256975174, 0.10265547782182693, -0.07455304265022278, -0.10139699280261993, -0.020402295514941216, -0.05510682240128517, 0.05940426513552666, -0.06589361280202866, -0.02052241936326027, 0.022639943286776543, 0.04121154919266701, 0.010015904903411865, 0.0030846840236335993, -0.13004687428474426, 0.022725163027644157, -0.0870654508471489, -0.10808523744344711, 0.0036988069768995047, 0.004429179709404707, 0.018759960308670998, 0.07338448613882065, -0.05648736283183098, 0.10277304798364639, -0.0645616427063942, -0.032157327979803085, -0.07675222307443619, -0.043198440223932266, -0.011288365349173546, -0.047043610364198685, 0.053517114371061325, 0.029052868485450745, -0.06074216589331627, 0.04474876448512077, 0.06828223913908005, -0.03704068064689636, -0.036240436136722565, -0.0007367445505224168, 0.028656281530857086, 0.050362616777420044, -0.085872583091259, 0.02494390867650509, 0.06598731875419617, 0.055216480046510696, 0.01842387020587921, -0.00142365088686347, 0.027033479884266853, -0.005753905046731234, -0.023524632677435875, 0.08396925032138824, 0.035046402364969254, -0.04052978754043579, -0.006612802390009165, -0.029438763856887817, -0.03135189414024353, -0.03366142138838768, 0.033271390944719315, -0.02133694849908352, 0.05364953726530075, -0.00925923977047205, -0.035798292607069016, 0.014802711084485054, -0.0584929883480072, 0.04290294647216797, 0.03355886787176132, -0.04881429672241211, -0.06705888360738754, -0.07918954640626907, -0.015031995251774788, 0.027213748544454575, -0.010753418318927288, -0.07499683648347855, 0.0038357884623110294, 0.05992830544710159, 0.017575010657310486, -0.03955002874135971, -0.008129172027111053, -0.023828139528632164, 0.025529436767101288, -0.05651506781578064, 0.017054369673132896, -0.04293561354279518, -0.03998802974820137, -0.04378229007124901, -0.059405505657196045, 0.07576717436313629, 0.03946686163544655, 0.00689687579870224, 0.002861140063032508, -0.023765088990330696, 0.0171030443161726, 0.03809063509106636, 0.0071614524349570274, -0.0032569977920502424, -0.0700618103146553, -0.003953802864998579, 0.044727642089128494, 0.0022831629030406475, -0.04612116515636444, -0.00699576223269105, -0.002804094459861517, -0.00609506294131279, -0.0010748564964160323, -0.061123546212911606, -0.035636499524116516, 0.010469590313732624, -0.02765796147286892, -0.0292463768273592, 0.04989541694521904, 0.08712911605834961, 0.071834035217762, 0.0644170269370079, -0.08295264840126038, -0.02726092003285885, 0.07945093512535095, -0.00458473339676857, -0.01756814494729042, 3.18468088665842e-33, 0.02053096517920494, -0.014362585730850697, -0.00036202973569743335, -0.01583845354616642, -0.01361020840704441, 0.05140569806098938, 0.05850785970687866, 0.022159568965435028, -0.045683447271585464, -0.012627143412828445, 0.0011371024884283543, 0.0429404154419899, 0.00759679451584816, 0.004170877393335104, -0.0017603096785023808, -0.06580141186714172, 0.06164941191673279, 0.026972241699695587, 0.0036583596374839544, 0.026614833623170853, 0.01339392364025116, -0.009933194145560265, 0.04242659732699394, -0.04860562086105347, 0.029215803369879723, 0.01623447798192501, -0.08555927872657776, -0.0022703499998897314, 0.01752886176109314, 0.021145520731806755, -0.004612563643604517, 0.08888710290193558, -0.062436994165182114, -0.041387710720300674, -0.006243422161787748, 0.012990763410925865, -0.03407992422580719, 0.0408274307847023, -0.017353901639580727, 0.016100969165563583, -0.07397767156362534, 0.03240439295768738, 0.006639272440224886, -0.050053637474775314, -0.10733449459075928, -0.052670154720544815, -0.10524413734674454, 0.07623428851366043, 0.009625843726098537, 0.028082318603992462, 0.0032600034028291702, 0.13217195868492126, -0.0427798368036747, -0.006549298297613859, 0.12436013668775558, -0.028825098648667336, 0.0513213649392128, 0.0887913778424263, 0.012654140591621399, 0.07247768342494965, -0.0024256117176264524, -0.07927926629781723, -0.014372357167303562, 0.018951518461108208, 0.054394736886024475, -0.027974506840109825, 0.03578236699104309, 0.12190787494182587, -0.025833914056420326, 0.027884524315595627, 0.027595991268754005, 0.05394721031188965, 0.10403613746166229, -0.027061745524406433, 0.003968136850744486, -0.03888009488582611, -0.026730353012681007, 0.03704550862312317, 0.01725390926003456, -0.053192369639873505, 0.051512930542230606, -0.06207549199461937, -0.03536728024482727, -0.019001903012394905, 0.034000810235738754, 0.03263908252120018, -0.04847025126218796, -0.012491223402321339, -0.04444437474012375, -0.06320380419492722, -0.005994722247123718, 0.03310325741767883, 0.025398094207048416, -0.14456437528133392, -0.09943076223134995, -3.9851164997775786e-33, 0.01721491850912571, -0.019464697688817978, -0.021898696199059486, 0.055302731692790985, 0.012829615734517574, 0.017388781532645226, 0.0022605268750339746, 0.00904913805425167, -0.0486091785132885, -0.03531810641288757, -0.020269835367798805, 0.03089539334177971, -0.0002068799949483946, 0.004770676605403423, -0.029124092310667038, 0.11905238777399063, 0.04142288118600845, -0.02947901375591755, -0.018733695149421692, 0.0015531652607023716, -0.007717106956988573, -0.05868617817759514, -0.04504884034395218, 0.057307057082653046, -0.057085420936346054, -0.09334877133369446, 0.05115291103720665, 0.015365674160420895, -0.019322235137224197, 0.01232588104903698, 0.03532088175415993, -0.06109105795621872, -0.052343569695949554, -0.011845315806567669, -0.00354312383569777, -0.006809637416154146, -0.0027195231523364782, 0.03599704056978226, 0.013661224395036697, 0.0882824957370758, 0.08991537243127823, -0.02271846868097782, 0.08166561275720596, -0.04362288489937782, 0.035430602729320526, -0.03828864544630051, -0.17804305255413055, 0.09495368599891663, 0.044000543653964996, -0.05339455604553223, -0.017244523391127586, 0.04255302622914314, -0.034921322017908096, -0.07604916393756866, 0.029223166406154633, -0.03985898941755295, -0.04149438440799713, 0.0013522763038054109, -0.05954079329967499, -0.07969779521226883, -0.0346505343914032, 0.01677939109504223, -0.05982745438814163, 0.06918584555387497, 0.014882490038871765, -0.010432381182909012, -0.03938208147883415, -0.10660316050052643, -0.13337600231170654, 0.03698374330997467, -0.03595408424735069, -0.05420110374689102, 0.0217885822057724, 0.049644190818071365, 0.058940425515174866, 0.06167670339345932, 0.05866153538227081, 0.008079181425273418, 0.09806866943836212, 0.08889081329107285, 0.01680993288755417, 0.03678680211305618, 0.07463757693767548, -0.03980526700615883, -0.02819747105240822, 0.04910564050078392, -0.1427348405122757, 0.029309352859854698, 0.0037765786983072758, -0.005834931507706642, 0.03129865974187851, -0.021731525659561157, -0.057043567299842834, 0.006011635065078735, 0.11479200422763824, -5.3802768462674067e-8, -0.023396339267492294, -0.044248126447200775, -0.02444043569266796, 0.03998427093029022, 0.024071406573057175, 0.08219173550605774, 0.04210217669606209, 0.13595233857631683, -0.07050563395023346, -0.0559338741004467, 0.08323904126882553, 0.010170984081923962, 0.01865948736667633, 0.036502204835414886, 0.03857436776161194, 0.04027644172310829, 0.0757194310426712, -0.09755878895521164, -0.0065214745700359344, -0.056034304201602936, -0.017406318336725235, 0.07210441678762436, 0.046369768679142, 0.00213823770172894, -0.00016268408217001706, 0.019284112378954887, -0.06650808453559875, 0.05927068367600441, -0.06578876823186874, -0.10724873840808868, 0.02156681939959526, -0.03291334584355354, -0.04159026965498924, -0.016175804659724236, 0.06911023706197739, -0.06506503373384476, -0.011963199824094772, -0.008021906018257141, -0.09610282629728317, 0.054228525608778, 0.05194256827235222, 0.04881975054740906, 0.03298204392194748, 0.03518323600292206, 0.02051607146859169, -0.017152316868305206, 0.021809548139572144, -0.04150836914777756, 0.057605039328336716, -0.02935258112847805, 0.02786278910934925, -0.09705426543951035, 0.05340059846639633, 0.03832969442009926, -0.019689587876200676, 0.028499610722064972, -0.015179190784692764, -0.019183795899152756, 0.006761813536286354, 0.08575727790594101, 0.01584562659263611, 0.024303194135427475, 0.0022297357209026814, 0.08353279531002045 ]
0.062314
segments, at which time the smaller segments are deleted. This process continues during scrolling, but an open search context prevents the old segments from being deleted while they are still in use. This is how Elasticsearch is able to return the results of the initial search request, regardless of subsequent changes to documents. TIP: Keeping older segments alive means that more file handles are needed. Ensure that you have configured your nodes to have ample free file handles. See <>. You can check how many search contexts are open with the <>: [source,js] --------------------------------------- GET /\_nodes/stats/indices/search --------------------------------------- // CONSOLE ==== Clear scroll API Search context are automatically removed when the `scroll` timeout has been exceeded. However keeping scrolls open has a cost, as discussed in the <> so scrolls should be explicitly cleared as soon as the scroll is not being used anymore using the `clear-scroll` API: [source,js] --------------------------------------- DELETE /\_search/scroll { "scroll\_id" : "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==" } --------------------------------------- // CONSOLE // TEST[catch:missing] Multiple scroll IDs can be passed as array: [source,js] --------------------------------------- DELETE /\_search/scroll { "scroll\_id" : [ "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==", "DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAABFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAAAxZrUllkUVlCa1NqNmRMaUhiQlZkMWFBAAAAAAAAAAIWa1JZZFFZQmtTajZkTGlIYkJWZDFhQQAAAAAAAAAFFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAABBZrUllkUVlCa1NqNmRMaUhiQlZkMWFB" ] } --------------------------------------- // CONSOLE // TEST[catch:missing] All search contexts can be cleared with the `\_all` parameter: [source,js] --------------------------------------- DELETE /\_search/scroll/\_all --------------------------------------- // CONSOLE The `scroll\_id` can also be passed as a query string parameter or in the request body. Multiple scroll IDs can be passed as comma separated values: [source,js] --------------------------------------- DELETE /\_search/scroll/DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==,DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAABFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAAAxZrUllkUVlCa1NqNmRMaUhiQlZkMWFBAAAAAAAAAAIWa1JZZFFZQmtTajZkTGlIYkJWZDFhQQAAAAAAAAAFFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAABBZrUllkUVlCa1NqNmRMaUhiQlZkMWFB --------------------------------------- // CONSOLE // TEST[catch:missing] [[sliced-scroll]] ==== Sliced Scroll For scroll queries that return a lot of documents it is possible to split the scroll in multiple slices which can be consumed independently: [source,js] -------------------------------------------------- GET /twitter/\_search?scroll=1m { "slice": { "id": 0, <1> "max": 2 <2> }, "query": { "match" : { "title" : "elasticsearch" } } } GET /twitter/\_search?scroll=1m { "slice": { "id": 1, "max": 2 }, "query": { "match" : { "title" : "elasticsearch" } } } -------------------------------------------------- // CONSOLE // TEST[setup:big\_twitter] <1> The id of the slice <2> The maximum number of slices The result from the first request returned documents that belong to the first slice (id: 0) and the result from the second request returned documents that belong to the second slice. Since the maximum number of slices is set to 2 the union of the results of the two requests is equivalent to the results of a scroll query without slicing. By default the splitting is done on the shards first and then locally on each shard using the \_uid field with the following formula: `slice(doc) = floorMod(hashCode(doc.\_uid), max)` For instance if the number of shards is equal to 2 and the user requested 4 slices then the slices 0 and 2 are assigned to the first shard and the slices 1 and 3 are assigned to the second shard. Each scroll is independent and can be processed in parallel like any scroll request. NOTE: If the number of slices is bigger than the number of shards the slice filter is very slow on the first calls, it has a complexity of O(N) and a memory cost equals to N bits per slice where N is the total number of documents in the shard. After few calls the filter should be cached and subsequent calls should be faster but you should limit the number of sliced query you perform in parallel to avoid the memory explosion. To avoid this cost entirely it is possible to use the `doc\_values` of another field to do the slicing but the user must ensure that the field has the following properties: \* The field is numeric. \* `doc\_values` are enabled on that field \* Every
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/scroll.asciidoc
6.2
elasticsearch-6-2
[ -0.02516254223883152, 0.08998695015907288, 0.02882780320942402, 0.07654023915529251, 0.10737034678459167, -0.017775295302271843, -0.07600781321525574, -0.030409183353185654, 0.13300848007202148, 0.026185300201177597, -0.047809869050979614, 0.11212863028049469, -0.007400999311357737, -0.08707614243030548, -0.062213167548179626, -0.027545619755983353, -0.14493262767791748, -0.015895627439022064, -0.07794968038797379, -0.01599588803946972, 0.07723085582256317, 0.07357010245323181, 0.011048122309148312, -0.014553242363035679, -0.07760296016931534, 0.016201747581362724, -0.09920157492160797, -0.11856123805046082, 0.047732505947351456, 0.019030539318919182, 0.0002570247743278742, 0.05427680164575577, 0.011097005568444729, 0.05401955544948578, -0.03251571208238602, 0.010928839445114136, -0.05727050453424454, -0.05507433041930199, -0.02073180489242077, 0.05686028301715851, 0.0423617921769619, 0.07424478977918625, -0.0885278657078743, -0.050907038152217865, -0.015063157305121422, -0.04670805111527443, -0.008167472667992115, -0.06294512003660202, -0.042030271142721176, 0.0754178911447525, -0.05566699057817459, -0.03106066770851612, -0.009094156324863434, 0.008841587230563164, 0.016294876113533974, 0.03600071370601654, -0.02451261691749096, 0.018590383231639862, -0.03789781033992767, 0.0370999313890934, 0.0892709493637085, -0.06061166524887085, -0.033042311668395996, -0.04202845320105553, -0.02548280917108059, 0.0073448107577860355, 0.09053994715213776, -0.05628743767738342, 0.04634632170200348, 0.051008522510528564, 0.028415599837899208, 0.012742474675178528, -0.05534693971276283, 0.024217981845140457, 0.07315242290496826, 0.006135950330644846, 0.039831165224313736, -0.04141996055841446, 0.02315697632730007, 0.004000475630164146, -0.04434730112552643, -0.15886560082435608, -0.04714159667491913, 0.01759716309607029, -0.06730452179908752, -0.029914164915680885, 0.021827656775712967, -0.1278523951768875, 0.04162033274769783, -0.051681388169527054, -0.004946078173816204, -0.057508133351802826, -0.04585341364145279, -0.02157241478562355, 0.013362857513129711, 0.028835488483309746, -0.02085176855325699, 0.09600099921226501, 0.05596628412604332, -0.017505541443824768, 0.012837880291044712, -0.007392238359898329, 0.02423940785229206, 0.06858617067337036, -0.047124601900577545, -0.021807651966810226, -0.015305990353226662, 0.06426899135112762, -0.045576345175504684, 0.07383252680301666, 0.06292074173688889, -0.004407266620546579, 0.02496025525033474, 0.04060998558998108, -0.07548722624778748, 0.07852435111999512, -0.0007923704106360674, -0.021838756278157234, -0.027415839955210686, 0.18314388394355774, 0.09189654141664505, 0.05588041990995407, -0.01255018450319767, -0.020897433161735535, -0.0265131127089262, 0.03692413121461868, 0.005554341711103916, 1.5102540197723587e-34, -0.002179785631597042, -0.08321814239025116, -0.05994372069835663, -0.02321840450167656, 0.015656495466828346, 0.03823575749993324, 0.040387772023677826, 0.04623488336801529, -0.08662915974855423, -0.013701730407774448, -0.040059272199869156, 0.05225497484207153, 0.006572092417627573, -0.016546081751585007, -0.011248452588915825, -0.06524937599897385, 0.08790335059165955, 0.004004159476608038, -0.025457842275500298, -0.032630033791065216, 0.015791449695825577, -0.04092251881957054, -0.0077270143665373325, -0.01795872300863266, -0.003512113820761442, -0.0035540228709578514, -0.02558291330933571, -0.054168492555618286, -0.08206164836883545, 0.006298274267464876, -0.05717572569847107, 0.08149776607751846, -0.003429185366258025, 0.006632608361542225, -0.024998735636472702, 0.037850070744752884, -0.015234792605042458, 0.06006341800093651, -0.015489818528294563, -0.014817793853580952, 0.005109868943691254, 0.06848596781492233, -0.003603642573580146, -0.040391817688941956, -0.07102227956056595, -0.12238940596580505, -0.011928465217351913, 0.08604037016630173, 0.0029846271499991417, 0.055072519928216934, -0.013881352730095387, 0.10636588931083679, 0.053336285054683685, -0.0370306521654129, 0.09215229004621506, 0.003059817710891366, 0.02437126263976097, 0.030900774523615837, -0.06241267919540405, 0.02884170599281788, 0.04011131450533867, -0.026549212634563446, 0.04870370775461197, 0.028614109382033348, 0.05634237080812454, 0.09603648632764816, 0.027468271553516388, 0.07540865987539291, -0.045532140880823135, -0.02435019612312317, 0.03810342773795128, 0.0181836299598217, 0.057114116847515106, 0.011210151948034763, 0.025428038090467453, -0.07451144605875015, -0.04096958786249161, 0.06151270493865013, -0.01669488660991192, -0.020228734239935875, 0.04514538124203682, -0.04939677566289902, -0.02074565552175045, 0.028414249420166016, -0.012348041869699955, -0.026430882513523102, -0.01775764301419258, -0.02718331851065159, -0.020376035943627357, -0.0034205554984509945, -0.014260608702898026, -0.0198570117354393, -0.017956919968128204, -0.05844513699412346, -0.005776976700872183, -2.9960884301033305e-33, 0.009773665107786655, 0.015581765212118626, -0.07924973964691162, 0.04243749380111694, 0.006461108103394508, 0.017470063641667366, 0.011824434623122215, 0.0823630839586258, -0.06014375388622284, -0.03661840409040451, 0.030537771061062813, 0.0016093424055725336, -0.045832183212041855, -0.02350660413503647, -0.08268676698207855, 0.0596781000494957, 0.04488065466284752, -0.08641669154167175, -0.022468887269496918, -0.029139941558241844, 0.053166694939136505, -0.08529007434844971, -0.053761765360832214, 0.06371405720710754, -0.04172391816973686, -0.07600429654121399, -0.004241058602929115, -0.0014194927643984556, -0.0927669033408165, -0.03994183614850044, -0.033214230090379715, -0.05832112208008766, -0.04003782570362091, -0.005999356508255005, 0.00018120682216249406, -0.0017528622411191463, -0.030918337404727936, 0.0458882711827755, 0.042562276124954224, 0.04483168572187424, 0.05946320295333862, 0.04112048074603081, 0.05507327616214752, -0.008228165097534657, 0.023671280592679977, -0.04293987527489662, -0.028661996126174927, 0.0890694409608841, -0.003317664610221982, -0.07847389578819275, -0.06828024238348007, 0.041580840945243835, -0.009266942739486694, -0.029206562787294388, -0.02078840509057045, 0.008412906900048256, -0.06912697851657867, 0.018545212224125862, -0.07788290828466415, -0.022466987371444702, 0.046024903655052185, 0.04275145009160042, -0.08241403847932816, 0.020092202350497246, 0.02104973793029785, -0.030837690457701683, -0.03158026933670044, -0.034162700176239014, -0.05278958007693291, 0.014379717409610748, -0.0206648837774992, 0.005074166227132082, 0.06612452864646912, 0.03444340080022812, 0.010315696708858013, 0.048294030129909515, -0.02138623036444187, -0.04394107311964035, 0.0692150816321373, 0.00298543949611485, 0.007332383655011654, 0.03853234648704529, -0.002136038616299629, -0.0008289541001431644, 0.00682746060192585, 0.09219380468130112, -0.10671687871217728, 0.056128088384866714, -0.009766785427927971, 0.10089489817619324, 0.011318234726786613, -0.10839971154928207, -0.11347658932209015, 0.010408183559775352, 0.008612818084657192, -4.973355061110851e-8, -0.009270088747143745, 0.027149291709065437, -0.07169599086046219, 0.05147668346762657, 0.05747802555561066, 0.028254996985197067, 0.047338224947452545, 0.17015410959720612, -0.04137670621275902, -0.05281778424978256, 0.062467437237501144, 0.025357859209179878, -0.07665445655584335, 0.010184505954384804, 0.007021186873316765, -0.051363710314035416, 0.05245274677872658, -0.04657882824540138, -0.026597244665026665, -0.0630340427160263, -0.09702541679143906, 0.007528338115662336, 0.035108551383018494, 0.06163553148508072, 0.04548664018511772, -0.025536514818668365, 0.027482720091938972, 0.051387690007686615, -0.0179978609085083, -0.0902835801243782, -0.060268498957157135, 0.0036485290620476007, -0.03907731920480728, 0.028972912579774857, -0.029139310121536255, -0.004473686683923006, -0.017373744398355484, 0.013385741971433163, -0.07666834443807602, 0.0929386094212532, 0.04025863856077194, 0.019194450229406357, -0.01476200856268406, 0.017170410603284836, -0.0041663628071546555, -0.006238206289708614, 0.01493928488343954, 0.04447191581130028, 0.023990264162421227, -0.049443986266851425, 0.02436213381588459, -0.07302335649728775, -0.022118140012025833, 0.08079791069030762, 0.012238597497344017, -0.07094275206327438, 0.02523348107933998, -0.0169341079890728, -0.00306914234533906, 0.05696089565753937, 0.002682705642655492, -0.027404185384511948, -0.01983954757452011, -0.006747763138264418 ]
0.068631
to avoid the memory explosion. To avoid this cost entirely it is possible to use the `doc\_values` of another field to do the slicing but the user must ensure that the field has the following properties: \* The field is numeric. \* `doc\_values` are enabled on that field \* Every document should contain a single value. If a document has multiple values for the specified field, the first value is used. \* The value for each document should be set once when the document is created and never updated. This ensures that each slice gets deterministic results. \* The cardinality of the field should be high. This ensures that each slice gets approximately the same amount of documents. [source,js] -------------------------------------------------- GET /twitter/\_search?scroll=1m { "slice": { "field": "date", "id": 0, "max": 10 }, "query": { "match" : { "title" : "elasticsearch" } } } -------------------------------------------------- // CONSOLE // TEST[setup:big\_twitter] For append only time-based indices, the `timestamp` field can be used safely. NOTE: By default the maximum number of slices allowed per scroll is limited to 1024. You can update the `index.max\_slices\_per\_scroll` index setting to bypass this limit.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/scroll.asciidoc
6.2
elasticsearch-6-2
[ -0.0827735885977745, 0.11239781230688095, 0.0032864147797226906, 0.0858025774359703, 0.017213022336363792, 0.015062971971929073, -0.01313014980405569, 0.04853704199194908, 0.13087162375450134, -0.0029899151995778084, -0.04613782837986946, 0.04357654228806496, -0.031091617420315742, -0.013438553549349308, 0.009747164323925972, 0.017606645822525024, -0.07079830765724182, 0.012530306354165077, -0.08208901435136795, -0.07386636734008789, 0.029340391978621483, 0.02133847586810589, -0.03137360140681267, 0.014717817306518555, 0.007616932969540358, 0.01710306853055954, -0.13215461373329163, -0.08267045021057129, 0.050921157002449036, 0.025759423151612282, 0.06427141278982162, 0.039302848279476166, 0.004478318616747856, 0.05250074714422226, -0.05874991416931152, -0.006667214445769787, -0.06844767928123474, 0.020562157034873962, 0.04905243590474129, 0.04791761562228203, 0.02721942588686943, -0.02569848671555519, -0.06753240525722504, 0.0031549278646707535, 0.027006732299923897, -0.06968177855014801, -0.0031243443954735994, -0.010942893102765083, -0.007951315492391586, 0.0753045305609703, -0.1052083745598793, 0.021302854642271996, -0.05041111260652542, 0.07830765098333359, 0.0732923150062561, 0.007202107924968004, -0.03348718211054802, 0.027141962200403214, -0.004202657844871283, 0.020777754485607147, -0.05311202257871628, -0.07939678430557251, 0.03810180351138115, -0.012365635484457016, 0.047351621091365814, -0.03893173113465309, -0.0032465674448758364, 0.036068130284547806, 0.00158876518253237, 0.054705481976270676, 0.0598410926759243, 0.05719437077641487, 0.05619186908006668, -0.011072248220443726, -0.0076032341457903385, 0.03858022764325142, -0.034171123057603836, -0.06552036851644516, -0.039924878627061844, 0.022242359817028046, -0.05035480856895447, -0.10129332542419434, -0.0401778444647789, 0.021168269217014313, 0.019451694563031197, -0.04793291911482811, 0.0112400958314538, -0.025491829961538315, 0.00863415002822876, -0.04704158008098602, -0.02213122509419918, -0.05178213492035866, 0.03615293651819229, 0.04311450570821762, -0.020644400268793106, 0.06623341888189316, 0.02686675265431404, -0.0724402666091919, 0.08369720727205276, 0.006053386256098747, 0.007502190303057432, 0.022128336131572723, 0.051099278032779694, 0.014493394643068314, 0.028141096234321594, -0.059580251574516296, -0.02018437348306179, -0.009190768003463745, -0.039956677705049515, -0.020720748230814934, 0.045933954417705536, 0.08647040277719498, -0.04937218502163887, -0.033104799687862396, -0.03399474546313286, 0.03207451105117798, 0.04751289635896683, -0.09250414371490479, 0.10441793501377106, 0.09102606773376465, 0.07816218584775925, 0.04578240588307381, -0.024218250066041946, 0.00502965459600091, 0.005733632482588291, 0.031227102503180504, 0.07182914763689041, -1.710492939155834e-34, 0.06904210150241852, -0.016073545441031456, -0.030792227014899254, -0.03854311630129814, -0.034000761806964874, 0.03695177286863327, 0.00581295695155859, 0.0524396114051342, -0.08919937908649445, -0.0245520006865263, -0.03360976651310921, 0.03266890347003937, 0.047090962529182434, -0.05564488098025322, -0.007513885386288166, -0.05572148784995079, -0.024493275210261345, 0.053971268236637115, -0.010166729800403118, 0.0054978565312922, 0.03445269912481308, -0.043644119054079056, -0.0186347346752882, 0.06640200316905975, 0.00879785604774952, 0.0029362731147557497, -0.04683314636349678, -0.059015337377786636, -0.10702656954526901, -0.0014382615918293595, -0.03367188200354576, 0.037676312029361725, -0.019470471888780594, -0.04153458774089813, 0.098622627556324, 0.10351687669754028, -0.012010203674435616, 0.03524240478873253, -0.013933898881077766, -0.060497745871543884, -0.011298074387013912, 0.05126382037997246, 0.06306078284978867, -0.1158975288271904, -0.09754442423582077, -0.02052377536892891, -0.049171362072229385, 0.0071818348951637745, -0.025391237810254097, -0.025429654866456985, 0.014356807805597782, 0.0988631322979927, -0.006453435402363539, -0.00936451368033886, 0.1249447911977768, -0.07606850564479828, 0.05332430824637413, 0.03561090677976608, 0.09020936489105225, 0.0033639760222285986, 0.004024583380669355, 0.006082061678171158, -0.013879219070076942, 0.04316895082592964, -0.03353220224380493, 0.047408174723386765, 0.04492534324526787, 0.08345124870538712, -0.016985584050416946, 0.054181139916181564, 0.04331474378705025, 0.06875107437372208, -0.05629219859838486, -0.09410995244979858, 0.020782917737960815, -0.040494050830602646, 0.018425019457936287, -0.04186498746275902, -0.01901322416961193, -0.024352718144655228, -0.05748545750975609, -0.010762495920062065, -0.00017587206093594432, -0.017457518726587296, -0.004793460015207529, 0.057846833020448685, -0.037732649594545364, 0.03121650218963623, -0.07269109040498734, -0.031623173505067825, 0.015657860785722733, 0.008256180211901665, -0.04889325797557831, -0.1421726644039154, -0.008420438505709171, -4.809560391150833e-34, 0.027639536187052727, -0.06969080865383148, -0.007907653227448463, 0.08031347393989563, 0.02563338726758957, -0.01192417275160551, -0.01077843178063631, 0.055963899940252304, -0.005324424710124731, 0.03903951868414879, -0.011128347367048264, -0.03237652778625488, -0.0436798594892025, -0.05208806321024895, 0.0142976064234972, 0.02002527192234993, -0.08001799881458282, -0.08240342885255814, 0.04282953590154648, -0.03846779838204384, -0.038084957748651505, 0.017998959869146347, -0.02742249146103859, 0.14330115914344788, -0.025497253984212875, -0.018885701894760132, 0.005841805599629879, -0.0173416156321764, -0.01705997623503208, -0.02175021544098854, -0.05035596713423729, -0.12368948012590408, -0.07843293994665146, 0.006099308375269175, -0.02961435168981552, 0.07711277902126312, 0.00024675577878952026, 0.09918894618749619, 0.06897030025720596, 0.07257408648729324, -0.0009590007830411196, -0.022605177015066147, -0.0415634922683239, 0.03209223970770836, -0.0576380118727684, -0.013512282632291317, 0.03564063459634781, 0.10949017107486725, 0.01355807762593031, -0.03906639292836189, 0.03314623236656189, 0.036405205726623535, -0.054999444633722305, 0.01609012857079506, -0.04834776371717453, -0.09286618232727051, -0.11022183299064636, -0.03459503874182701, -0.10394436866044998, -0.0217142254114151, -0.005279648117721081, 0.009806656278669834, -0.02924034744501114, -0.001651222351938486, 0.011424856260418892, -0.05633978173136711, -0.05706046149134636, -0.034790121018886566, -0.07249439507722855, 0.02048886939883232, 0.022666428238153458, -0.035784222185611725, 0.11973781883716583, 0.009812639094889164, -0.037736065685749054, -0.007209175266325474, 0.04565407335758209, -0.000581855361815542, 0.053871382027864456, 0.010296819731593132, 0.010638151317834854, 0.07230346649885178, 0.08040639758110046, 0.07123660296201706, -0.041849710047245026, 0.027392229065299034, -0.043980490416288376, 0.07447697967290878, 0.008902648463845253, -0.07049445807933807, -0.04568656161427498, -0.01075201015919447, -0.05608820915222168, 0.034633953124284744, 0.003868070198222995, -5.124218915852907e-8, -0.09023438394069672, 0.005070685409009457, -0.08425448089838028, 0.06949770450592041, -0.016429521143436432, 0.02577098272740841, 0.020365342497825623, 0.09293119609355927, 0.012610331177711487, -0.03597427159547806, 0.13005566596984863, 0.028950285166502, -0.05285479873418808, -0.015775572508573532, -0.01336047612130642, -0.015443696640431881, 0.01923157088458538, -0.034124139696359634, -0.024506572633981705, 0.02003842033445835, 0.03974008187651634, -0.032894913107156754, 0.011805939488112926, -0.035054437816143036, 0.06454789638519287, 0.03526897355914116, -0.0473727248609066, 0.06015021353960037, 0.10901571065187454, -0.06214195489883423, -0.010515345260500908, -0.010766505263745785, -0.038907431066036224, 0.10247822850942612, 0.05554980784654617, -0.014746156521141529, -0.02871660515666008, -0.005850363522768021, -0.053760480135679245, 0.039002008736133575, 0.03699908405542374, -0.00889541395008564, -0.07603700459003448, 0.045936234295368195, -0.053669288754463196, -0.0005030102911405265, -0.09011343866586685, 0.0027650059200823307, 0.06496618688106537, -0.01158619113266468, 0.018960794433951378, -0.09532219171524048, 0.05680393800139427, 0.06473122537136078, -0.024608539417386055, -0.038049954921007156, 0.09478151798248291, 0.01390119455754757, 0.0210101418197155, -0.033693328499794006, 0.03572460263967514, -0.08440817147493362, 0.005359109025448561, 0.07144331187009811 ]
0.067361
[[search-request-post-filter]] === Post filter The `post\_filter` is applied to the search `hits` at the very end of a search request, after aggregations have already been calculated. Its purpose is best explained by example: Imagine that you are selling shirts that have the following properties: [source,js] -------------------------------------------------- PUT /shirts { "mappings": { "\_doc": { "properties": { "brand": { "type": "keyword"}, "color": { "type": "keyword"}, "model": { "type": "keyword"} } } } } PUT /shirts/\_doc/1?refresh { "brand": "gucci", "color": "red", "model": "slim" } -------------------------------------------------- // CONSOLE // TESTSETUP Imagine a user has specified two filters: `color:red` and `brand:gucci`. You only want to show them red shirts made by Gucci in the search results. Normally you would do this with a <>: [source,js] -------------------------------------------------- GET /shirts/\_search { "query": { "bool": { "filter": [ { "term": { "color": "red" }}, { "term": { "brand": "gucci" }} ] } } } -------------------------------------------------- // CONSOLE However, you would also like to use \_faceted navigation\_ to display a list of other options that the user could click on. Perhaps you have a `model` field that would allow the user to limit their search results to red Gucci `t-shirts` or `dress-shirts`. This can be done with a <>: [source,js] -------------------------------------------------- GET /shirts/\_search { "query": { "bool": { "filter": [ { "term": { "color": "red" }}, { "term": { "brand": "gucci" }} ] } }, "aggs": { "models": { "terms": { "field": "model" } <1> } } } -------------------------------------------------- // CONSOLE <1> Returns the most popular models of red shirts by Gucci. But perhaps you would also like to tell the user how many Gucci shirts are available in \*other colors\*. If you just add a `terms` aggregation on the `color` field, you will only get back the color `red`, because your query returns only red shirts by Gucci. Instead, you want to include shirts of all colors during aggregation, then apply the `colors` filter only to the search results. This is the purpose of the `post\_filter`: [source,js] -------------------------------------------------- GET /shirts/\_search { "query": { "bool": { "filter": { "term": { "brand": "gucci" } <1> } } }, "aggs": { "colors": { "terms": { "field": "color" } <2> }, "color\_red": { "filter": { "term": { "color": "red" } <3> }, "aggs": { "models": { "terms": { "field": "model" } <3> } } } }, "post\_filter": { <4> "term": { "color": "red" } } } -------------------------------------------------- // CONSOLE <1> The main query now finds all shirts by Gucci, regardless of color. <2> The `colors` agg returns popular colors for shirts by Gucci. <3> The `color\_red` agg limits the `models` sub-aggregation to \*red\* Gucci shirts. <4> Finally, the `post\_filter` removes colors other than red from the search `hits`.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/post-filter.asciidoc
6.2
elasticsearch-6-2
[ -0.06654069572687149, 0.0691138356924057, 0.07408031821250916, 0.13093094527721405, -0.02730555087327957, 0.05638180300593376, -0.03234589099884033, 0.01496952772140503, 0.09195327758789062, -0.03681456670165062, -0.008684960193932056, -0.0007984419353306293, 0.04456455260515213, -0.0462958849966526, -0.04840502515435219, 0.04802893474698067, -0.02693912945687771, 0.032016683369874954, -0.07955775409936905, -0.07487300038337708, 0.06548772752285004, 0.02567814476788044, 0.005250514950603247, -0.046606142073869705, -0.008189713582396507, 0.009966145269572735, -0.07818882912397385, -0.07537730783224106, 0.028899220749735832, 0.03326498344540596, -0.03152357041835785, 0.007405162788927555, 0.02065526507794857, 0.09223120659589767, -0.05879891663789749, -0.01488153450191021, 0.008550455793738365, -0.10196565091609955, 0.0315222442150116, -0.0028115527238696814, 0.03025698848068714, 0.0034332473296672106, -0.06502717733383179, -0.0858137458562851, 0.018554970622062683, -0.02043355070054531, 0.025339428335428238, 0.024711456149816513, -0.008843714371323586, 0.013369851745665073, -0.038963980972766876, -0.016796620562672615, -0.06731364130973816, 0.008342104032635689, 0.052574273198843, 0.02563430182635784, -0.06719426065683365, -0.01752297580242157, 0.005057669710367918, -0.10882949829101562, 0.010666334070265293, -0.09723327308893204, -0.03364315629005432, 0.013581684790551662, 0.026252474635839462, -0.050733279436826706, -0.023970384150743484, 0.06219641491770744, 0.014161883853375912, 0.0620168074965477, 0.09049151837825775, 0.03474316745996475, 0.034830089658498764, -0.08397527039051056, 0.06779400259256363, 0.07111602276563644, -0.006966928020119667, -0.07609795778989792, 0.01325211115181446, 0.07480009645223618, -0.0850067213177681, -0.11494997888803482, -0.06273768842220306, 0.0016972546000033617, 0.030666861683130264, -0.047054752707481384, 0.016638394445180893, -0.12115347385406494, 0.05512235313653946, -0.08464480936527252, -0.07319363951683044, -0.028381768614053726, -0.013597222976386547, -0.0003168454859405756, 0.009899185039103031, -0.004465332254767418, -0.014370783232152462, -0.01437532901763916, 0.08704689145088196, 0.017106249928474426, 0.016435567289590836, -0.005462476052343845, 0.028887704014778137, -0.08567521721124649, -0.0203876830637455, -0.043532710522413254, -0.007264797575771809, 0.11582476645708084, -0.06300210952758789, 0.005882933735847473, -0.04089917242527008, 0.007795584853738546, 0.01229538768529892, 0.006318170577287674, -0.06413407623767853, 0.0894293561577797, 0.10645447671413422, 0.0018167924135923386, 0.0649140402674675, -0.031179415062069893, 0.09449392557144165, 0.06474984437227249, 0.013098436407744884, -0.0950695276260376, 0.014154450967907906, 0.02474069595336914, 0.02939075417816639, -2.3441289574235577e-33, 0.007433578837662935, -0.03880604729056358, -0.027734003961086273, -0.01752309873700142, -0.0032223600428551435, 0.03603921830654144, 0.05498469993472099, 0.04556623846292496, 0.006120180711150169, -0.0026033539324998856, -0.048996519297361374, 0.11456075310707092, -0.07387839257717133, -0.026361407712101936, 0.020912380889058113, -0.03630553558468819, 0.0012249830178916454, 0.005115411709994078, 0.0012124358909204602, -0.01665598340332508, 0.057766545563936234, 0.010116923600435257, -0.021380960941314697, 0.03439507260918617, -0.04544251784682274, -0.005160820670425892, -0.028455765917897224, -0.0059214322827756405, -0.14555539190769196, -0.00475297262892127, -0.02809150703251362, 0.0446622334420681, -0.037957094609737396, -0.033215589821338654, -0.052494779229164124, 0.04378833621740341, -0.0002495993103366345, 0.0020963922142982483, -0.010198741219937801, -0.04034440964460373, -0.008067495189607143, 0.024361029267311096, -0.006656533107161522, -0.14959704875946045, -0.1175493597984314, -0.01529077161103487, -0.0810130164027214, 0.03775378689169884, 0.02110406570136547, 0.03976090997457504, -0.017495591193437576, 0.012461564503610134, 0.01837572082877159, 0.058184850960969925, 0.009395429864525795, 0.013868355192244053, -0.014740901067852974, 0.07273395359516144, -0.0235479436814785, 0.0014738721074536443, 0.00415937602519989, -0.022932663559913635, 0.10278249531984329, 0.042986925691366196, 0.04660743474960327, 0.09096285700798035, 0.07385780662298203, 0.12137767672538757, 0.06863897293806076, 0.03169865161180496, 0.035385340452194214, 0.052919901907444, -0.0471876859664917, 0.01858527772128582, 0.06200222671031952, -0.12145201116800308, 0.018382344394922256, 0.006473960820585489, 0.01649785228073597, 0.06507062911987305, 0.016958344727754593, -0.06966689974069595, -0.0381949245929718, 0.04628093168139458, -0.037600528448820114, 0.10873310267925262, -0.02028275839984417, -0.02249756082892418, -0.07127869129180908, -0.07475817948579788, -0.013601453974843025, 0.02710961550474167, -0.03556879609823227, -0.07384878396987915, 0.006683879531919956, 4.16451796804168e-34, 0.03002825565636158, -0.07948003709316254, 0.04455988109111786, 0.07245168089866638, 0.05049440637230873, -0.05094875022768974, 0.04413231089711189, 0.01559366099536419, 0.04287126287817955, 0.04093677178025246, -0.009310114197432995, -0.06935480237007141, 0.0012415091041475534, -0.02762860432267189, -0.015040861442685127, 0.054609574377536774, -0.022998835891485214, -0.09603562206029892, 0.0061120870523154736, -0.01602337881922722, -0.06674175709486008, 0.0043318369425833225, 0.027123652398586273, 0.10521093010902405, -0.05694356560707092, -0.026451289653778076, -0.011711222119629383, -0.02881896123290062, -0.06269057095050812, 0.029763445258140564, 0.025655614212155342, -0.04458429664373398, -0.015295084565877914, 0.09111768007278442, -0.0023181536234915257, -0.021232880651950836, 0.027551956474781036, 0.035663098096847534, 0.014346044510602951, 0.09439222514629364, 0.011061654426157475, -0.000745701661799103, -0.007447514683008194, 0.044909872114658356, 0.04798779636621475, -0.011903610080480576, 0.054818712174892426, 0.03580844774842262, -0.012527847662568092, -0.06773968040943146, 0.03180123493075371, 0.06423402577638626, -0.058980923146009445, 0.08255691826343536, -0.0702204704284668, -0.05461661517620087, 0.014539296738803387, -0.05629326030611992, -0.035637471824884415, 0.026356004178524017, -0.018965065479278564, -0.004670560825616121, -0.06994153559207916, 0.004595544189214706, -0.007974686101078987, -0.06155668944120407, -0.01642501913011074, -0.08605575561523438, 0.007430697791278362, -0.04214515909552574, -0.013307677581906319, -0.009169992990791798, 0.1051582545042038, 0.039216298609972, -0.03202924504876137, -0.049811091274023056, 0.004612511023879051, -0.03609038144350052, 0.04554798826575279, -0.026053262874484062, -0.09012246131896973, -0.01460755430161953, 0.04666149243712425, 0.11645103991031647, -0.03527176380157471, 0.00256411568261683, -0.05202915892004967, 0.08418183028697968, -0.0420587882399559, -0.015902625396847725, -0.027055174112319946, -0.0755489245057106, -0.053582239896059036, 0.015765661373734474, -0.05073915049433708, -5.047703410809845e-8, -0.07886820286512375, 0.04557937756180763, 0.009745679795742035, 0.1032719835639, -0.06275308132171631, 0.07297808676958084, 0.08346285670995712, 0.07507207989692688, -0.05525616928935051, -0.07253338396549225, 0.056831974536180496, 0.08488393574953079, -0.029309013858437538, 0.02489675208926201, -0.0886978730559349, -0.046300992369651794, -0.03364995867013931, 0.01381093729287386, -0.032037172466516495, -0.03239447996020317, 0.02914121188223362, -0.0005267569213174284, 0.0501776859164238, 0.0034019583836197853, 0.09549713879823685, 0.03555898740887642, -0.0052518704906105995, 0.056413859128952026, 0.039873745292425156, -0.029956629499793053, 0.007314614020287991, 0.006588080432265997, -0.01017556432634592, 0.07293438911437988, 0.03345765918493271, -0.006218920927494764, 0.020006515085697174, 0.025768429040908813, -0.09132867306470871, 0.0682934820652008, 0.015368746593594551, 0.03875512629747391, -0.018439428880810738, 0.048404667526483536, 0.021461255848407745, -0.012883645482361317, -0.02293875627219677, -0.012316248379647732, 0.08673775941133499, -0.0007273112423717976, 0.07068390399217606, -0.05000925064086914, -0.03397887200117111, -0.02324799634516239, -0.05810018256306648, -0.05915701016783714, 0.02604423649609089, 0.017039049416780472, 0.019729482010006905, 0.019437970593571663, 0.07905711978673935, -0.048324763774871826, -0.030393317341804504, 0.010141388513147831 ]
0.032966
[[search-request-named-queries-and-filters]] === Named Queries Each filter and query can accept a `\_name` in its top level definition. [source,js] -------------------------------------------------- GET /\_search { "query": { "bool" : { "should" : [ {"match" : { "name.first" : {"query" : "shay", "\_name" : "first"} }}, {"match" : { "name.last" : {"query" : "banon", "\_name" : "last"} }} ], "filter" : { "terms" : { "name.last" : ["banon", "kimchy"], "\_name" : "test" } } } } } -------------------------------------------------- // CONSOLE The search response will include for each hit the `matched\_queries` it matched on. The tagging of queries and filters only make sense for the `bool` query.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/named-queries-and-filters.asciidoc
6.2
elasticsearch-6-2
[ -0.07292778044939041, 0.09555531293153763, 0.04574645310640335, 0.0093343835324049, -0.01188899576663971, 0.00645225727930665, 0.01681610941886902, -0.02435792237520218, 0.044869277626276016, -0.051832087337970734, -0.03993009775876999, -0.0805206447839737, -0.011792288161814213, 0.019009331241250038, 0.016781827434897423, 0.08065205067396164, -0.06610856205224991, 0.056315213441848755, -0.02204844355583191, -0.09046388417482376, 0.07850710302591324, 0.05985713377594948, 0.005297726485878229, -0.08444874733686447, 0.00016062699432950467, 0.024890927597880363, -0.05899682268500328, -0.04906481131911278, 0.008650554344058037, 0.05285922810435295, 0.006949695758521557, -0.04812375456094742, 0.035530298948287964, 0.11938808858394623, -0.03484455123543739, -0.061272066086530685, -0.059070706367492676, -0.05074522644281387, 0.02998323179781437, -0.0264954324811697, 0.05308862403035164, 0.06362279504537582, -0.04603002965450287, -0.11603184789419174, -0.01943170465528965, -0.055357784032821655, -0.013879669830203056, -0.009036028757691383, -0.010857473127543926, -0.007532312069088221, -0.08364348858594894, -0.1081002727150917, -0.03045257367193699, 0.023359183222055435, 0.07092811167240143, -0.009002851322293282, -0.08749494701623917, -0.02530732750892639, -0.012349148280918598, -0.06421292573213577, 0.0282584261149168, -0.1272164285182953, -0.03627137467265129, 0.02552982047200203, -0.030233699828386307, -0.05314343050122261, -0.007698883302509785, 0.01028407458215952, 0.09441804885864258, 0.016339706256985664, -0.0029260539449751377, 0.0010723306331783533, 0.003264108905568719, -0.059114448726177216, -0.01441719476133585, 0.02409208007156849, -0.02604812942445278, -0.01500985212624073, -0.010679347440600395, 0.042648207396268845, -0.08815315365791321, -0.09863272309303284, -0.04033314809203148, 0.022817958146333694, -0.04616604745388031, 0.009473000653088093, -0.06484631448984146, -0.09919796884059906, 0.03863014280796051, -0.08635585755109787, -0.0721627026796341, -0.1282409280538559, 0.0585235133767128, 0.013077416457235813, 0.09616631269454956, 0.035724300891160965, 0.021139541640877724, -0.020237533375620842, 0.0502486489713192, 0.012513712048530579, 0.005693089682608843, -0.03970957174897194, 0.021762989461421967, -0.06760682165622711, 0.0020827532280236483, 0.03034527786076069, -0.0012226732214912772, -0.02750205807387829, -0.033621180802583694, 0.07250145822763443, -0.06960295140743256, 0.0765531063079834, 0.042109351605176926, 0.014763744547963142, -0.06826882809400558, 0.04491327702999115, 0.036970075219869614, -0.040961068123579025, 0.019588667899370193, 0.07806887477636337, 0.07881905138492584, 0.02260894514620304, -0.07250560075044632, -0.08006469905376434, 0.05645497888326645, 0.06731376051902771, 0.020576242357492447, -2.2270688218648587e-33, 0.08575557172298431, 0.04338109865784645, -0.014093827456235886, -0.03897629678249359, -0.01734960451722145, 0.02899424359202385, 0.04197372496128082, 0.08262697607278824, -0.009625100530683994, 0.0419052429497242, -0.03358272463083267, 0.05608024448156357, -0.0597977377474308, -0.05532127618789673, -0.03972134366631508, -0.026473356410861015, 0.01401480007916689, -0.00764349102973938, -0.025207383558154106, 0.06796711683273315, -0.000009319429409515578, -0.0026395036838948727, -0.04010167717933655, 0.019406430423259735, -0.03952118381857872, -0.05997810140252113, 0.013955390080809593, -0.016792381182312965, -0.039674773812294006, -0.013960348442196846, -0.06251951307058334, -0.022195972502231598, -0.0000854813915793784, 0.01299144234508276, 0.04507597163319588, 0.05523458123207092, 0.01828085631132126, 0.03524777293205261, -0.07419406622648239, -0.02213858999311924, -0.04392373561859131, 0.014675403013825417, -0.03861488029360771, -0.06898927688598633, -0.08302713930606842, -0.04250778630375862, -0.0821181908249855, -0.0545695535838604, 0.05672591179609299, 0.023175133392214775, -0.050415948033332825, 0.033690277487039566, -0.0342465415596962, -0.013754915446043015, 0.039898019284009933, 0.018521487712860107, 0.025772664695978165, 0.1298559606075287, -0.038557324558496475, 0.027719562873244286, -0.021486856043338776, -0.0030362121760845184, 0.06729813665151596, 0.08207741379737854, 0.06486132740974426, 0.036485765129327774, 0.030944282189011574, 0.09902902692556381, -0.001717371167615056, -0.002888911636546254, 0.027929218485951424, 0.008163955062627792, 0.022244883701205254, 0.0055694193579256535, 0.07577817142009735, -0.0744599923491478, 0.0023097035009413958, 0.022270992398262024, -0.015301370993256569, 0.024756984785199165, 0.018674254417419434, -0.07584520429372787, -0.06959028542041779, 0.09891558438539505, -0.04393398389220238, 0.09431281685829163, -0.03230990469455719, -0.050632305443286896, -0.04004841670393944, -0.05912938714027405, -0.034132130444049835, 0.0443354956805706, -0.07227471470832825, -0.06921640783548355, 0.0030317094642668962, 8.254469416211658e-35, 0.0722040981054306, -0.10253319144248962, 0.016605671495199203, -0.008431810885667801, 0.025552615523338318, -0.09398908168077469, 0.03468010574579239, 0.047666121274232864, 0.045085359364748, 0.04624972492456436, 0.03441034257411957, -0.05427371710538864, 0.06320182234048843, -0.09588558971881866, 0.01427595503628254, 0.06030387058854103, -0.03823119401931763, -0.061606891453266144, -0.0048653436824679375, -0.0143082644790411, 0.019158484414219856, 0.03114253655076027, -0.10871710628271103, 0.018090521916747093, -0.022271517664194107, -0.04215635731816292, -0.012622342444956303, -0.0033697974868118763, -0.04377336427569389, 0.07153447717428207, -0.021280894055962563, -0.011126686818897724, -0.012933251447975636, 0.025790411978960037, -0.041241422295570374, -0.053617313504219055, 0.006339597050100565, 0.08782947808504105, 0.005429096519947052, -0.0158263947814703, -0.025145839899778366, 0.04749789834022522, 0.011231168173253536, 0.005941625684499741, 0.022669291123747826, -0.040576644241809845, -0.006974945776164532, 0.054913230240345, -0.033181242644786835, -0.060356080532073975, 0.045298464596271515, 0.03093818575143814, -0.09337825328111649, 0.03108980506658554, 0.021375421434640884, -0.05426977947354317, -0.02189585380256176, -0.02501709945499897, -0.054709542542696, -0.019047023728489876, -0.043076518923044205, -0.0011917249066755176, -0.013901947997510433, 0.01733439415693283, 0.07670895755290985, -0.04176243022084236, -0.06516943126916885, 0.008375011384487152, 0.05774283409118652, -0.08157368004322052, 0.02465153858065605, -0.07515624165534973, 0.08671951293945312, 0.08036410063505173, 0.05302014574408531, 0.040300216525793076, 0.02210964821279049, -0.018761109560728073, 0.04308970272541046, 0.05609513819217682, -0.04842979460954666, 0.00573913985863328, 0.024997547268867493, 0.19288991391658783, 0.025981884449720383, 0.010646075941622257, -0.04625054448843002, 0.08318567276000977, -0.031881432980298996, -0.02029421180486679, 0.061434194445610046, -0.09557028114795685, -0.025412404909729958, -0.025574754923582077, -0.01239582896232605, -4.4434148804839424e-8, -0.06504522264003754, -0.00332189560867846, -0.0686107948422432, 0.06579570472240448, -0.020062528550624847, 0.05664462223649025, 0.0980415865778923, 0.056375257670879364, -0.04384705051779747, -0.01862853765487671, 0.061220433562994, 0.13308392465114594, -0.002340639941394329, 0.0032541633117944, -0.03036263771355152, -0.020358437672257423, -0.026743920519948006, 0.09658581763505936, -0.028914988040924072, 0.04656137898564339, -0.005543351173400879, -0.013073419220745564, 0.003504471154883504, -0.005787416826933622, 0.08601769804954529, 0.05973490700125694, 0.02445264905691147, 0.001363640883937478, -0.0063064005225896835, 0.05011436343193054, -0.08685936778783798, 0.018115688115358353, -0.0030146711505949497, -0.02140006050467491, 0.019904686138033867, -0.006036491133272648, 0.003292851382866502, 0.010198164731264114, -0.027829324826598167, 0.08241953700780869, 0.03149530291557312, -0.000998765928670764, 0.0009040379081852734, 0.06034258008003235, -0.04173044487833977, -0.004526085220277309, -0.014377130195498466, 0.03337978571653366, 0.09936993569135666, -0.033222440630197525, 0.09227582067251205, -0.02676086686551571, -0.005991077050566673, -0.036579202860593796, -0.06095698103308678, -0.011632281355559826, 0.034578558057546616, 0.03968915715813637, -0.023394683375954628, -0.01286822184920311, 0.13792528212070465, 0.014692193828523159, 0.051773592829704285, 0.05165974795818329 ]
0.074689
[[search-request-source-filtering]] === Source filtering Allows to control how the `\_source` field is returned with every hit. By default operations return the contents of the `\_source` field unless you have used the `stored\_fields` parameter or if the `\_source` field is disabled. You can turn off `\_source` retrieval by using the `\_source` parameter: To disable `\_source` retrieval set to `false`: [source,js] -------------------------------------------------- GET /\_search { "\_source": false, "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE The `\_source` also accepts one or more wildcard patterns to control what parts of the `\_source` should be returned: For example: [source,js] -------------------------------------------------- GET /\_search { "\_source": "obj.\*", "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE Or [source,js] -------------------------------------------------- GET /\_search { "\_source": [ "obj1.\*", "obj2.\*" ], "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE Finally, for complete control, you can specify both `includes` and `excludes` patterns: [source,js] -------------------------------------------------- GET /\_search { "\_source": { "includes": [ "obj1.\*", "obj2.\*" ], "excludes": [ "\*.description" ] }, "query" : { "term" : { "user" : "kimchy" } } } -------------------------------------------------- // CONSOLE
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/source-filtering.asciidoc
6.2
elasticsearch-6-2
[ -0.031898435205221176, 0.07895918190479279, -0.01219596341252327, 0.09842327982187271, 0.031076131388545036, 0.011449828743934631, 0.06693440675735474, -0.04554735869169235, 0.09280559420585632, -0.06324067711830139, -0.021579857915639877, -0.03647491708397865, -0.0287700816988945, -0.07361921668052673, -0.034218404442071915, 0.05930145084857941, -0.0076160612516105175, 0.013238281011581421, -0.04684711992740631, -0.07882466167211533, 0.03248787671327591, 0.04467916861176491, -0.004986675921827555, -0.02452421560883522, 0.0005203542532399297, -0.036587491631507874, -0.10402140766382217, -0.0629451796412468, 0.04676063358783722, 0.029747027903795242, -0.052817221730947495, 0.015225782059133053, -0.015777602791786194, 0.0620008185505867, -0.019359519705176353, -0.028752116486430168, -0.07925039529800415, 0.011162393726408482, 0.029118046164512634, 0.01021310780197382, -0.015916982665657997, 0.04787310212850571, -0.06810646504163742, -0.07886369526386261, -0.03660045564174652, -0.0807482972741127, -0.04465252161026001, -0.07206819206476212, 0.01496539730578661, -0.010935169644653797, -0.11996221542358398, 0.039051417261362076, -0.04784276708960533, 0.011732551269233227, 0.060242924839258194, -0.0006147926906123757, -0.09703689813613892, 0.03336642310023308, 0.010965172201395035, -0.04305047541856766, -0.03561020642518997, -0.09102682769298553, -0.019707780331373215, -0.005208049900829792, 0.016354933381080627, -0.02872845157980919, -0.05525479093194008, 0.00459557119756937, 0.035835374146699905, -0.00008641902968520299, 0.07056169956922531, 0.013577726669609547, -0.035228438675403595, -0.05361174792051315, 0.06881937384605408, 0.04226210340857506, -0.05795999616384506, -0.01197807490825653, 0.029783915728330612, 0.04027063772082329, 0.009441678412258625, -0.13025318086147308, -0.03154320642352104, 0.005456432234495878, -0.02512597106397152, 0.0031439405865967274, -0.058869510889053345, -0.0721559152007103, 0.1313188374042511, -0.055293288081884384, -0.02390117384493351, -0.10848481208086014, 0.07394304871559143, 0.037880271673202515, 0.001828090287744999, 0.014699969440698624, -0.001232785638421774, -0.02512141689658165, 0.05450069159269333, 0.014211835339665413, 0.03167906031012535, -0.04617409035563469, -0.0031208349391818047, -0.014920114539563656, -0.024395538493990898, -0.009768778458237648, 0.039690613746643066, 0.052625060081481934, -0.01632448472082615, 0.0577671155333519, -0.026376059278845787, 0.1200040951371193, -0.014480718411505222, -0.03729838877916336, -0.06826039403676987, 0.05088040977716446, 0.051045868545770645, -0.07239741086959839, -0.03169788420200348, 0.06878092139959335, 0.11748804897069931, 0.048511017113924026, -0.08334290236234665, 0.007760520093142986, -0.02084084041416645, -0.021354379132390022, 0.0422181710600853, 2.77199935023127e-33, 0.08362431824207306, 0.007049026433378458, 0.006292746867984533, -0.07338356971740723, -0.05682486668229103, 0.05997848138213158, 0.00402607349678874, 0.09734251350164413, -0.011389417573809624, 0.025546075776219368, -0.0371568463742733, 0.08820732682943344, -0.06002606078982353, -0.03335583209991455, -0.04781688004732132, 0.004335843026638031, -0.0061374446377158165, -0.03075459413230419, 0.03453667089343071, 0.029302697628736496, 0.059756018221378326, -0.0186665840446949, -0.03447416052222252, 0.050555333495140076, 0.014555067755281925, -0.039475373923778534, -0.06492041796445847, 0.008490215055644512, -0.12052154541015625, 0.0160590298473835, -0.0786224827170372, -0.0023875681217759848, 0.04545285925269127, 0.007282922975718975, 0.0529535636305809, 0.041530076414346695, -0.05223208665847778, 0.0758708119392395, -0.03301252797245979, -0.002656045835465193, 0.006972483359277248, 0.009525572881102562, 0.0006309263408184052, -0.13115891814231873, -0.08668772876262665, -0.06978654861450195, -0.10337850451469421, -0.014719625003635883, 0.0031885895878076553, -0.02529429830610752, -0.03818165138363838, 0.10821927338838577, -0.024097813293337822, -0.024755917489528656, 0.07301044464111328, 0.03975345194339752, -0.0012006000615656376, 0.05366025120019913, -0.03825951740145683, 0.042432285845279694, 0.04554281011223793, 0.005668990779668093, 0.0718020424246788, 0.020154576748609543, -0.008932853117585182, 0.0425356887280941, -0.00583640905097127, 0.03775231912732124, -0.021131573244929314, 0.0458429716527462, -0.019070731475949287, 0.016534632071852684, 0.06289101392030716, -0.001923203351907432, 0.021126696839928627, -0.11254589259624481, -0.08057446032762527, 0.009419652633368969, 0.015462548471987247, 0.03573562204837799, -0.025529706850647926, -0.07090672105550766, -0.07713174819946289, 0.10524002462625504, 0.007073558866977692, 0.037726908922195435, -0.026557104662060738, -0.058026257902383804, -0.056757260113954544, -0.0019096867181360722, 0.024969803169369698, -0.039308056235313416, -0.10002243518829346, -0.09781435877084732, -0.06810472905635834, -6.714902745844866e-33, 0.04603874310851097, -0.06408276408910751, -0.008045713417232037, -0.03031100332736969, -0.038882747292518616, -0.02229466661810875, 0.04159664362668991, 0.04190829396247864, 0.057957205921411514, 0.06107369437813759, 0.027472957968711853, -0.02840610221028328, 0.015304352156817913, -0.052418455481529236, 0.0007079404895193875, 0.07973266392946243, -0.05915331095457077, -0.022656181827187538, -0.0843534767627716, -0.01296270452439785, -0.02269000932574272, 0.007664720993489027, -0.035505082458257675, 0.03274066001176834, -0.06128516420722008, -0.05327016860246658, 0.016784174367785454, -0.004984333645552397, 0.009318109601736069, 0.024984819814562798, -0.03833434358239174, 0.052657417953014374, -0.09079375118017197, -0.03781180828809738, -0.09371154755353928, 0.021420646458864212, -0.01063554361462593, 0.11037536710500717, 0.010319248773157597, 0.07258670032024384, 0.018443681299686432, 0.028667829930782318, -0.027690783143043518, 0.038981951773166656, 0.023955877870321274, -0.04335243999958038, -0.005784647539258003, 0.048772476613521576, 0.07864156365394592, -0.0475071519613266, 0.05319901928305626, 0.0011300502810627222, -0.06548701226711273, 0.04787133261561394, -0.007920363917946815, -0.050384629517793655, -0.03076762706041336, -0.05367264896631241, -0.02707587741315365, 0.0044069248251616955, -0.02053355611860752, -0.03485293313860893, -0.08000290393829346, -0.03173105791211128, 0.047084223479032516, -0.03341730311512947, 0.003186807967722416, 0.09088283032178879, 0.08372882753610611, -0.0912826880812645, 0.04120439663529396, -0.07040197402238846, 0.11681196093559265, 0.026008041575551033, 0.003053237684071064, 0.07199879735708237, -0.033603768795728683, -0.009342275559902191, 0.07100245356559753, 0.02947831153869629, 0.021036213263869286, -0.0025544054806232452, 0.04457775875926018, 0.11915528029203415, 0.005540846846997738, -0.026841644197702408, -0.09997443854808807, 0.07853966951370239, -0.051080476492643356, -0.03329235315322876, 0.051640257239341736, -0.08299902826547623, -0.05621481314301491, 0.029739491641521454, -0.005668052937835455, -5.662786506377415e-8, -0.06908699125051498, -0.0033870856277644634, -0.07265850156545639, 0.03386181965470314, -0.017670374363660812, 0.042455751448869705, 0.04981720820069313, 0.06386451423168182, -0.0693473368883133, -0.07177788764238358, -0.0027303765527904034, 0.09172187000513077, -0.009367946535348892, -0.02183372899889946, -0.02192905731499195, -0.010976036079227924, -0.041987884789705276, 0.03829175978899002, -0.007595244795084, -0.05284319818019867, -0.00030442411662079394, -0.04797348380088806, -0.000790442165452987, -0.000719582021702081, 0.07860022038221359, 0.00832201074808836, -0.034604620188474655, 0.027776457369327545, 0.04963470622897148, 0.027463508769869804, 0.012358810752630234, 0.043272655457258224, -0.026947172358632088, -0.02387397177517414, -0.010507667437195778, -0.015633560717105865, 0.005635397043079138, -0.05938830226659775, -0.08540724962949753, 0.05382693186402321, 0.0517820306122303, 0.006782326847314835, -0.03363700211048126, 0.057970643043518066, -0.08709158003330231, 0.025215744972229004, 0.055034760385751724, 0.004931744188070297, 0.13631349802017212, -0.06163426861166954, 0.044158145785331726, -0.028153304010629654, -0.0016814650734886527, 0.02088093012571335, -0.042425528168678284, -0.0627594143152237, 0.050821032375097275, 0.04161390662193298, 0.013877330347895622, -0.05991092696785927, 0.07281545549631119, 0.021333443000912666, 0.004357329104095697, 0.055273886770009995 ]
0.036835
[[search-request-highlighting]] === Highlighting Highlighters enable you to get highlighted snippets from one or more fields in your search results so you can show users where the query matches are. When you request highlights, the response contains an additional `highlight` element for each search hit that includes the highlighted fields and the highlighted fragments. Highlighting requires the actual content of a field. If the field is not stored (the mapping does not set `store` to `true`), the actual `\_source` is loaded and the relevant field is extracted from `\_source`. NOTE: The `\_all` field cannot be extracted from `\_source`, so it can only be used for highlighting if it is explicitly stored. For example, to get highlights for the `content` field in each search hit using the default highlighter, include a `highlight` object in the request body that specifies the `content` field: [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "content": "kimchy" } }, "highlight" : { "fields" : { "content" : {} } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] {es} supports three highlighters: `unified`, `plain`, and `fvh` (fast vector highlighter). You can specify the highlighter `type` you want to use for each field. [[unified-highlighter]] ==== Unified highlighter The `unified` highlighter uses the Lucene Unified Highlighter. This highlighter breaks the text into sentences and uses the BM25 algorithm to score individual sentences as if they were documents in the corpus. It also supports accurate phrase and multi-term (fuzzy, prefix, regex) highlighting. This is the default highlighter. [[plain-highlighter]] ==== Plain highlighter The `plain` highlighter uses the standard Lucene highlighter. It attempts to reflect the query matching logic in terms of understanding word importance and any word positioning criteria in phrase queries. [WARNING] The `plain` highlighter works best for highlighting simple query matches in a single field. To accurately reflect query logic, it creates a tiny in-memory index and re-runs the original query criteria through Lucene's query execution planner to get access to low-level match information for the current document. This is repeated for every field and every document that needs to be highlighted. If you want to highlight a lot of fields in a lot of documents with complex queries, we recommend using the `unified` highlighter on `postings` or `term\_vector` fields. [[fast-vector-highlighter]] ==== Fast vector highlighter The `fvh` highlighter uses the Lucene Fast Vector highlighter. This highlighter can be used on fields with `term\_vector` set to `with\_positions\_offsets` in the mapping. The fast vector highlighter: \* Can be customized with a <>. \* Requires setting `term\_vector` to `with\_positions\_offsets` which increases the size of the index \* Can combine matches from multiple fields into one result. See `matched\_fields` \* Can assign different weights to matches at different positions allowing for things like phrase matches being sorted above term matches when highlighting a Boosting Query that boosts phrase matches over term matches [[offsets-strategy]] ==== Offsets Strategy To create meaningful search snippets from the terms being queried, the highlighter needs to know the start and end character offsets of each word in the original text. These offsets can be obtained from: \* The postings list. If `index\_options` is set to `offsets` in the mapping, the `unified` highlighter uses this information to highlight documents without re-analyzing the text. It re-runs the original query directly on the postings and extracts the matching offsets from the index, limiting the collection to the highlighted documents. This is important if you have large fields because it doesn't require reanalyzing the text to be highlighted. It also requires less disk space than using `term\_vectors`. \* Term vectors. If `term\_vector` information is provided by setting `term\_vector` to `with\_positions\_offsets` in the mapping,
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/highlighting.asciidoc
6.2
elasticsearch-6-2
[ -0.06365688145160675, 0.049482688307762146, 0.05125917121767998, 0.07096248120069504, 0.07680515944957733, 0.04347281530499458, 0.05638429895043373, -0.042736250907182693, 0.03124029003083706, -0.0608774796128273, -0.06389278918504715, -0.04094863310456276, 0.045888740569353104, -0.06903598457574844, 0.06451448798179626, 0.08078747242689133, 0.029245277866721153, 0.02599114552140236, -0.04546959698200226, -0.09994032979011536, 0.03740975633263588, 0.05080552026629448, -0.005178913939744234, -0.0455390140414238, -0.059745147824287415, 0.018615931272506714, -0.01851615495979786, -0.04613102599978447, 0.08089268952608109, 0.06028485670685768, 0.004868969786912203, -0.004105475731194019, 0.015427283942699432, 0.10226745903491974, -0.054650381207466125, 0.03565188869833946, -0.0514942966401577, -0.000702693359926343, 0.03466067090630531, 0.028390690684318542, -0.006193279288709164, 0.04335132986307144, -0.06774511933326721, -0.0271600354462862, -0.038656458258628845, -0.06284956634044647, 0.006090390030294657, -0.04346131160855293, -0.023843495175242424, -0.05925409123301506, -0.03588702529668808, -0.011952473782002926, 0.0006677067140117288, -0.044407762587070465, 0.05596337094902992, 0.04413289949297905, -0.05790165811777115, -0.011624709703028202, 0.018108678981661797, -0.060244884341955185, -0.06430749595165253, -0.08571700751781464, 0.04600850120186806, -0.04077121242880821, 0.03261219710111618, -0.03517560288310051, -0.03882419690489769, -0.003578193485736847, 0.02266768552362919, -0.06490369886159897, 0.02051304094493389, 0.010997666046023369, 0.057721491903066635, -0.058030132204294205, 0.039369095116853714, 0.10195428878068924, -0.02505791187286377, 0.0023341358173638582, -0.03091708943247795, -0.038217511028051376, -0.005827791057527065, -0.1023966521024704, 0.033964481204748154, 0.018223250284790993, 0.03971339017152786, 0.0015375291695818305, -0.030245445668697357, -0.06169164553284645, 0.08881742507219315, -0.0014058996457606554, -0.049177974462509155, -0.10234972089529037, -0.0081924544647336, 0.009171832352876663, 0.010633833706378937, 0.06695789098739624, 0.003569109831005335, -0.09946135431528091, 0.03840307146310806, -0.020615627989172935, 0.05371746048331261, -0.035975802689790726, 0.07843371480703354, -0.06009834632277489, -0.07558484375476837, 0.02126985974609852, -0.0040840948931872845, 0.10900682955980301, -0.03864440321922302, -0.014537750743329525, 0.017344880849123, 0.0764695256948471, 0.02311476320028305, -0.028383048251271248, -0.03959988057613373, -0.02906392142176628, 0.07613775879144669, -0.09048127382993698, 0.008337755687534809, 0.11021547764539719, 0.11240780353546143, 0.021183373406529427, -0.058057744055986404, -0.007981309667229652, -0.033255062997341156, 0.013619359582662582, 0.018990591168403625, 4.700544402207101e-33, 0.10065057128667831, 0.04701390117406845, -0.04340536147356033, -0.024128230288624763, -0.038440391421318054, 0.05027519538998604, -0.009550738148391247, 0.0032341647893190384, -0.08150814473628998, -0.017430489882826805, 0.021623332053422928, 0.11242175847291946, -0.05811632424592972, 0.03436664491891861, -0.10679584741592407, -0.010798774659633636, -0.014871377497911453, -0.006805350072681904, -0.034321993589401245, 0.058081381022930145, -0.07457159459590912, -0.004380546044558287, -0.016336003318428993, 0.03916289284825325, 0.016726519912481308, -0.022844990715384483, -0.04099327325820923, 0.0007252215291373432, -0.10303936153650284, -0.0391075573861599, -0.05325714871287346, 0.004732260014861822, 0.048123639076948166, -0.00019245468138251454, 0.059941135346889496, 0.0979422926902771, -0.014104191213846207, 0.0646747499704361, -0.055984724313020706, -0.009029453620314598, 0.00995307695120573, -0.009552691131830215, 0.038095902651548386, -0.08963779360055923, -0.02881889045238495, -0.051691628992557526, -0.14964888989925385, 0.05054878070950508, 0.01225381251424551, -0.005036951042711735, 0.023744923993945122, 0.10126954317092896, -0.04559025913476944, -0.06890742480754852, 0.03639199212193489, 0.014246342703700066, -0.020788351073861122, 0.0320911630988121, 0.06731630116701126, 0.02140917256474495, 0.012686708010733128, -0.01350498478859663, 0.04199820011854172, -0.017867907881736755, -0.0334610752761364, 0.09009602665901184, 0.024237627163529396, 0.04292770475149155, -0.007584947161376476, 0.07861053198575974, 0.029683945700526237, 0.059198763221502304, 0.06334187090396881, 0.0012272946769371629, 0.033558569848537445, -0.08960969001054764, -0.06305837631225586, 0.0073472619988024235, 0.10979046672582626, 0.014340333640575409, -0.054367002099752426, -0.054408252239227295, -0.08646915853023529, 0.03166037052869797, -0.023595673963427544, 0.07663694024085999, -0.03613074868917465, -0.1067052036523819, -0.03696918487548828, -0.06169251725077629, 0.050131168216466904, 0.037078551948070526, -0.13726851344108582, -0.13587801158428192, -0.047468822449445724, -6.792763818223488e-33, 0.06307412683963776, 0.024574121460318565, -0.0260666161775589, -0.005167106166481972, -0.0037382878363132477, -0.012882481329143047, 0.023495923727750778, 0.01172973308712244, 0.03952343761920929, 0.07554741948843002, 0.021968290209770203, -0.04308784753084183, -0.033815428614616394, -0.05347462743520737, -0.08951092511415482, 0.08407873660326004, -0.04665770009160042, 0.0351375937461853, -0.009289729408919811, 0.006279206369072199, -0.01123314443975687, 0.014814194291830063, -0.03226616233587265, 0.009131811559200287, -0.06807456910610199, -0.03435279056429863, 0.024678146466612816, 0.03950671851634979, -0.00642354367300868, 0.02047877572476864, 0.00621670950204134, -0.037382062524557114, -0.13752102851867676, -0.04296894371509552, -0.09112890809774399, -0.012998515740036964, -0.007696575950831175, 0.06940324604511261, 0.014539321884512901, 0.07392695546150208, -0.0012684096582233906, -0.0527987964451313, -0.020318331196904182, 0.06916173547506332, -0.0035161590203642845, -0.033507779240608215, 0.0049715228378772736, 0.06515994668006897, 0.029436009004712105, -0.076871357858181, 0.042510807514190674, -0.031534187495708466, -0.037238709628582, 0.016855381429195404, -0.0034038478042930365, -0.07968826591968536, -0.03053390607237816, 0.002175762318074703, -0.018261559307575226, 0.046981289982795715, -0.06162332743406296, 0.05384232848882675, -0.07614754885435104, 0.06413927674293518, 0.0249713733792305, -0.07209744304418564, 0.026654502376914024, -0.0018155222060158849, 0.04279714450240135, -0.09315577894449234, 0.04899025708436966, -0.06498983502388, 0.1010953038930893, 0.008603888563811779, 0.07154180854558945, 0.06924081593751907, -0.0107412813231349, -0.014494112692773342, 0.0810919776558876, 0.004175521433353424, 0.00928496103733778, -0.026160528883337975, 0.04452015832066536, 0.04311374947428703, -0.0030601569451391697, -0.004718997050076723, -0.06796478480100632, 0.11847282201051712, -0.0385255441069603, -0.09943319112062454, 0.019208714365959167, -0.04631014168262482, -0.029814671725034714, -0.005162008572369814, 0.012560916133224964, -5.9182852396588714e-8, -0.06729554384946823, 0.04173646867275238, -0.09456047415733337, -0.04487436264753342, -0.01930461823940277, 0.013831336982548237, 0.0753679946064949, 0.03645021840929985, -0.031159348785877228, 0.0018370802281424403, 0.003955704625695944, 0.02765321545302868, -0.018661757931113243, 0.007737640757113695, 0.0019314885139465332, 0.06570994108915329, 0.008207698352634907, 0.03366247937083244, -0.03262783959507942, -0.0009811336640268564, -0.03828169032931328, 0.031851787120103836, 0.01644817367196083, -0.017120441421866417, 0.09753938764333725, 0.04215466231107712, -0.02987569198012352, 0.05247873067855835, 0.013962499797344208, 0.03710917755961418, -0.01951887272298336, 0.03856571018695831, -0.024947000667452812, -0.07097162306308746, 0.04554544389247894, 0.013273686170578003, -0.02403038553893566, -0.07374627143144608, -0.020400270819664, 0.09884601831436157, -0.022428853437304497, 0.0026342624332755804, 0.0003506444045342505, -0.005930308718234301, -0.05394785478711128, 0.023849818855524063, -0.011824153363704681, -0.008697503246366978, 0.044171541929244995, -0.03692571446299553, 0.02352328784763813, -0.07546423375606537, -0.03130453824996948, 0.02807464264333248, -0.08350305259227753, -0.07826310396194458, 0.020389415323734283, 0.08347143232822418, 0.043612707406282425, -0.02933826483786106, 0.0759730413556099, 0.05081706494092941, 0.005533658899366856, 0.02891809679567814 ]
0.01616
limiting the collection to the highlighted documents. This is important if you have large fields because it doesn't require reanalyzing the text to be highlighted. It also requires less disk space than using `term\_vectors`. \* Term vectors. If `term\_vector` information is provided by setting `term\_vector` to `with\_positions\_offsets` in the mapping, the `unified` highlighter automatically uses the `term\_vector` to highlight the field. It's fast especially for large fields (> `1MB`) and for highlighting multi-term queries like `prefix` or `wildcard` because it can access the dictionary of terms for each document. The `fvh` highlighter always uses term vectors. \* Plain highlighting. This mode is used by the `unified` when there is no other alternative. It creates a tiny in-memory index and re-runs the original query criteria through Lucene's query execution planner to get access to low-level match information on the current document. This is repeated for every field and every document that needs highlighting. The `plain` highlighter always uses plain highlighting. [WARNING] Plain highlighting for large texts may require substantial amount of time and memory. To protect against this, the maximum number of text characters to be analyzed will be limited to 1000000 in the next major Elastic version. The default limit is not set for this version, but can be set for a particular index with the index setting `index.highlight.max\_analyzed\_offset`. [[highlighting-settings]] ==== Highlighting Settings Highlighting settings can be set on a global level and overridden at the field level. boundary\_chars:: A string that contains each boundary character. Defaults to `.,!? \t\n`. boundary\_max\_scan:: How far to scan for boundary characters. Defaults to `20`. [[boundary-scanners]] boundary\_scanner:: Specifies how to break the highlighted fragments: `chars`, `sentence`, or `word`. Only valid for the `unified` and `fvh` highlighters. Defaults to `sentence` for the `unified` highlighter. Defaults to `chars` for the `fvh` highlighter. `chars`::: Use the characters specified by `boundary\_chars` as highlighting boundaries. The `boundary\_max\_scan` setting controls how far to scan for boundary characters. Only valid for the `fvh` highlighter. `sentence`::: Break highlighted fragments at the next sentence boundary, as determined by Java's https://docs.oracle.com/javase/8/docs/api/java/text/BreakIterator.html[BreakIterator]. You can specify the locale to use with `boundary\_scanner\_locale`. + NOTE: When used with the `unified` highlighter, the `sentence` scanner splits sentences bigger than `fragment\_size` at the first word boundary next to `fragment\_size`. You can set `fragment\_size` to 0 to never split any sentence. `word`::: Break highlighted fragments at the next word boundary, as determined by Java's https://docs.oracle.com/javase/8/docs/api/java/text/BreakIterator.html[BreakIterator]. You can specify the locale to use with `boundary\_scanner\_locale`. boundary\_scanner\_locale:: Controls which locale is used to search for sentence and word boundaries. encoder:: Indicates if the snippet should be HTML encoded: `default` (no encoding) or `html` (HTML-escape the snippet text and then insert the highlighting tags) fields:: Specifies the fields to retrieve highlights for. You can use wildcards to specify fields. For example, you could specify `comment\_\*` to get highlights for all <> and <> fields that start with `comment\_`. + NOTE: Only text and keyword fields are highlighted when you use wildcards. If you use a custom mapper and want to highlight on a field anyway, you must explicitly specify that field name. force\_source:: Highlight based on the source even if the field is stored separately. Defaults to `false`. fragmenter:: Specifies how text should be broken up in highlight snippets: `simple` or `span`. Only valid for the `plain` highlighter. Defaults to `span`. `simple`::: Breaks up text into same-sized fragments. `span`::: Breaks up text into same-sized fragments, but tried to avoid breaking up text between highlighted terms. This is helpful when you're querying for phrases. Default. fragment\_offset:: Controls the margin from which you want to start highlighting. Only valid when using the `fvh` highlighter. fragment\_size::
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/highlighting.asciidoc
6.2
elasticsearch-6-2
[ 0.029431099072098732, 0.012402432039380074, -0.012342680245637894, 0.002982610370963812, 0.06696336716413498, 0.01396661065518856, -0.06608780473470688, 0.02834324724972248, 0.02750234678387642, -0.032387081533670425, -0.03264579921960831, 0.008729912340641022, -0.022914333269000053, -0.0420319065451622, -0.035337407141923904, 0.038141317665576935, -0.007187253329902887, -0.03926685079932213, -0.045161742717027664, -0.00522842351347208, 0.0109060974791646, 0.020567644387483597, 0.013280725106596947, -0.06042283773422241, -0.10268629342317581, 0.029248656705021858, -0.032476067543029785, -0.00857872236520052, 0.04426302760839462, -0.001420081127434969, -0.014705685898661613, 0.06564585119485855, 0.051343321800231934, 0.1117314025759697, -0.09191204607486725, 0.019213929772377014, -0.04398278146982193, 0.010645044967532158, -0.06047726795077324, -0.02103053405880928, -0.026977647095918655, -0.029805118218064308, -0.06330734491348267, 0.04030073806643486, 0.03192775323987007, -0.06981528550386429, 0.052781667560338974, -0.018724817782640457, 0.031308844685554504, -0.026651065796613693, -0.047026779502630234, 0.010849373415112495, -0.012644900940358639, 0.028777310624718666, 0.05378551408648491, 0.03643922507762909, -0.04430719092488289, -0.05832454189658165, -0.06537437438964844, -0.09008799493312836, -0.09162142127752304, -0.004683232866227627, 0.02950625866651535, -0.044313233345746994, -0.01233822200447321, -0.004863588605076075, 0.08867917954921722, -0.0186189915984869, 0.04148469865322113, -0.005505114793777466, 0.031871248036623, 0.08715678006410599, 0.00957481935620308, 0.0024341074749827385, 0.010827893391251564, 0.11116216331720352, 0.002910161856561899, -0.018791064620018005, 0.004899826366454363, -0.12697294354438782, 0.0142709044739604, -0.012809829786419868, 0.07509736716747284, -0.019231600686907768, 0.07878435403108597, 0.035652417689561844, -0.024456463754177094, -0.14924593269824982, -0.005005737766623497, 0.04829750582575798, 0.043500129133462906, -0.14705811440944672, 0.06302601844072342, -0.013070701621472836, -0.0072024306282401085, 0.011428824625909328, 0.033801861107349396, -0.03451572731137276, 0.060357335954904556, -0.01940707303583622, 0.05028082802891731, -0.057340361177921295, 0.04264278709888458, -0.01634741760790348, -0.15821698307991028, -0.016316931694746017, 0.04804031178355217, 0.060151442885398865, -0.03407943993806839, -0.031242188066244125, 0.05792982876300812, 0.06219392642378807, -0.0005893479683436453, -0.06861330568790436, -0.08761724084615707, -0.006424982100725174, 0.03872952610254288, -0.05693051591515541, 0.10848382860422134, 0.10597427934408188, 0.026085026562213898, 0.0019560286309570074, -0.058609336614608765, -0.0226295106112957, -0.004004174843430519, 0.03148895502090454, 0.02041424997150898, 1.560629462834863e-33, 0.05103891342878342, 0.039370786398649216, -0.07584657520055771, 0.01730172708630562, -0.05044381693005562, 0.06388413906097412, -0.015965040773153305, 0.0533483624458313, -0.13440801203250885, 0.012861139141023159, 0.07662642747163773, 0.09531601518392563, -0.0035807560198009014, 0.09901450574398041, 0.03393667936325073, -0.02664356306195259, 0.031644437462091446, 0.03694215044379234, -0.076525017619133, 0.0030459791887551546, -0.026199769228696823, -0.008009749464690685, 0.03420388698577881, -0.00755172036588192, 0.012062979862093925, 0.004923719447106123, -0.019402608275413513, 0.001326133031398058, -0.04671437665820122, 0.003932200837880373, -0.1014561727643013, -0.022836027666926384, 0.08637716621160507, 0.008725622668862343, -0.0011672911932691932, 0.09249507635831833, -0.05991154909133911, -0.05296802893280983, 0.029772602021694183, -0.05688975751399994, -0.04481817036867142, 0.002453151158988476, 0.03857158496975899, -0.056053970009088516, 0.03422053903341293, 0.029773471876978874, -0.07563097029924393, 0.028321655467152596, -0.04351837933063507, 0.052514754235744476, 0.0827995240688324, 0.035809118300676346, -0.07326997816562653, 0.019822364673018456, 0.03277985751628876, 0.03152633458375931, 0.029589688405394554, -0.022701473906636238, 0.015400939621031284, 0.0534479022026062, -0.08046602457761765, 0.006859729997813702, 0.05671670287847519, 0.019653310999274254, 0.02687559649348259, 0.0389995202422142, 0.03819049894809723, 0.10137972980737686, -0.03974032774567604, 0.07139196991920471, -0.0029921724926680326, 0.049047473818063736, 0.029358306899666786, -0.03989870473742485, 0.04938482865691185, -0.06600858271121979, 0.06896211206912994, -0.10257891565561295, 0.03771412372589111, -0.05552051588892937, -0.09232934564352036, -0.03925172984600067, -0.01338271051645279, -0.031481850892305374, -0.10794580727815628, 0.01804286427795887, -0.018349936231970787, 0.001996463630348444, 0.016720084473490715, -0.07051064819097519, 0.057307448238134384, 0.09832055121660233, -0.06748196482658386, -0.05841691419482231, -0.05174315348267555, -3.9288316262083e-33, 0.06260882318019867, -0.040154553949832916, -0.013817733153700829, 0.05257246643304825, -0.03792804852128029, -0.026028551161289215, 0.015318497084081173, 0.023958122357726097, -0.05444919690489769, -0.08313900232315063, 0.02928614430129528, -0.040247414261102676, -0.04617679491639137, -0.05003097653388977, -0.06493794918060303, 0.03253401070833206, -0.04139484837651253, 0.04286487028002739, -0.019962742924690247, 0.05336134508252144, -0.0009880855213850737, -0.016261829063296318, -0.005088078323751688, 0.047903504222631454, -0.020668212324380875, -0.06951095908880234, -0.06548324972391129, -0.005641963332891464, -0.04619164764881134, -0.027740607038140297, 0.015514472499489784, -0.03543673828244209, -0.07958723604679108, -0.0707048699259758, -0.031178638339042664, -0.011163920164108276, 0.0028742426075041294, 0.008498609066009521, 0.06452857702970505, 0.11104383319616318, 0.037137094885110855, 0.02336733043193817, -0.034071072936058044, -0.002095045754685998, -0.04902268946170807, -0.018542028963565826, -0.08010367304086685, 0.05801728740334511, 0.04786061495542526, 0.016222253441810608, 0.0026518108788877726, -0.054673660546541214, 0.028493870049715042, 0.035073172301054, -0.016884202137589455, -0.020228944718837738, -0.02776680886745453, -0.02830665186047554, -0.07526697218418121, 0.0594942569732666, -0.04011436551809311, 0.09609302133321762, -0.06588175892829895, 0.03244444727897644, 0.0546623133122921, -0.06466687470674515, 0.013837482780218124, -0.00211757468059659, 0.01756441779434681, -0.04279574751853943, 0.0026582765858620405, -0.05160025507211685, -0.03780849277973175, 0.047891803085803986, -0.0072585237212479115, 0.009228172712028027, 0.03993089124560356, -0.0453917570412159, 0.02414540946483612, 0.0011854522163048387, 0.03308909013867378, 0.029243847355246544, 0.0535096600651741, 0.03709624335169792, -0.031114423647522926, 0.14155766367912292, -0.035132668912410736, 0.06200318783521652, -0.04683142155408859, -0.044278040528297424, 0.04839453101158142, 0.0014037034707143903, 0.002896094461902976, -0.00890379212796688, -0.017222022637724876, -5.2538510431077157e-8, -0.08000625669956207, 0.04763799533247948, -0.06760532408952713, -0.04139530286192894, 0.019653670489788055, -0.09597302228212357, 0.035936880856752396, 0.08240331709384918, -0.038226883858442307, 0.03097429871559143, 0.04201355203986168, -0.01676052249968052, -0.11199773102998734, -0.0524040162563324, 0.09687767177820206, 0.07439319789409637, 0.026910945773124695, -0.008167935535311699, -0.07459203898906708, 0.024183137342333794, -0.050750039517879486, 0.05946866050362587, -0.03837783262133598, 0.049948789179325104, -0.002596419071778655, 0.015097390860319138, 0.026671212166547775, 0.08917272835969925, 0.08668253570795059, 0.011369453743100166, -0.015196548774838448, 0.04320362210273743, -0.03555475175380707, -0.0001109242148231715, 0.03890371322631836, 0.10096006095409393, -0.016187841072678566, -0.03042747639119625, -0.04309448227286339, 0.07758312672376633, 0.042159050703048706, 0.013456417247653008, 0.01150577049702406, -0.045208368450403214, -0.022299787029623985, -0.03002098947763443, -0.06960577517747879, 0.023703422397375107, 0.031580161303281784, -0.03370477631688118, -0.0446515791118145, 0.009222550317645073, 0.012890861369669437, 0.09770900011062622, -0.0674743801355362, -0.009094074368476868, 0.026569688692688942, 0.06761908531188965, 0.058325108140707016, -0.02907230146229267, 0.11673483997583389, -0.06475037336349487, -0.03311048820614815, 0.06391149759292603 ]
0.099038
up text into same-sized fragments. `span`::: Breaks up text into same-sized fragments, but tried to avoid breaking up text between highlighted terms. This is helpful when you're querying for phrases. Default. fragment\_offset:: Controls the margin from which you want to start highlighting. Only valid when using the `fvh` highlighter. fragment\_size:: The size of the highlighted fragment in characters. Defaults to 100. highlight\_query:: Highlight matches for a query other than the search query. This is especially useful if you use a rescore query because those are not taken into account by highlighting by default. + IMPORTANT: {es} does not validate that `highlight\_query` contains the search query in any way so it is possible to define it so legitimate query results are not highlighted. Generally, you should include the search query as part of the `highlight\_query`. matched\_fields:: Combine matches on multiple fields to highlight a single field. This is most intuitive for multifields that analyze the same string in different ways. All `matched\_fields` must have `term\_vector` set to `with\_positions\_offsets`, but only the field to which the matches are combined is loaded so only that field benefits from having `store` set to `yes`. Only valid for the `fvh` highlighter. no\_match\_size:: The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight. Defaults to 0 (nothing is returned). number\_of\_fragments:: The maximum number of fragments to return. If the number of fragments is set to 0, no fragments are returned. Instead, the entire field contents are highlighted and returned. This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required. If `number\_of\_fragments` is 0, `fragment\_size` is ignored. Defaults to 5. order:: Sorts highlighted fragments by score when set to `score`. Only valid for the `unified` highlighter. phrase\_limit:: Controls the number of matching phrases in a document that are considered. Prevents the `fvh` highlighter from analyzing too many phrases and consuming too much memory. When using `matched\_fields, `phrase\_limit` phrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by the `fvh` highlighter. Defaults to 256. pre\_tags:: Use in conjunction with `post\_tags` to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in `*` and `*` tags. Specify as an array of strings. post\_tags:: Use in conjunction with `pre\_tags` to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in `*` and `*` tags. Specify as an array of strings. require\_field\_match:: By default, only fields that contains a query match are highlighted. Set `require\_field\_match` to `false` to highlight all fields. Defaults to `true`. tags\_schema:: Set to `styled` to use the built-in tag schema. The `styled` schema defines the following `pre\_tags` and defines `post\_tags` as ``. + [source,html] -------------------------------------------------- *, *, *, *, *, *, *, *, *, *-------------------------------------------------- [[highlighter-type]] type:: The highlighter to use: `unified`, `plain`, or `fvh`. Defaults to `unified`. [[highlighting-examples]] ==== Highlighting Examples \* <> \* <> \* <> \* <> \* <> \* <> \* <> \* <> \* <> \* <> \* <> [[override-global-settings]] [float] === Override global settings You can specify highlighter settings globally and selectively override them for individual fields. [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : { "number\_of\_fragments" : 3, "fragment\_size" : 150, "fields" : { "\_all" : { "pre\_tags" : ["*"], "post\_tags" : ["*"] }, "blog.title" : { "number\_of\_fragments" : 0 }, "blog.author" : { "number\_of\_fragments" : 0 }, "blog.comment" : { "number\_of\_fragments" : 5, "order"
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/highlighting.asciidoc
6.2
elasticsearch-6-2
[ -0.0216438639909029, 0.054853156208992004, 0.07476601004600525, 0.017677798867225647, 0.0786876305937767, 0.06338725984096527, 0.03238963335752487, 0.029800711199641228, 0.0139224324375391, -0.023255182430148125, -0.02066933736205101, -0.044860899448394775, 0.017866607755422592, -0.035793304443359375, 0.07085712254047394, 0.061564113944768906, -0.012096129357814789, 0.01547977514564991, -0.04256994277238846, 0.016003066673874855, 0.024101758375763893, 0.05463783070445061, 0.027233896777033806, -0.025387456640601158, -0.04312213882803917, -0.005508013069629669, -0.029978634789586067, 0.028666244819760323, 0.032814715057611465, 0.05349748581647873, -0.005071653984487057, 0.05265166610479355, 0.04708617180585861, 0.158102348446846, -0.03722120076417923, -0.004965031985193491, -0.0798676386475563, 0.005874947179108858, -0.022675052285194397, -0.0053130509331822395, -0.030658021569252014, -0.010354715399444103, -0.011081382632255554, -0.02984463796019554, 0.01797044277191162, -0.05237271636724472, 0.03836841881275177, 0.029445946216583252, 0.02816815860569477, -0.0655166283249855, -0.08107156306505203, -0.03078201785683632, 0.014885425567626953, 0.037377577275037766, 0.01992805115878582, 0.03382384404540062, -0.033078327775001526, -0.018505936488509178, -0.01870855502784252, -0.10265463590621948, -0.006348657421767712, -0.042330387979745865, 0.014016195200383663, -0.054902076721191406, -0.007327352650463581, -0.017874032258987427, 0.09375455975532532, -0.03041463904082775, -0.0013816056307405233, 0.03456668555736542, 0.014486401341855526, 0.01193311344832182, 0.015375361777842045, 0.024981511756777763, -0.011052686721086502, 0.13373324275016785, -0.04074985906481743, -0.015037467703223228, -0.03444220870733261, -0.02622055448591709, -0.042158983647823334, -0.07627769559621811, 0.01656263880431652, -0.005003402475267649, 0.045037806034088135, -0.028515106067061424, -0.08273974806070328, -0.14989301562309265, 0.03162278234958649, -0.034860529005527496, 0.009657423011958599, -0.104951411485672, -0.017552675679326057, 0.015601211227476597, 0.00878588855266571, 0.015382868237793446, -0.038622479885816574, -0.06881328672170639, 0.041992541402578354, 0.003861924633383751, 0.04616188257932663, 0.015058917924761772, 0.03582850843667984, 0.0028921114280819893, -0.1308150738477707, 0.007644771598279476, 0.011478879489004612, 0.09085511416196823, -0.020776616409420967, -0.027849780395627022, 0.05931023508310318, 0.029996337369084358, 0.02503911405801773, -0.0080582145601511, -0.0265600997954607, 0.05584608390927315, 0.04436223581433296, -0.06513247638940811, 0.04413839802145958, 0.0968635305762291, 0.08009812235832214, 0.051472973078489304, -0.13023938238620758, 0.028565017506480217, -0.03326742723584175, 0.01588650420308113, 0.07367748767137527, 4.616941774608681e-33, 0.055892277508974075, 0.08251852542161942, -0.06452993303537369, -0.008595564402639866, -0.010694727301597595, 0.09515763819217682, -0.05962498113512993, 0.05711757019162178, -0.11740162968635559, 0.0031939258333295584, -0.015405355021357536, 0.04844420403242111, 0.03361057862639427, 0.012370479293167591, -0.0043224189430475235, -0.055812135338783264, 0.019344108179211617, 0.025065315887331963, -0.04653747007250786, 0.07770553231239319, -0.05141698941588402, -0.005222015548497438, 0.023469608277082443, -0.006185401231050491, -0.022736037150025368, 0.0188372153788805, -0.04226775839924812, -0.06006458401679993, -0.06609459966421127, -0.020571555942296982, -0.13086844980716705, -0.010472298599779606, 0.0903138667345047, -0.0004989358130842447, 0.018753353506326675, 0.06980454921722412, -0.03875087574124336, 0.003934492822736502, -0.07404965907335281, -0.03187976032495499, -0.07900863885879517, 0.021231262013316154, 0.08714760094881058, -0.09167076647281647, 0.0064384848810732365, -0.035639483481645584, -0.06115385890007019, 0.023014569655060768, -0.04779453203082085, -0.0005314565496519208, 0.06756559759378433, 0.08604825288057327, -0.005658539477735758, -0.04284445196390152, 0.03873387724161148, 0.0367906391620636, 0.04308084771037102, 0.0661168023943901, 0.05065096542239189, 0.008668509311974049, -0.0830589085817337, -0.021963367238640785, 0.046903859823942184, -0.0032561123371124268, 0.014540058560669422, 0.06308483332395554, 0.015208403579890728, 0.055609047412872314, 0.031785011291503906, 0.10448290407657623, 0.01681186445057392, 0.07167583703994751, -0.0037278146483004093, 0.03974556177854538, 0.04255915805697441, -0.0972430631518364, 0.045115116983652115, -0.034213270992040634, 0.06913425773382187, -0.007577288895845413, -0.08056440204381943, -0.06605605036020279, -0.004608835559338331, 0.002268475014716387, -0.1004694327712059, 0.017980867996811867, 0.027561379596590996, -0.07868753373622894, -0.009566454216837883, -0.0689421221613884, 0.0005147396586835384, 0.04277116432785988, -0.01568787731230259, -0.07833945751190186, -0.013812272809445858, -5.950198120228874e-33, 0.1381295621395111, 0.00514379283413291, -0.035347748547792435, -0.028443723917007446, 0.01490627322345972, -0.013224605470895767, 0.0126389991492033, 0.03900321573019028, -0.07289859652519226, -0.07995299994945526, 0.04704240337014198, -0.04959537088871002, -0.02293359860777855, -0.06983941793441772, -0.06853684037923813, 0.07247039675712585, 0.014464790001511574, 0.07347986847162247, 0.026611782610416412, 0.0410628542304039, -0.006637778598815203, -0.026653775945305824, -0.020871834829449654, 0.014436681754887104, -0.0372929573059082, -0.06444910913705826, 0.035141319036483765, 0.0003826300671789795, -0.062284354120492935, -0.03190263733267784, 0.011573584750294685, -0.06013461947441101, -0.047348879277706146, -0.0013366033090278506, -0.046979211270809174, 0.02590974047780037, -0.04553068056702614, -0.0583873987197876, 0.06390287727117538, 0.06557455658912659, 0.07425476610660553, 0.03204299882054329, -0.03034677729010582, 0.028460828587412834, -0.027527708560228348, -0.060258232057094574, -0.00452070776373148, 0.07072960585355759, -0.04315074533224106, -0.0365915521979332, -0.01418256014585495, -0.03840754181146622, -0.03458515554666519, -0.013992114923894405, -0.0084964195266366, -0.04296400398015976, -0.057272132486104965, 0.018723836168646812, -0.11595720797777176, -0.01377851888537407, -0.054941754788160324, 0.1224455013871193, -0.07340596616268158, -0.02875659056007862, 0.13271750509738922, -0.04857364669442177, -0.011650058440864086, -0.002638687379658222, 0.008377892896533012, -0.07261096686124802, 0.013741208240389824, -0.08387318253517151, 0.046180322766304016, 0.087737537920475, -0.007638299837708473, 0.0024547092616558075, 0.01344304345548153, 0.013255422934889793, 0.04909298196434975, 0.014354552142322063, -0.007468002382665873, -0.06495927274227142, 0.05012428015470505, 0.06403319537639618, -0.03486844524741173, 0.07041485607624054, -0.09624136239290237, 0.14680121839046478, -0.03887808322906494, -0.08999941498041153, -0.011597401462495327, -0.031801383942365646, 0.03515414521098137, -0.008876971900463104, 0.06429547816514969, -5.3747065464904153e-8, -0.017961783334612846, 0.05324186384677887, -0.14544454216957092, -0.014717242680490017, 0.023885047063231468, -0.03368885815143585, 0.03208788484334946, 0.01935046724975109, -0.06234393268823624, 0.00681412173435092, -0.004729934502393007, 0.01910126954317093, -0.08520271629095078, -0.03706014156341553, -0.031881239265203476, 0.019774792715907097, -0.0747094601392746, 0.012658732011914253, -0.0734473243355751, -0.011547190137207508, -0.04595286771655083, 0.05270082503557205, -0.015063431113958359, 0.01790543645620346, -0.024922996759414673, 0.06892252713441849, -0.054149288684129715, 0.07075030356645584, 0.08051599562168121, 0.013766144402325153, 0.013482803478837013, -0.004136725794523954, 0.00681088725104928, -0.015152528882026672, 0.0190123338252306, 0.04445717856287956, 0.019608892500400543, -0.034756992012262344, 0.044509317725896835, 0.08342041075229645, 0.014116944745182991, -0.017724236473441124, 0.0030313150491565466, -0.008455106988549232, -0.04687557369470596, -0.029842404648661613, -0.01990700699388981, 0.01795165427029133, 0.024201596155762672, -0.03469084948301315, 0.03905325382947922, -0.0012115960707888007, -0.02295995131134987, 0.06397411227226257, -0.03811661899089813, -0.07127790153026581, 0.03712770342826843, 0.09037894755601883, -0.012191173620522022, -0.03895365819334984, 0.13234969973564148, -0.026192370802164078, -0.03609766811132431, 0.020987477153539658 ]
0.032378
{ "match": { "user": "kimchy" } }, "highlight" : { "number\_of\_fragments" : 3, "fragment\_size" : 150, "fields" : { "\_all" : { "pre\_tags" : ["*"], "post\_tags" : ["*"] }, "blog.title" : { "number\_of\_fragments" : 0 }, "blog.author" : { "number\_of\_fragments" : 0 }, "blog.comment" : { "number\_of\_fragments" : 5, "order" : "score" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] [float] [[specify-highlight-query]] === Specify a highlight query You can specify a `highlight\_query` to take additional information into account when highlighting. For example, the following query includes both the search query and rescore query in the `highlight\_query`. Without the `highlight\_query`, highlighting would only take the search query into account. [source,js] -------------------------------------------------- GET /\_search { "stored\_fields": [ "\_id" ], "query" : { "match": { "comment": { "query": "foo bar" } } }, "rescore": { "window\_size": 50, "query": { "rescore\_query" : { "match\_phrase": { "comment": { "query": "foo bar", "slop": 1 } } }, "rescore\_query\_weight" : 10 } }, "highlight" : { "order" : "score", "fields" : { "comment" : { "fragment\_size" : 150, "number\_of\_fragments" : 3, "highlight\_query": { "bool": { "must": { "match": { "comment": { "query": "foo bar" } } }, "should": { "match\_phrase": { "comment": { "query": "foo bar", "slop": 1, "boost": 10.0 } } }, "minimum\_should\_match": 0 } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] [float] [[set-highlighter-type]] === Set highlighter type The `type` field allows to force a specific highlighter type. The allowed values are: `unified`, `plain` and `fvh`. The following is an example that forces the use of the plain highlighter: [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : { "fields" : { "comment" : {"type" : "plain"} } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] [[configure-tags]] [float] === Configure highlighting tags By default, the highlighting will wrap highlighted text in `*` and `*`. This can be controlled by setting `pre\_tags` and `post\_tags`, for example: [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : { "pre\_tags" : [""], "post\_tags" : [""], "fields" : { "\_all" : {} } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] When using the fast vector highlighter, you can specify additional tags and the "importance" is ordered. [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : { "pre\_tags" : ["", ""], "post\_tags" : ["", ""], "fields" : { "\_all" : {} } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] You can also use the built-in `styled` tag schema: [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : { "tags\_schema" : "styled", "fields" : { "comment" : {} } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] [float] [[highlight-source]] === Highlight on source Forces the highlighting to highlight fields based on the source even if fields are stored separately. Defaults to `false`. [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : { "fields" : { "comment" : {"force\_source" : true} } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] [[highlight-all]] [float] === Highlight in all fields By default, only fields that contains a query match are highlighted. Set `require\_field\_match` to `false` to highlight all fields. [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : { "require\_field\_match": false, "fields": { "\_all" : { "pre\_tags" : ["*"], "post\_tags" : ["*"] } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] [[matched-fields]] [float] === Combine matches on multiple fields WARNING: This is only supported by the `fvh` highlighter The Fast Vector Highlighter can combine
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/highlighting.asciidoc
6.2
elasticsearch-6-2
[ -0.015035395510494709, 0.09919025748968124, 0.03648119419813156, 0.03635892644524574, 0.07416538894176483, 0.03131501376628876, 0.09826710820198059, 0.03931634873151779, 0.01026098057627678, -0.014481586404144764, -0.042255301028490067, -0.06012251600623131, 0.020488141104578972, 0.02878597192466259, 0.057586636394262314, 0.08563502132892609, -0.05849446356296539, -0.0006112812552601099, -0.047370802611112595, -0.07553598284721375, -0.004111580550670624, 0.011056791059672832, -0.0003281240933574736, 0.03730010613799095, 0.014252636581659317, 0.019640574231743813, -0.045333847403526306, -0.00021830358309671283, 0.023298760876059532, 0.10333319753408432, -0.033933572471141815, 0.018786724656820297, 0.007701762951910496, 0.11417856067419052, 0.00031666128779761493, -0.021556517109274864, -0.07224734872579575, 0.022953379899263382, 0.02984871342778206, 0.04044874384999275, 0.039364058524370193, -0.027521448209881783, -0.0796697661280632, -0.04080555588006973, -0.004823631141334772, -0.060592737048864365, 0.035890091210603714, -0.005932505242526531, -0.05119413882493973, 0.021065223962068558, -0.040177784860134125, -0.034758299589157104, -0.025777265429496765, 0.007303222548216581, 0.024519745260477066, 0.09787607192993164, -0.043233323842287064, -0.06291632354259491, 0.021433500573039055, -0.08221536874771118, -0.0013161933748051524, -0.08515103161334991, 0.019961044192314148, -0.0006035375408828259, 0.000559836917091161, -0.03920361027121544, 0.03012123331427574, 0.04037364199757576, 0.011688373051583767, 0.03223371133208275, 0.05456170067191124, 0.06625453382730484, 0.1145581379532814, 0.009260764345526695, -0.006988117005676031, 0.03576348349452019, -0.03951386734843254, -0.03179670497775078, -0.04343961551785469, 0.05603724718093872, -0.058399297297000885, -0.07260378450155258, -0.029378704726696014, 0.024933328852057457, 0.01558978296816349, -0.018928468227386475, -0.021213473752141, -0.06146223470568657, -0.0686715766787529, -0.031652964651584625, -0.07500710338354111, -0.0420977920293808, 0.02755645662546158, 0.01850176602602005, -0.009425259195268154, 0.1397351771593094, -0.06028524786233902, -0.12474814802408218, 0.055705610662698746, 0.07978519052267075, 0.005676852073520422, -0.018417445942759514, 0.014128177426755428, -0.013095539063215256, -0.010443144477903843, 0.013002168387174606, 0.014321652241051197, 0.03277020528912544, -0.05492944270372391, 0.01075537409633398, 0.0321243554353714, 0.0721902921795845, 0.00882553867995739, 0.009780815802514553, -0.03763989731669426, 0.014523611404001713, 0.07339531928300858, -0.04597677290439606, 0.04118924215435982, 0.07845557481050491, 0.16244259476661682, 0.0706842690706253, -0.05900365486741066, -0.025633545592427254, -0.028184982016682625, 0.08451815694570541, -0.00017842909437604249, -8.48632810048292e-34, 0.10043568164110184, -0.004164853598922491, -0.03667283058166504, -0.025990860536694527, -0.02832110784947872, 0.06720560789108276, -0.02134389616549015, -0.004056429024785757, -0.08594460040330887, -0.030718468129634857, -0.0036910956259816885, 0.052995435893535614, 0.04651295766234398, -0.0134200444445014, -0.054636746644973755, -0.03361257538199425, 0.0391886942088604, 0.07585839182138443, -0.025952273979783058, 0.05268021300435066, -0.0070405388250947, -0.012324156239628792, -0.04630061611533165, 0.020741993561387062, 0.01578403450548649, -0.012281820178031921, -0.07524692267179489, -0.03531957417726517, -0.0793204978108406, -0.00020713185949716717, -0.06528844684362411, 0.01947970874607563, 0.008466355502605438, -0.012482372112572193, 0.07302755117416382, 0.02984429895877838, -0.03675081580877304, -0.0041301799938082695, -0.040056634694337845, -0.04661015421152115, 0.0004945210530422628, -0.009830781258642673, 0.010695118457078934, -0.1369563639163971, -0.057386789470911026, -0.0009158960310742259, -0.02612687274813652, 0.025277089327573776, -0.01611129194498062, 0.0009407012257725, 0.006180257070809603, 0.06856907159090042, -0.052582480013370514, -0.05827214941382408, -0.0007726671174168587, -0.033657245337963104, 0.03428581729531288, 0.03801402822136879, 0.09311200678348541, -0.022335557267069817, -0.08669493347406387, 0.02851179614663124, 0.04330982267856598, -0.029005393385887146, 0.022651316598057747, 0.05051712319254875, 0.03781289979815483, 0.06161368265748024, 0.01923745684325695, -0.025202974677085876, -0.0166669599711895, 0.08355005830526352, -0.04171960800886154, -0.030334843322634697, -0.043334946036338806, -0.0626615509390831, -0.02052266336977482, -0.02349005825817585, 0.003157182829454541, 0.0344717875123024, -0.04400566965341568, -0.10058128833770752, -0.04440173879265785, 0.011823763139545918, -0.05591448396444321, 0.026995735242962837, 0.02083875611424446, -0.0833999291062355, -0.041656311601400375, -0.097812220454216, -0.03343066945672035, 0.032198600471019745, -0.09532441943883896, -0.1574801802635193, -0.04800976440310478, -1.9225314800164132e-33, 0.1227724626660347, 0.00689910352230072, -0.020543735474348068, -0.023462194949388504, 0.04412669315934181, -0.0604495108127594, 0.04184987023472786, 0.057488813996315, -0.02552056685090065, -0.005612360313534737, 0.05805172026157379, -0.10364741086959839, -0.09244997799396515, -0.030158190056681633, -0.005299970041960478, 0.0631827563047409, -0.054844632744789124, 0.0223867055028677, 0.04398156702518463, -0.013874202966690063, 0.012968217022716999, 0.00514648063108325, -0.047344889491796494, 0.05863389000296593, -0.00575966015458107, -0.05107443034648895, 0.09065142273902893, -0.05902763828635216, -0.03195275366306305, -0.018737684935331345, 0.039369162172079086, -0.028233138844370842, -0.05632469803094864, 0.03377821668982506, -0.009202811866998672, -0.005814055912196636, -0.024877656251192093, -0.008221139200031757, 0.04628555104136467, 0.06303964555263519, 0.0697353184223175, -0.0037934433203190565, 0.02006550133228302, 0.02386077120900154, -0.11848574876785278, -0.003545376705005765, 0.07729672640562057, 0.017450833693146706, -0.032121218740940094, -0.04736804962158203, -0.002272768411785364, -0.05111490562558174, -0.023290814831852913, 0.014103255234658718, -0.0245942585170269, -0.09098579734563828, 0.023507652804255486, -0.052673693746328354, -0.06269494444131851, -0.009190399199724197, -0.031997859477996826, 0.08914648741483688, -0.030673719942569733, 0.0497475266456604, 0.05796705186367035, -0.09976324439048767, -0.06620176136493683, -0.03625372797250748, -0.0694560557603836, -0.01742894947528839, 0.02570979855954647, -0.06633466482162476, 0.07420986890792847, -0.009594579227268696, 0.06513503193855286, 0.019270671531558037, 0.026700032874941826, 0.06901367008686066, 0.08490157127380371, -0.048222530633211136, -0.023516347631812096, -0.04492282122373581, 0.02339511550962925, 0.06315450370311737, -0.035671211779117584, -0.009049385786056519, -0.01794300228357315, 0.11066106706857681, -0.0370890274643898, -0.042483650147914886, -0.02426329255104065, -0.030836258083581924, 0.07349943369626999, -0.02578623965382576, 0.05164603888988495, -4.885995963377354e-8, -0.12006795406341553, -0.03635038435459137, -0.11494047194719315, 0.044612254947423935, 0.002292440738528967, 0.08599834889173508, 0.08515709638595581, 0.029341325163841248, -0.051473792642354965, 0.04383230209350586, 0.03365040943026543, 0.05701033025979996, -0.03800671175122261, -0.034040044993162155, -0.04242616891860962, -0.04126407578587532, -0.05415882542729378, 0.007385993842035532, -0.04538121074438095, 0.026376178488135338, -0.0372416153550148, 0.03465056046843529, -0.016930287703871727, -0.03848982974886894, 0.09593985974788666, 0.09651225805282593, -0.035286322236061096, 0.03524739667773247, 0.03321195766329765, 0.06868927925825119, 0.020099544897675514, -0.014180527068674564, -0.05459287017583847, -0.007604825310409069, 0.055266425013542175, 0.031866252422332764, 0.016443707048892975, -0.020272638648748398, 0.0288559477776289, 0.03505117446184158, -0.04211726412177086, -0.025022611021995544, -0.06090528890490532, 0.004319514613598585, -0.0028134388849139214, -0.07339490950107574, -0.07696438580751419, 0.06038212403655052, 0.026950985193252563, -0.07165021449327469, 0.00021415641822386533, -0.07705496996641159, -0.04096822440624237, 0.031628094613552094, -0.04637007787823677, -0.018496984615921974, 0.07686761766672134, 0.0755593404173851, -0.009594394825398922, -0.033680904656648636, 0.12735770642757416, -0.03882691636681557, -0.026646418496966362, 0.016723603010177612 ]
-0.005036
} }, "highlight" : { "require\_field\_match": false, "fields": { "\_all" : { "pre\_tags" : ["*"], "post\_tags" : ["*"] } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] [[matched-fields]] [float] === Combine matches on multiple fields WARNING: This is only supported by the `fvh` highlighter The Fast Vector Highlighter can combine matches on multiple fields to highlight a single field. This is most intuitive for multifields that analyze the same string in different ways. All `matched\_fields` must have `term\_vector` set to `with\_positions\_offsets` but only the field to which the matches are combined is loaded so only that field would benefit from having `store` set to `yes`. In the following examples, `comment` is analyzed by the `english` analyzer and `comment.plain` is analyzed by the `standard` analyzer. [source,js] -------------------------------------------------- GET /\_search { "query": { "query\_string": { "query": "comment.plain:running scissors", "fields": ["comment"] } }, "highlight": { "order": "score", "fields": { "comment": { "matched\_fields": ["comment", "comment.plain"], "type" : "fvh" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] The above matches both "run with scissors" and "running with scissors" and would highlight "running" and "scissors" but not "run". If both phrases appear in a large document then "running with scissors" is sorted above "run with scissors" in the fragments list because there are more matches in that fragment. [source,js] -------------------------------------------------- GET /\_search { "query": { "query\_string": { "query": "running scissors", "fields": ["comment", "comment.plain^10"] } }, "highlight": { "order": "score", "fields": { "comment": { "matched\_fields": ["comment", "comment.plain"], "type" : "fvh" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] The above highlights "run" as well as "running" and "scissors" but still sorts "running with scissors" above "run with scissors" because the plain match ("running") is boosted. [source,js] -------------------------------------------------- GET /\_search { "query": { "query\_string": { "query": "running scissors", "fields": ["comment", "comment.plain^10"] } }, "highlight": { "order": "score", "fields": { "comment": { "matched\_fields": ["comment.plain"], "type" : "fvh" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] The above query wouldn't highlight "run" or "scissor" but shows that it is just fine not to list the field to which the matches are combined (`comment`) in the matched fields. [NOTE] Technically it is also fine to add fields to `matched\_fields` that don't share the same underlying string as the field to which the matches are combined. The results might not make much sense and if one of the matches is off the end of the text then the whole query will fail. [NOTE] =================================================================== There is a small amount of overhead involved with setting `matched\_fields` to a non-empty array so always prefer [source,js] -------------------------------------------------- "highlight": { "fields": { "comment": {} } } -------------------------------------------------- // NOTCONSOLE to [source,js] -------------------------------------------------- "highlight": { "fields": { "comment": { "matched\_fields": ["comment"], "type" : "fvh" } } } -------------------------------------------------- // NOTCONSOLE =================================================================== [[explicit-field-order]] [float] === Explicitly order highlighted fields Elasticsearch highlights the fields in the order that they are sent, but per the JSON spec, objects are unordered. If you need to be explicit about the order in which fields are highlighted specify the `fields` as an array: [source,js] -------------------------------------------------- GET /\_search { "highlight": { "fields": [ { "title": {} }, { "text": {} } ] } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] None of the highlighters built into Elasticsearch care about the order that the fields are highlighted but a plugin might. [float] [[control-highlighted-frags]] === Control highlighted fragments Each field highlighted can control the size of the highlighted fragment in characters (defaults to `100`), and the maximum number of fragments to return (defaults to `5`). For example: [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : {
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/highlighting.asciidoc
6.2
elasticsearch-6-2
[ -0.024997245520353317, 0.04502712935209274, -0.0023468618746846914, -0.019467920064926147, 0.10974830389022827, 0.014209317043423653, 0.04637521132826805, -0.048037994652986526, 0.05495484918355942, -0.0324392095208168, 0.0024656665045768023, -0.05785617232322693, 0.032535258680582047, 0.016130315139889717, 0.055044081062078476, 0.10135207325220108, -0.06346870213747025, -0.0072069657035171986, -0.055925898253917694, -0.04805372282862663, -0.04588726907968521, -0.033012572675943375, -0.026388397440314293, 0.039322663098573685, -0.04362720996141434, 0.04473021999001503, -0.09748545289039612, 0.045614615082740784, -0.016405100002884865, 0.06674376130104065, -0.00027708287234418094, 0.03058915212750435, -0.01502879150211811, 0.1088637039065361, -0.06693248450756073, 0.02382497489452362, -0.10157550126314163, 0.03423571214079857, 0.010250166058540344, 0.04641461744904518, -0.006832793354988098, -0.06192087382078171, -0.033750031143426895, -0.00024294944887515157, -0.01304028183221817, 0.013290607370436192, 0.021048076450824738, 0.03842121362686157, -0.01982121542096138, -0.0808292031288147, -0.04767589643597603, -0.01228893268853426, 0.027734976261854172, 0.06996069848537445, 0.04356079176068306, 0.0894400104880333, -0.04826238751411438, -0.051725663244724274, -0.014265095815062523, -0.05626001954078674, -0.021366843953728676, -0.045191846787929535, 0.009030465967953205, -0.01653463952243328, 0.004933231510221958, -0.022105148062109947, -0.015507491305470467, 0.0515325665473938, 0.007698663976043463, 0.0742621049284935, 0.0294516421854496, 0.0831933319568634, 0.04908929020166397, 0.013161935843527317, -0.006808274891227484, 0.15373286604881287, -0.006824233569204807, 0.0008046322036534548, 0.013466798700392246, -0.054422784596681595, -0.05158338323235512, -0.11136917769908905, 0.0004037907056044787, -0.04218227416276932, 0.05420677363872528, -0.042234569787979126, -0.08505159616470337, -0.0767403244972229, -0.003109979908913374, -0.015881890431046486, -0.010149217210710049, -0.08449067920446396, 0.043874066323041916, 0.02186845801770687, 0.036751773208379745, 0.036773789674043655, 0.029636165127158165, -0.0553952194750309, 0.06326150894165039, 0.028230436146259308, 0.031055571511387825, -0.07419746369123459, 0.06523323804140091, -0.021226583048701286, -0.04156479239463806, -0.009636432863771915, -0.02638324536383152, 0.06728814542293549, -0.03001929074525833, -0.06194077059626579, 0.01734541915357113, 0.007542526349425316, 0.02989516593515873, 0.006553825456649065, -0.0348883718252182, 0.08517804741859436, 0.030277464538812637, -0.056856460869312286, 0.07718159258365631, 0.0763787031173706, 0.06412256509065628, 0.006398731376975775, -0.061800241470336914, -0.012597208842635155, 0.025587696582078934, 0.038499388843774796, -0.024786237627267838, -2.4921213084691836e-33, 0.05717729777097702, -0.00902444589883089, -0.04701059311628342, -0.04680238291621208, -0.023978104814887047, 0.050372302532196045, -0.09846611320972443, 0.020473992452025414, -0.06990274041891098, 0.016423329710960388, 0.05384787544608116, 0.05444011092185974, -0.015470867045223713, 0.009978332556784153, 0.011264762841165066, -0.06390168517827988, 0.0561889111995697, 0.010356958024203777, -0.02372044324874878, 0.06193455308675766, -0.007556730881333351, -0.023918982595205307, -0.06530699133872986, -0.001172709045931697, 0.010468645952641964, 0.012616128660738468, -0.03208136931061745, -0.0508369617164135, 0.007896896451711655, 0.0077605112455785275, -0.07486985623836517, 0.026478393003344536, 0.09275898337364197, 0.03988773375749588, 0.08354297280311584, 0.04780345782637596, -0.04057744890451431, -0.019416753202676773, -0.0589824803173542, -0.06285426020622253, -0.06441248953342438, 0.01343642920255661, 0.02985214814543724, -0.09190697968006134, -0.004650088492780924, -0.006685308180749416, -0.10406450927257538, 0.051884911954402924, -0.0057622939348220825, -0.020648403093218803, 0.0514918677508831, 0.07441911101341248, -0.056336842477321625, -0.04739169776439667, 0.03308641165494919, -0.01515127345919609, -0.04521187022328377, 0.03227981552481651, 0.08427833020687103, 0.0012860747519880533, -0.05554964765906334, 0.02370988205075264, 0.00044847954995930195, -0.060873184353113174, -0.017158934846520424, 0.012641209177672863, 0.08347462117671967, 0.0802646055817604, -0.012226422317326069, 0.07304248958826065, 0.017783528193831444, 0.08822566270828247, -0.06889079511165619, -0.03878019377589226, 0.030608251690864563, -0.035499799996614456, 0.035561203956604004, -0.08291973173618317, 0.03761569783091545, -0.043948300182819366, -0.043859969824552536, -0.061174459755420685, -0.01545929629355669, 0.01801125518977642, -0.07705667614936829, 0.011167864315211773, 0.011644224636256695, -0.046149637550115585, -0.04125116765499115, -0.07151161879301071, 0.009100576862692833, 0.06325240433216095, -0.06667088717222214, -0.1387600600719452, -0.06653816252946854, -5.516839730006256e-34, 0.09432517737150192, -0.017583273351192474, -0.003874533111229539, 0.03527267649769783, 0.029338212683796883, -0.007547067012637854, 0.03627869859337807, 0.0029778124298900366, 0.022166987881064415, -0.01267092302441597, 0.03922709822654724, -0.08866137266159058, -0.12390097975730896, -0.058695584535598755, 0.010415039025247097, 0.028103943914175034, -0.09821771830320358, 0.042366426438093185, 0.016758993268013, 0.0199019405990839, 0.04586115851998329, 0.0058678677305579185, -0.01846962235867977, 0.13194015622138977, -0.029917258769273758, -0.07628977298736572, 0.061885446310043335, -0.010897732339799404, -0.015259647741913795, 0.0073732128366827965, 0.0063974917866289616, -0.06036024168133736, -0.04669477790594101, -0.01747516170144081, -0.03323855996131897, 0.006166232284158468, 0.005267477594316006, 0.059484414756298065, 0.08173205703496933, 0.038144323974847794, 0.06263362616300583, 0.019344184547662735, -0.025106394663453102, 0.01821504347026348, -0.06924200803041458, 0.015672503039240837, 0.016234401613473892, 0.07991636544466019, 0.010980200953781605, -0.021898286417126656, -0.028919482603669167, -0.07034159451723099, -0.045874014496803284, 0.02937437780201435, -0.04383982717990875, -0.09428580105304718, 0.024676596745848656, -0.04517239332199097, -0.13910453021526337, -0.028543565422296524, -0.05225507542490959, 0.05635640397667885, -0.01841261051595211, 0.0073089576326310635, 0.09014444053173065, -0.04618426412343979, -0.031832486391067505, 0.0017679696902632713, -0.024683160707354546, -0.015856629237532616, 0.04872458800673485, -0.05789412558078766, -0.02458776906132698, 0.02808796428143978, 0.02627604641020298, 0.025696486234664917, 0.0339575819671154, -0.005156456492841244, 0.04470864683389664, 0.01923394575715065, -0.0284042377024889, -0.05429074913263321, 0.09731525927782059, 0.05909871682524681, -0.04620082303881645, 0.026379738003015518, -0.03371473401784897, 0.11351826041936874, -0.0038811489939689636, -0.05912071093916893, 0.04044417664408684, 0.04592937231063843, 0.04272262752056122, 0.0008298979955725372, 0.029870739206671715, -5.274398517940426e-8, -0.07246650755405426, -0.04963725805282593, -0.09312734752893448, -0.03895983099937439, -0.03709637373685837, -0.003080978523939848, 0.1052996814250946, -0.0031986269168555737, 0.01921103149652481, -0.020061872899532318, 0.00159554835408926, 0.07073123008012772, -0.07662752270698547, -0.0876733809709549, -0.014387022703886032, 0.018364453688263893, -0.09575071185827255, -0.030589057132601738, -0.05231131613254547, 0.041510239243507385, -0.013061698526144028, 0.06299890577793121, -0.0666547641158104, 0.015093516558408737, 0.07165586948394775, 0.050387218594551086, -0.06430557370185852, 0.061061762273311615, 0.0563766174018383, 0.027951084077358246, 0.07459365576505661, -0.013430208899080753, -0.03545486554503441, -0.05232541263103485, 0.04351091384887695, 0.07494451850652695, 0.01706567592918873, -0.036202531307935715, 0.00847244169563055, 0.04336559399962425, 0.003105859039351344, -0.004506143741309643, -0.06544013321399689, -0.03800323233008385, 0.04609400033950806, -0.09032391756772995, -0.07950233668088913, 0.029449839144945145, 0.036576252430677414, -0.02325388416647911, -0.004636798519641161, 0.02185959555208683, -0.03520280495285988, 0.11831437051296234, -0.04674487188458443, -0.06659947335720062, 0.07003001868724823, 0.05805050954222679, 0.051932934671640396, -0.040927909314632416, 0.13218849897384644, -0.0669189915060997, 0.03111359477043152, 0.034373655915260315 ]
0.012154
=== Control highlighted fragments Each field highlighted can control the size of the highlighted fragment in characters (defaults to `100`), and the maximum number of fragments to return (defaults to `5`). For example: [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : { "fields" : { "comment" : {"fragment\_size" : 150, "number\_of\_fragments" : 3} } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] On top of this it is possible to specify that highlighted fragments need to be sorted by score: [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : { "order" : "score", "fields" : { "comment" : {"fragment\_size" : 150, "number\_of\_fragments" : 3} } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] If the `number\_of\_fragments` value is set to `0` then no fragments are produced, instead the whole content of the field is returned, and of course it is highlighted. This can be very handy if short texts (like document title or address) need to be highlighted but no fragmentation is required. Note that `fragment\_size` is ignored in this case. [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : { "fields" : { "\_all" : {}, "blog.title" : {"number\_of\_fragments" : 0} } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] When using `fvh` one can use `fragment\_offset` parameter to control the margin to start highlighting from. In the case where there is no matching fragment to highlight, the default is to not return anything. Instead, we can return a snippet of text from the beginning of the field by setting `no\_match\_size` (default `0`) to the length of the text that you want returned. The actual length may be shorter or longer than specified as it tries to break on a word boundary. [source,js] -------------------------------------------------- GET /\_search { "query" : { "match": { "user": "kimchy" } }, "highlight" : { "fields" : { "comment" : { "fragment\_size" : 150, "number\_of\_fragments" : 3, "no\_match\_size": 150 } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] [float] [[highlight-postings-list]] === Highlight using the postings list Here is an example of setting the `comment` field in the index mapping to allow for highlighting using the postings: [source,js] -------------------------------------------------- PUT /example { "mappings": { "doc" : { "properties": { "comment" : { "type": "text", "index\_options" : "offsets" } } } } } -------------------------------------------------- // CONSOLE Here is an example of setting the `comment` field to allow for highlighting using the `term\_vectors` (this will cause the index to be bigger): [source,js] -------------------------------------------------- PUT /example { "mappings": { "doc" : { "properties": { "comment" : { "type": "text", "term\_vector" : "with\_positions\_offsets" } } } } } -------------------------------------------------- // CONSOLE [float] [[specify-fragmenter]] === Specify a fragmenter for the plain highlighter When using the `plain` highlighter, you can choose between the `simple` and `span` fragmenters: [source,js] -------------------------------------------------- GET twitter/\_search { "query" : { "match\_phrase": { "message": "number 1" } }, "highlight" : { "fields" : { "message" : { "type": "plain", "fragment\_size" : 15, "number\_of\_fragments" : 3, "fragmenter": "simple" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] Response: [source,js] -------------------------------------------------- { ... "hits": { "total": 1, "max\_score": 1.601195, "hits": [ { "\_index": "twitter", "\_type": "\_doc", "\_id": "1", "\_score": 1.601195, "\_source": { "user": "test", "message": "some message with the number 1", "date": "2009-11-15T14:12:12", "likes": 1 }, "highlight": { "message": [ " with the *number*", " *1*" ] } } ] } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,/] [source,js] -------------------------------------------------- GET twitter/\_search { "query" : { "match\_phrase": { "message": "number 1" } }, "highlight" : { "fields" : { "message" :
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/highlighting.asciidoc
6.2
elasticsearch-6-2
[ -0.054436095058918, 0.05496642738580704, 0.07464128732681274, 0.043446559458971024, 0.03360503539443016, 0.08151356875896454, 0.06287164241075516, 0.07868475466966629, 0.044608309864997864, -0.021396318450570107, -0.04849063605070114, 0.012198797427117825, 0.004425418097525835, 0.019877418875694275, 0.027199482545256615, 0.06963977217674255, -0.01896951161324978, 0.024900320917367935, -0.08535844087600708, -0.1102224588394165, 0.042537275701761246, -0.029601799324154854, -0.0031255183275789022, -0.014139251783490181, 0.013100090436637402, 0.04123291000723839, -0.057769645005464554, -0.04423009976744652, 0.042690254747867584, 0.03907293453812599, -0.025434527546167374, 0.02850991114974022, 0.04623715952038765, 0.12633651494979858, -0.07245970517396927, -0.013927837833762169, -0.1310318112373352, 0.01997736096382141, 0.04662378877401352, 0.051025234162807465, -0.01971135474741459, 0.05349301919341087, -0.07436223328113556, -0.05432920902967453, -0.004483429249376059, -0.07438445091247559, -0.02191569097340107, -0.004673837684094906, -0.02488618530333042, -0.0152679942548275, -0.07477674633264542, 0.002798252971842885, -0.0014118450926616788, 0.011064122430980206, 0.0007396119181066751, 0.04196372628211975, -0.032895687967538834, -0.0033577969297766685, 0.009719469584524632, -0.02264438197016716, -0.006802679039537907, -0.09163134545087814, 0.02260877564549446, -0.05370412766933441, 0.03635106235742569, -0.04093153402209282, 0.046464912593364716, -0.04432148113846779, -0.036993592977523804, 0.05566514655947685, 0.057392701506614685, 0.03588637337088585, 0.09798059612512589, 0.010375217534601688, -0.024761829525232315, 0.04796522110700607, -0.05239218473434448, -0.007008835673332214, -0.059534914791584015, 0.06261850893497467, -0.08736914396286011, -0.09329187870025635, 0.0016444061184301972, -0.0002014968340517953, 0.022816108539700508, -0.014165998436510563, -0.05153513699769974, -0.05230047181248665, -0.001640650094486773, 0.000050834602006943896, -0.09649618715047836, -0.05886933580040932, -0.004164467100054026, 0.047320280224084854, 0.02149834670126438, 0.08675123006105423, -0.050890546292066574, -0.08434559404850006, 0.038775570690631866, 0.011124785989522934, 0.005706691183149815, 0.04241407662630081, 0.07772240787744522, 0.01617644727230072, -0.03277304768562317, 0.016629990190267563, 0.008180155418813229, 0.06930704414844513, -0.03126458078622818, 0.008015748113393784, 0.0553230345249176, 0.08574514836072922, 0.04155100882053375, -0.002603075932711363, -0.022888058796525, 0.03197043389081955, 0.05783884599804878, -0.06039172410964966, 0.029250161722302437, 0.1010981947183609, 0.17960885167121887, 0.06475832313299179, -0.08870422840118408, 0.0067186858505010605, -0.010186407715082169, 0.11153143644332886, 0.09026511013507843, -2.65706851248649e-33, 0.09084305167198181, 0.036454591900110245, -0.04223800078034401, -0.00031871238024905324, -0.05481293052434921, 0.06875817477703094, -0.026612361893057823, 0.029393816366791725, -0.10385473072528839, -0.03488254174590111, -0.006268067751079798, 0.06876932084560394, 0.011309784837067127, -0.03261561319231987, -0.02092084288597107, -0.05550958588719368, 0.0447685569524765, 0.06250283867120743, -0.06657114624977112, 0.003345251316204667, -0.0069139027036726475, -0.03437568247318268, -0.03735468164086342, 0.008502214215695858, 0.0007661593263037503, -0.04072395712137222, -0.04510295391082764, -0.03625442460179329, -0.12591460347175598, -0.03893293812870979, -0.09293046593666077, -0.0027712201699614525, 0.03869607299566269, 0.024078521877527237, 0.1023537814617157, 0.04230489581823349, -0.07221201807260513, 0.04459478333592415, -0.015439765527844429, -0.032958030700683594, 0.01951780915260315, -0.0006807755562476814, 0.031005490571260452, -0.08287699520587921, -0.036016713827848434, -0.023084715008735657, -0.03724849969148636, 0.05644359067082405, -0.056934840977191925, 0.00021800545800942928, 0.03908054158091545, 0.10330969095230103, -0.009403744712471962, -0.01796429604291916, 0.06794490665197372, 0.006486224476248026, 0.05950358510017395, 0.02489735558629036, 0.06334987282752991, 0.043647147715091705, -0.031163539737462997, 0.014071604236960411, 0.03431294858455658, 0.03712700679898262, 0.031219420954585075, 0.07386459410190582, 0.007696561049669981, 0.02023271657526493, 0.004130635876208544, 0.037787534296512604, 0.028432471677660942, 0.07840737700462341, 0.03279133141040802, 0.010912646539509296, -0.051196902990341187, -0.10016318410634995, -0.01999191753566265, 0.009088641032576561, 0.0006697712815366685, -0.049977030605077744, -0.0565745085477829, -0.08966271579265594, -0.022257892414927483, 0.0183735154569149, -0.014737771824002266, 0.02890615165233612, 0.011299293488264084, -0.08372697979211807, -0.07138410210609436, -0.11173101514577866, -0.027193382382392883, 0.01948249712586403, -0.03573004901409149, -0.10876372456550598, -0.004527490586042404, 1.4805758179854691e-33, 0.11101019382476807, 0.012551967054605484, -0.004290872719138861, 0.02832661010324955, 0.02656182087957859, -0.02682497911155224, 0.010893738828599453, 0.05553659796714783, -0.04312518984079361, 0.028337525203824043, 0.014317031018435955, -0.026879990473389626, -0.02428060956299305, -0.09596415609121323, -0.05304570123553276, 0.07992876321077347, -0.012078932486474514, 0.011391987092792988, 0.056928012520074844, -0.01673201285302639, 0.009632722474634647, -0.011342491023242474, -0.029681863263249397, 0.04450809210538864, -0.045339468866586685, -0.028345884755253792, 0.08594357967376709, -0.044093143194913864, -0.04986328259110451, -0.028831031173467636, -0.005329856649041176, -0.018408728763461113, -0.07610710710287094, 0.006909614894539118, -0.04436878487467766, -0.030585527420043945, -0.036599356681108475, -0.021195895969867706, 0.06836959719657898, 0.13171106576919556, 0.006828149780631065, -0.019373701885342598, -0.032564107328653336, 0.05578042194247246, -0.041221365332603455, -0.04059573635458946, 0.0468878448009491, 0.056876249611377716, -0.028187941759824753, -0.10047078877687454, 0.010435285978019238, 0.009662216529250145, -0.044022124260663986, 0.024029424414038658, -0.040760286152362823, -0.07101300358772278, -0.07146033644676208, 0.015135012567043304, -0.01691734790802002, 0.011909040622413158, -0.030027037486433983, 0.06419681012630463, -0.03199869394302368, 0.025019658729434013, 0.05462558940052986, -0.06046205759048462, -0.04136154428124428, -0.0006428824854083359, -0.04343550652265549, -0.016681449487805367, 0.03207811340689659, -0.06903692334890366, 0.14929012954235077, 0.028433021157979965, 0.03658216446638107, -0.007403988856822252, -0.003554218914359808, 0.04085898771882057, 0.11276528239250183, -0.03117966279387474, -0.023848477751016617, -0.024159448221325874, 0.019515281543135643, 0.04406299442052841, -0.024631261825561523, 0.020937247201800346, -0.05341259762644768, 0.14637252688407898, -0.051995884627103806, -0.04060482978820801, -0.038904108107089996, -0.06795381754636765, 0.1106061190366745, -0.038073766976594925, 0.06868229061365128, -4.697429289990396e-8, -0.07569155842065811, 0.00011579288548091426, -0.14352671802043915, 0.014311925508081913, 0.035194866359233856, 0.022456683218479156, 0.017125805839896202, 0.07629981637001038, -0.03594149649143219, 0.03837701678276062, 0.05754656717181206, 0.08831208944320679, -0.0596163310110569, 0.0030692326836287975, -0.04723425954580307, -0.026586702093482018, -0.03811846300959587, -0.008524279110133648, -0.0460360161960125, 0.016674626618623734, -0.00915415957570076, 0.03755400329828262, -0.010872959159314632, 0.015092900022864342, 0.04613131657242775, 0.015488795004785061, -0.014489063993096352, 0.08975895494222641, 0.03688369691371918, 0.047875382006168365, -0.01864020898938179, 0.028934938833117485, -0.017498929053544998, -0.057502686977386475, 0.005477254744619131, -0.013626924715936184, -0.0025524653028696775, -0.02614152431488037, 0.015869447961449623, 0.05319495499134064, -0.038974396884441376, -0.06485615670681, -0.03257516026496887, -0.00539803970605135, -0.059677086770534515, -0.028107279911637306, -0.032853852957487106, -0.013850555755198002, 0.05630487948656082, -0.06233370304107666, 0.034794751554727554, -0.07673699408769608, -0.046253953129053116, -0.002995002083480358, -0.031974371522665024, -0.04299288988113403, 0.050208523869514465, 0.07773848623037338, -0.006896649021655321, -0.022893939167261124, 0.07401591539382935, 0.020996548235416412, -0.02135705016553402, -0.0016125713009387255 ]
-0.008506
"date": "2009-11-15T14:12:12", "likes": 1 }, "highlight": { "message": [ " with the *number*", " *1*" ] } } ] } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,/] [source,js] -------------------------------------------------- GET twitter/\_search { "query" : { "match\_phrase": { "message": "number 1" } }, "highlight" : { "fields" : { "message" : { "type": "plain", "fragment\_size" : 15, "number\_of\_fragments" : 3, "fragmenter": "span" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] Response: [source,js] -------------------------------------------------- { ... "hits": { "total": 1, "max\_score": 1.601195, "hits": [ { "\_index": "twitter", "\_type": "\_doc", "\_id": "1", "\_score": 1.601195, "\_source": { "user": "test", "message": "some message with the number 1", "date": "2009-11-15T14:12:12", "likes": 1 }, "highlight": { "message": [ " with the *number* *1*" ] } } ] } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,/] If the `number\_of\_fragments` option is set to `0`, `NullFragmenter` is used which does not fragment the text at all. This is useful for highlighting the entire contents of a document or field.**********
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/highlighting.asciidoc
6.2
elasticsearch-6-2
[ -0.03286231309175491, 0.1067783385515213, 0.05752364918589592, 0.07118148356676102, 0.08558810502290726, 0.033344920724630356, 0.05599541589617729, -0.02872788906097412, 0.10890819132328033, -0.0349196121096611, 0.009319493547081947, -0.037565309554338455, 0.02723088301718235, -0.0062959445640444756, 0.03804585710167885, 0.009824960492551327, -0.04313230514526367, -0.0634511187672615, -0.06415962427854538, -0.09515078365802765, 0.04917464032769203, 0.04421285167336464, -0.0011005067499354482, -0.039016079157590866, -0.06008037179708481, 0.007220788858830929, -0.06320298463106155, -0.036479197442531586, -0.003859431715682149, 0.07011603564023972, -0.027405845001339912, -0.013036641292273998, -0.04992707073688507, 0.06987150758504868, -0.016609249636530876, 0.02549395151436329, -0.06135415658354759, -0.030692612752318382, 0.013228900730609894, 0.0014307828387245536, -0.0027574661653488874, -0.10837864130735397, -0.04033837094902992, -0.03608550503849983, 0.03970180079340935, -0.05551294609904289, -0.004432855173945427, 0.023399440571665764, -0.0819135308265686, -0.022337017580866814, -0.09395009279251099, -0.07948942482471466, -0.009033415466547012, 0.0027481992729008198, 0.06157078966498375, 0.04330921918153763, -0.07075455784797668, 0.010893821716308594, 0.026050962507724762, -0.10497767478227615, 0.06126886233687401, -0.12381967902183533, 0.0175445768982172, -0.04619167372584343, -0.029153281822800636, -0.06422457098960876, 0.023597540333867073, -0.005666354671120644, 0.04417572543025017, 0.015476001426577568, 0.046472180634737015, 0.014711345545947552, -0.009097915142774582, 0.01683134026825428, -0.0003287872241344303, 0.10526978224515915, -0.017929740250110626, -0.0477311909198761, -0.04252368211746216, 0.02527369000017643, -0.06655687093734741, -0.12147483974695206, -0.0035783748608082533, 0.056035757064819336, 0.008891366422176361, -0.0026371723506599665, -0.06266208738088608, -0.045944929122924805, -0.005833765491843224, -0.08474909514188766, -0.03806564584374428, -0.021983301267027855, 0.022655418142676353, 0.012114739045500755, -0.004555061925202608, 0.056783199310302734, -0.086310975253582, -0.025151671841740608, 0.047196097671985626, 0.0568586066365242, 0.012265858240425587, 0.03156150132417679, 0.0024392292834818363, -0.0682440996170044, -0.03643098846077919, 0.046714406460523605, -0.029815206304192543, 0.06139465048909187, -0.008642720989882946, 0.017021985724568367, -0.01733950339257717, 0.055996038019657135, 0.011756866239011288, 0.0015539041487500072, 0.02934337593615055, 0.01733490824699402, 0.0524921678006649, -0.02195802517235279, 0.04625963419675827, 0.06265875697135925, 0.1568862646818161, 0.031226424500346184, -0.06937593966722488, -0.04856147617101669, 0.006401119288057089, 0.0497392937541008, 0.05953598394989967, 6.568764025412567e-35, 0.08649265766143799, 0.06277969479560852, -0.029839731752872467, -0.04344809055328369, 0.02218714915215969, 0.023466961458325386, -0.01089537888765335, 0.059523094445466995, -0.05979307368397713, 0.017088888213038445, -0.08480287343263626, 0.0034409526269882917, -0.015931228175759315, -0.09306419640779495, -0.010405697859823704, -0.0347217433154583, -0.0019986950792372227, 0.025984959676861763, 0.028240660205483437, 0.05047425627708435, 0.009868782944977283, -0.021657997742295265, -0.03081894852221012, 0.02885831706225872, 0.00228884257376194, -0.011880074627697468, 0.017477938905358315, -0.07849788665771484, -0.08361352235078812, -0.030296077951788902, -0.05421280488371849, -0.006146229803562164, -0.013922975398600101, -0.0022805691696703434, 0.10539219528436661, 0.01864505000412464, -0.022737963125109673, 0.03676697984337807, -0.09971784800291061, -0.07491081207990646, -0.025469232350587845, 0.012717622332274914, -0.004516030661761761, -0.09842454642057419, -0.04871290177106857, -0.0033566956408321857, -0.08226411789655685, -0.018677620217204094, 0.012121866457164288, -0.02886027842760086, -0.017985528334975243, 0.08115991950035095, -0.006305461283773184, -0.053672682493925095, 0.05895563215017319, 0.02509048394858837, 0.04226752370595932, 0.07965868711471558, 0.0639871209859848, -0.012502416968345642, 0.05175614729523659, -0.0160216037184, 0.07647460699081421, -0.01809203438460827, 0.019692586734890938, -0.0043624090030789375, 0.0024054001551121473, 0.03935371711850166, -0.030829964205622673, 0.041603244841098785, 0.03866682946681976, 0.08779626339673996, 0.023618383333086967, -0.00021571884281001985, 0.006492564454674721, -0.13119804859161377, -0.017850887030363083, 0.0062548513524234295, 0.02814726158976555, 0.0006041499436832964, 0.034213121980428696, -0.1553323119878769, -0.033590447157621384, 0.02493659034371376, -0.04260009527206421, 0.11067570745944977, -0.004229703452438116, -0.11625190824270248, -0.046882279217243195, -0.06555236876010895, -0.06061406061053276, 0.03615749254822731, -0.0908701941370964, -0.11099226027727127, -0.08354263007640839, -2.4586307397302874e-33, 0.0532401017844677, -0.048558495938777924, -0.018211891874670982, 0.02659614197909832, 0.052807893604040146, -0.03788087144494057, 0.03937899321317673, 0.03309321030974388, 0.019469542428851128, 0.03558889031410217, 0.08616289496421814, -0.08561328798532486, -0.01570553332567215, -0.06980355083942413, -0.0431518629193306, 0.07284989207983017, -0.015492582693696022, -0.08529146015644073, -0.012476745992898941, -0.0014971810160204768, -0.005061291623860598, 0.05419912934303284, -0.07428029179573059, 0.046733152121305466, -0.10586726665496826, -0.04501277953386307, 0.09453780204057693, -0.025115828961133957, -0.08364146947860718, 0.02158469334244728, -0.00885913334786892, -0.036671917885541916, -0.05391348525881767, 0.02680400386452675, -0.054669275879859924, -0.012130003422498703, 0.006963128689676523, 0.03210122510790825, 0.02443038299679756, 0.09680546075105667, 0.08067939430475235, 0.028649823740124702, -0.09573930501937866, 0.022730302065610886, -0.06336034834384918, -0.01587347500026226, 0.020954100415110588, 0.04348906874656677, -0.014100889675319195, -0.025563616305589676, 0.0404173918068409, 0.005968721117824316, -0.01693195104598999, 0.07487516850233078, 0.010318338871002197, -0.04993392899632454, 0.02210032194852829, -0.042179498821496964, -0.09940603375434875, 0.008656231686472893, -0.051441043615341187, 0.051568564027547836, -0.02896794304251671, 0.03893839195370674, 0.08953088521957397, -0.07692090421915054, -0.039416417479515076, -0.022841863334178925, -0.021697068586945534, -0.049750667065382004, 0.035352110862731934, -0.03188278526067734, 0.01975109428167343, 0.06087228283286095, 0.08605340123176575, -0.030837878584861755, 0.006242339499294758, 0.028393622487783432, 0.04745994508266449, 0.03371289372444153, -0.017584171146154404, -0.005242638755589724, 0.04760206490755081, 0.1031561866402626, -0.015447055920958519, -0.030302755534648895, -0.050066761672496796, 0.14072416722774506, -0.050733886659145355, -0.0480852872133255, 0.03334370255470276, -0.008125430904328823, 0.004269714467227459, 0.005186236463487148, 0.04883361980319023, -5.17892146945087e-8, -0.09488414973020554, -0.017036059871315956, -0.059729259461164474, 0.040361180901527405, 0.004041678737848997, 0.038077279925346375, 0.08102861791849136, 0.030599452555179596, -0.020508555695414543, -0.03459183871746063, -0.005202510394155979, 0.06521349400281906, -0.041929785162210464, -0.01876971125602722, -0.04882283881306648, -0.002208100399002433, -0.07037831097841263, 0.008195611648261547, -0.031385235488414764, 0.004443948622792959, 0.013249685056507587, 0.0519738644361496, 0.01686512865126133, -0.04546738415956497, 0.0615682527422905, 0.07030600309371948, -0.0442877933382988, 0.048020295798778534, -0.003444215515628457, -0.0022435993887484074, -0.048571258783340454, -0.03044157288968563, -0.0017670723609626293, -0.07768991589546204, -0.0022089837584644556, 0.060904908925294876, -0.007901668548583984, -0.01381194032728672, -0.03507198765873909, 0.052549201995134354, 0.054685380309820175, 0.011876859702169895, -0.05760673061013222, 0.021985303610563278, 0.011378279887139797, -0.059263478964567184, -0.021258825436234474, -0.03688768669962883, 0.057877495884895325, -0.0006679625948891044, 0.03668113425374031, -0.057914938777685165, 0.017974574118852615, 0.0033658116590231657, -0.04501732811331749, -0.04074766859412193, 0.0853128507733345, 0.02233593910932541, 0.0012034594547003508, 0.02721930481493473, 0.16893735527992249, -0.02911190688610077, 0.010659477673470974, 0.020225368440151215 ]
0.075912
[[search-request-collapse]] === Field Collapsing Allows to collapse search results based on field values. The collapsing is done by selecting only the top sorted document per collapse key. For instance the query below retrieves the best tweet for each user and sorts them by number of likes. [source,js] -------------------------------------------------- GET /twitter/\_search { "query": { "match": { "message": "elasticsearch" } }, "collapse" : { "field" : "user" <1> }, "sort": ["likes"], <2> "from": 10 <3> } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] <1> collapse the result set using the "user" field <2> sort the top docs by number of likes <3> define the offset of the first collapsed result WARNING: The total number of hits in the response indicates the number of matching documents without collapsing. The total number of distinct group is unknown. The field used for collapsing must be a single valued <> or <> field with <> activated NOTE: The collapsing is applied to the top hits only and does not affect aggregations. ==== Expand collapse results It is also possible to expand each collapsed top hits with the `inner\_hits` option. [source,js] -------------------------------------------------- GET /twitter/\_search { "query": { "match": { "message": "elasticsearch" } }, "collapse" : { "field" : "user", <1> "inner\_hits": { "name": "last\_tweets", <2> "size": 5, <3> "sort": [{ "date": "asc" }] <4> }, "max\_concurrent\_group\_searches": 4 <5> }, "sort": ["likes"] } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] <1> collapse the result set using the "user" field <2> the name used for the inner hit section in the response <3> the number of inner\_hits to retrieve per collapse key <4> how to sort the document inside each group <5> the number of concurrent requests allowed to retrieve the inner\_hits` per group See <> for the complete list of supported options and the format of the response. It is also possible to request multiple `inner\_hits` for each collapsed hit. This can be useful when you want to get multiple representations of the collapsed hits. [source,js] -------------------------------------------------- GET /twitter/\_search { "query": { "match": { "message": "elasticsearch" } }, "collapse" : { "field" : "user", <1> "inner\_hits": [ { "name": "most\_liked", <2> "size": 3, "sort": ["likes"] }, { "name": "most\_recent", <3> "size": 3, "sort": [{ "date": "asc" }] } ] }, "sort": ["likes"] } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] <1> collapse the result set using the "user" field <2> return the three most liked tweets for the user <3> return the three most recent tweets for the user The expansion of the group is done by sending an additional query for each `inner\_hit` request for each collapsed hit returned in the response. This can significantly slow things down if you have too many groups and/or `inner\_hit` requests. The `max\_concurrent\_group\_searches` request parameter can be used to control the maximum number of concurrent searches allowed in this phase. The default is based on the number of data nodes and the default search thread pool size. WARNING: `collapse` cannot be used in conjunction with <>, <> or <>.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/collapse.asciidoc
6.2
elasticsearch-6-2
[ -0.026751553639769554, 0.13137103617191315, 0.04163626208901405, 0.0884111225605011, 0.027427682653069496, 0.02519383653998375, 0.016673652455210686, 0.07979908585548401, 0.08193498849868774, -0.019159439951181412, -0.027054615318775177, 0.08412276953458786, 0.04367781803011894, -0.03509504348039627, -0.021451152861118317, 0.0375685952603817, -0.10934644937515259, -0.024363912642002106, -0.03255385905504227, -0.15964794158935547, 0.016285501420497894, 0.044021524488925934, -0.009253925643861294, -0.029464371502399445, -0.022936709225177765, 0.037080179899930954, -0.1261015683412552, -0.04897297918796539, -0.002543308073654771, 0.05650238320231438, -0.0010536463232710958, -0.0682128369808197, -0.00688997283577919, 0.058360882103443146, -0.06137120723724365, -0.01876375824213028, -0.10991676151752472, -0.021968169137835503, 0.02106553129851818, 0.030981604009866714, -0.038118258118629456, -0.009141512215137482, -0.03912785276770592, -0.10372263938188553, -0.03913980349898338, -0.02546614408493042, -0.031126778572797775, 0.008767526596784592, -0.04718916490674019, 0.03678992763161659, -0.04268036037683487, -0.014048945158720016, 0.013326638378202915, 0.030319320037961006, 0.03542529046535492, 0.029153717681765556, -0.10381144285202026, -0.026580726727843285, 0.005775339435786009, 0.006777635775506496, 0.015619492158293724, -0.08159802854061127, 0.00813586637377739, -0.0034785529132932425, 0.09837066382169724, -0.04196871072053909, -0.002396496245637536, 0.017364921048283577, -0.01423524972051382, 0.029456138610839844, 0.12153317779302597, 0.014208529144525528, 0.03226535767316818, -0.012786838226020336, 0.0009168885881081223, 0.0016151206800714135, -0.03270479664206505, -0.05792081728577614, -0.02343090809881687, 0.13525989651679993, -0.05993427708745003, -0.10464876890182495, -0.09319507330656052, 0.0029647755436599255, -0.035695552825927734, -0.039109326899051666, 0.018360789865255356, -0.08310920000076294, -0.024969948455691338, -0.016643788665533066, -0.059170883148908615, -0.0004936566110700369, 0.022348232567310333, 0.06411060690879822, 0.011164053343236446, 0.04196569696068764, -0.03161320835351944, -0.04369424283504486, 0.0024249597918242216, 0.03386653587222099, -0.040214844048023224, -0.00986979715526104, 0.07052568346261978, -0.04573964700102806, 0.00830140057951212, 0.01732468046247959, -0.02073158510029316, 0.029595909640192986, 0.02558845654129982, 0.007852507755160332, -0.02599952183663845, 0.041774436831474304, 0.013889995403587818, 0.039370208978652954, -0.023960324004292488, 0.06964979320764542, 0.08069457858800888, 0.018322685733437538, 0.04752172902226448, 0.05996794253587723, 0.11623107641935349, 0.042987316846847534, -0.031088922172784805, -0.055160749703645706, 0.0561327300965786, 0.12110132724046707, 0.058805350214242935, 1.0966957298633886e-33, 0.09036269038915634, 0.014973318204283714, -0.05093635991215706, -0.00487503269687295, 0.03964616730809212, 0.03246118873357773, 0.025087157264351845, 0.022747550159692764, -0.13083046674728394, -0.005113782361149788, -0.028001662343740463, 0.09300943464040756, -0.011343792080879211, -0.02239135466516018, -0.026383187621831894, -0.06755112111568451, 0.057112615555524826, 0.04588676616549492, -0.050414375960826874, -0.05046486854553223, 0.012048929929733276, 0.029731376096606255, -0.016961131244897842, -0.009887016378343105, 0.002367208478972316, -0.0636904314160347, -0.016048720106482506, -0.03434664011001587, -0.09019070863723755, -0.026722939684987068, -0.07623283565044403, 0.0712234228849411, -0.07561220228672028, -0.0416242778301239, 0.09909437596797943, 0.031781937927007675, -0.03348293900489807, 0.09652195125818253, -0.0327005609869957, -0.005682504735887051, 0.020006876438856125, 0.05517307668924332, -0.0035611018538475037, -0.1530647575855255, -0.04442400857806206, 0.007615623530000448, 0.003165976144373417, 0.030331768095493317, 0.011070948094129562, -0.028779208660125732, -0.018938204273581505, 0.02289101481437683, -0.0008430220186710358, -0.009978116489946842, 0.10771388560533524, -0.03186863660812378, 0.02199620194733143, 0.06918569654226303, 0.04601271077990532, 0.03480648249387741, 0.03561708703637123, -0.04814213141798973, 0.07491821050643921, -0.012962907552719116, 0.05066623538732529, -0.04125165566802025, 0.008750023320317268, 0.009357871487736702, 0.006651713512837887, 0.022197362035512924, 0.0395517535507679, 0.08672461658716202, 0.03107992187142372, -0.038061995059251785, 0.01746399700641632, -0.025478249415755272, -0.010924676433205605, -0.02709040604531765, 0.013182710856199265, -0.03317343071103096, 0.007866683416068554, -0.10165739804506302, 0.008947335183620453, 0.0028214999474585056, -0.013178634457290173, 0.0799553170800209, 0.0006150601548142731, -0.037983667105436325, -0.04934435337781906, -0.05198332667350769, -0.10113702714443207, 0.017372356727719307, 0.02139790914952755, -0.10335473716259003, -0.04437113553285599, -8.55849243336387e-34, -0.0017449414590373635, -0.024547051638364792, 0.0407526008784771, 0.011951875872910023, 0.02973860315978527, -0.02742828242480755, 0.03070077672600746, -0.0007966685225255787, -0.039069849997758865, 0.0556689091026783, 0.04895820841193199, -0.0401129350066185, 0.027759002521634102, -0.09229543805122375, -0.010386376641690731, 0.043215543031692505, 0.03518247976899147, -0.0891757607460022, -0.02760632149875164, -0.04106729477643967, -0.02918401174247265, -0.011460634879767895, -0.07751193642616272, 0.054917216300964355, -0.05301665887236595, -0.0310564823448658, 0.08560588955879211, 0.02301785536110401, -0.0031074299477040768, -0.034416791051626205, 0.01203150860965252, -0.032554421573877335, -0.039685267955064774, 0.09417863190174103, -0.06733256578445435, 0.029335908591747284, -0.05594649165868759, 0.03338219225406647, 0.02923862263560295, 0.1372123807668686, 0.03736809641122818, 0.03223292529582977, -0.055439338088035583, -0.0020081871189177036, -0.023605121299624443, 0.023092325776815414, 0.01186328288167715, 0.02704886719584465, -0.05685969814658165, -0.08771008998155594, 0.05379374325275421, 0.05021033063530922, -0.02975776419043541, 0.02957150712609291, -0.05336547642946243, -0.03853462263941765, 0.025546064600348473, -0.007780013605952263, -0.05885978043079376, 0.01698809489607811, 0.011841178871691227, 0.016612637788057327, 0.01928158849477768, 0.055475447326898575, 0.011068446561694145, -0.07710152864456177, -0.06354968994855881, 0.030635925009846687, -0.09214852005243301, -0.042509131133556366, 0.017708275467157364, -0.07622267305850983, 0.13281568884849548, -0.019527755677700043, 0.11871037632226944, -0.0032158393878489733, 0.014495118521153927, 0.015617886558175087, 0.08391709625720978, -0.041561637073755264, 0.007926440797746181, 0.016262780874967575, 0.016728369519114494, 0.019686615094542503, -0.022675834596157074, 0.04194863885641098, -0.06998669356107712, 0.10731672495603561, -0.017442205920815468, 0.0653795450925827, 0.023004623129963875, -0.05193743854761124, 0.04947880282998085, -0.015141718089580536, -0.006249899975955486, -4.738133085879781e-8, -0.08260368555784225, -0.08872364461421967, -0.07504915446043015, 0.08403615653514862, -0.005595862865447998, 0.03136279061436653, 0.09664573520421982, 0.08533655852079391, -0.021068140864372253, -0.04187285155057907, -0.013576586730778217, 0.08054075390100479, -0.04196973890066147, 0.007227887865155935, -0.010140836238861084, -0.011361620388925076, -0.06681474298238754, -0.033572547137737274, -0.009298808872699738, 0.02733810618519783, 0.002474767155945301, 0.010629186406731606, 0.025868425145745277, 0.021423261612653732, 0.09469076246023178, 0.060156263411045074, -0.04185636341571808, 0.047354456037282944, 0.030777374282479286, 0.031236402690410614, -0.0368078351020813, 0.015467114746570587, -0.010015527717769146, -0.055686332285404205, 0.02185691148042679, 0.04190203920006752, -0.019507136195898056, -0.02632918395102024, -0.09022015333175659, 0.003114106133580208, 0.05120062828063965, 0.01873166300356388, -0.01594970002770424, 0.026280498132109642, -0.01343740988522768, 0.006748445797711611, 0.023331936448812485, -0.022748464718461037, 0.06570146977901459, -0.0895470678806305, -0.027817582711577415, -0.08661017566919327, 0.023464910686016083, -0.015100023709237576, -0.03175176680088043, -0.035566434264183044, 0.05767766013741493, 0.061311911791563034, 0.0011784072266891599, -0.036901939660310745, 0.10490990430116653, -0.035593580454587936, -0.02302907407283783, 0.06521745026111603 ]
0.016921
[[search-request-search-type]] === Search Type There are different execution paths that can be done when executing a distributed search. The distributed search operation needs to be scattered to all the relevant shards and then all the results are gathered back. When doing scatter/gather type execution, there are several ways to do that, specifically with search engines. One of the questions when executing a distributed search is how much results to retrieve from each shard. For example, if we have 10 shards, the 1st shard might hold the most relevant results from 0 till 10, with other shards results ranking below it. For this reason, when executing a request, we will need to get results from 0 till 10 from all shards, sort them, and then return the results if we want to ensure correct results. Another question, which relates to the search engine, is the fact that each shard stands on its own. When a query is executed on a specific shard, it does not take into account term frequencies and other search engine information from the other shards. If we want to support accurate ranking, we would need to first gather the term frequencies from all shards to calculate global term frequencies, then execute the query on each shard using these global frequencies. Also, because of the need to sort the results, getting back a large document set, or even scrolling it, while maintaining the correct sorting behavior can be a very expensive operation. For large result set scrolling, it is best to sort by `\_doc` if the order in which documents are returned is not important. Elasticsearch is very flexible and allows to control the type of search to execute on a \*per search request\* basis. The type can be configured by setting the \*search\_type\* parameter in the query string. The types are: [[query-then-fetch]] ==== Query Then Fetch Parameter value: \*query\_then\_fetch\*. The request is processed in two phases. In the first phase, the query is forwarded to \*all involved shards\*. Each shard executes the search and generates a sorted list of results, local to that shard. Each shard returns \*just enough information\* to the coordinating node to allow it merge and re-sort the shard level results into a globally sorted set of results, of maximum length `size`. During the second phase, the coordinating node requests the document content (and highlighted snippets, if any) from \*only the relevant shards\*. NOTE: This is the default setting, if you do not specify a `search\_type` in your request. [[dfs-query-then-fetch]] ==== Dfs, Query Then Fetch Parameter value: \*dfs\_query\_then\_fetch\*. Same as "Query Then Fetch", except for an initial scatter phase which goes and computes the distributed term frequencies for more accurate scoring.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/search-type.asciidoc
6.2
elasticsearch-6-2
[ 0.05873769894242287, -0.04744827374815941, 0.0464317761361599, 0.026443086564540863, -0.014400322921574116, -0.028115572407841682, -0.07171177119016647, -0.007179548963904381, 0.0669327825307846, -0.0094442218542099, -0.03618549555540085, 0.03956836089491844, 0.06344927102327347, -0.005247590132057667, -0.06788158416748047, -0.060844726860523224, 0.06545531749725342, -0.04131806641817093, -0.057163871824741364, -0.01846468262374401, 0.04647346958518028, -0.014436913654208183, 0.047477200627326965, -0.0392744354903698, -0.04680297523736954, -0.08539146184921265, -0.11793480068445206, -0.0823945626616478, 0.04467811435461044, 0.02425079233944416, 0.05027080327272415, 0.05460507050156593, -0.03315979614853859, 0.08434811979532242, -0.0935242548584938, -0.00483948877081275, -0.050638943910598755, -0.01809685304760933, -0.02949157916009426, 0.019681092351675034, -0.013660761527717113, -0.02123642899096012, -0.0453791618347168, -0.0501323901116848, -0.027782795950770378, -0.01907467097043991, -0.04708850011229515, -0.012243895791471004, -0.014378284104168415, -0.0060013821348547935, -0.08418101072311401, -0.0460793562233448, -0.022391151636838913, 0.06444375216960907, -0.013516944833099842, 0.011527236551046371, -0.04104297608137131, -0.026183411478996277, 0.008679192513227463, -0.08313900977373123, 0.02891506999731064, -0.12161390483379364, -0.027437154203653336, -0.05261355638504028, 0.1103535071015358, -0.08638298511505127, 0.1771056056022644, -0.018331415951251984, 0.057100944221019745, -0.04668048024177551, 0.05180095508694649, 0.03202292323112488, -0.04822530597448349, 0.02184130996465683, -0.00033274927409365773, 0.05936439335346222, -0.008716743439435959, -0.024714304134249687, -0.036765601485967636, 0.035384729504585266, -0.04125245660543442, 0.014562725089490414, 0.0012277759378775954, 0.020038316026329994, 0.0456266850233078, -0.061489757150411606, -0.01746625266969204, -0.04151998832821846, 0.057978518307209015, -0.0010905703529715538, 0.03313261270523071, 0.019082367420196533, -0.013301946222782135, -0.067057304084301, 0.06624948978424072, -0.005763879511505365, 0.05633964389562607, 0.07217682898044586, 0.06996526569128036, 0.010343781672418118, 0.02242347225546837, -0.00724249891936779, 0.019882922992110252, -0.10206533968448639, 0.007268700283020735, 0.016820792108774185, -0.08543646335601807, 0.08219504356384277, -0.008797958493232727, -0.02078024297952652, -0.007669713348150253, -0.009999181143939495, -0.0033984598703682423, 0.029927102848887444, -0.023055432364344597, 0.08478882908821106, 0.014521569944918156, -0.021348627284169197, -0.02661091648042202, -0.03259139880537987, 0.017037954181432724, 0.00671042874455452, 0.08221960812807083, -0.0188288576900959, -0.003453634912148118, 0.07224013656377792, -0.05632784590125084, 6.025134415725856e-33, 0.05013970285654068, -0.018899599090218544, 0.06998300552368164, -0.03587930649518967, -0.03206366300582886, 0.010688981041312218, -0.026702018454670906, 0.06908904016017914, -0.08291230350732803, -0.0008253504638560116, -0.10040471702814102, 0.1309606283903122, -0.006795205175876617, -0.04215852543711662, 0.0521552748978138, -0.04910969361662865, 0.10313692688941956, 0.07883092761039734, -0.061297934502363205, 0.01890341378748417, 0.08448346704244614, -0.030420469120144844, 0.01713442988693714, -0.03003116324543953, -0.0066787851974368095, -0.03210480511188507, -0.06061592325568199, -0.03384599834680557, -0.054314807057380676, 0.023181939497590065, -0.045078977942466736, -0.012029947713017464, 0.0008074634824879467, 0.014141124673187733, 0.04018993303179741, 0.06486987322568893, -0.06286250054836273, 0.023516777902841568, 0.007981917820870876, -0.10687293857336044, 0.024896860122680664, -0.0052682808600366116, 0.06491003185510635, -0.0699291080236435, -0.05873369425535202, 0.015970569103956223, -0.10716700553894043, 0.041650060564279556, -0.018054340034723282, 0.01336047612130642, 0.014951976016163826, 0.023632578551769257, 0.032310958951711655, 0.06150488927960396, 0.10256130248308182, 0.07689200341701508, 0.07693475484848022, 0.0015948351938277483, -0.05671169236302376, 0.07408697158098221, 0.02169954404234886, -0.08353397995233536, 0.008059689775109291, 0.04602639749646187, 0.007577446289360523, -0.05516623333096504, 0.018442895263433456, 0.06664109975099564, 0.08822201937437057, 0.12004593014717102, 0.039259783923625946, 0.16082310676574707, 0.020156295970082283, 0.032032787799835205, 0.058392029255628586, -0.0671808272600174, 0.0015930563677102327, -0.04139541834592819, -0.03495531901717186, -0.010642620734870434, -0.030214514583349228, 0.014631325379014015, -0.05445742607116699, -0.0027466434985399246, -0.026890750974416733, 0.05926456302404404, 0.04165785759687424, -0.022010140120983124, -0.04626930132508278, -0.07177596539258957, -0.04724232107400894, -0.015685129910707474, -0.002956824144348502, -0.04503289610147476, -0.052094925194978714, -5.466008691047312e-33, -0.022864848375320435, -0.04386410862207413, -0.012287499383091927, 0.048729926347732544, 0.003537422511726618, 0.006681293249130249, 0.004119460936635733, -0.10885756462812424, -0.04869477450847626, -0.016101256012916565, -0.023478519171476364, 0.010951876640319824, 0.014970660209655762, -0.017215294763445854, -0.03326476737856865, 0.06752913445234299, 0.06133643165230751, -0.11054563522338867, 0.037105903029441833, 0.032738953828811646, -0.045607201755046844, -0.010613735765218735, -0.0752643570303917, 0.02265464887022972, -0.02427603490650654, 0.01877150870859623, 0.02687852643430233, -0.01762707531452179, -0.012536541558802128, 0.04419407621026039, 0.006761362310498953, -0.05472118407487869, -0.04903996363282204, -0.06715461611747742, -0.09907323122024536, -0.02804732136428356, -0.012019800022244453, -0.0046381824649870396, 0.03336789086461067, 0.11885529011487961, -0.00929212849587202, -0.0019605152774602175, -0.057953476905822754, -0.02363996021449566, 0.006148913409560919, -0.007997381500899792, -0.06683991849422455, 0.11365717649459839, 0.03770465776324272, -0.06100982427597046, 0.06306814402341843, 0.04956700652837753, 0.002693868475034833, 0.08277545869350433, -0.0014886015560477972, 0.06089633330702782, -0.0689195767045021, 0.0982750877737999, -0.12814894318580627, 0.04626959189772606, -0.012957178056240082, 0.0009463223395869136, -0.049437083303928375, 0.0534801222383976, -0.05560529604554176, 0.00807957537472248, -0.025053637102246284, -0.09102915972471237, -0.07874200493097305, -0.04812311753630638, -0.05948163568973541, -0.041024163365364075, 0.025190278887748718, 0.0014077845262363553, 0.016904763877391815, -0.023004844784736633, 0.0038925609551370144, 0.030835645273327827, 0.05177512764930725, 0.06817737966775894, -0.06583990156650543, 0.07330308854579926, 0.037079427391290665, 0.06377071142196655, 0.03856677934527397, -0.10112027823925018, 0.048439253121614456, 0.043571390211582184, -0.012293674051761627, -0.027283400297164917, 0.04846227169036865, -0.04772421717643738, -0.03383288532495499, -0.02806852199137211, 0.013056482188403606, -5.874483477441572e-8, -0.004182901699095964, 0.0250006802380085, -0.03787849098443985, 0.06418122351169586, 0.03752192482352257, 0.0501507930457592, 0.005979948211461306, 0.006701888516545296, -0.057975299656391144, 0.005210330244153738, -0.03201518580317497, -0.037037260830402374, -0.03482569009065628, 0.0183075163513422, 0.10918039083480835, 0.025820834562182426, -0.01920904964208603, -0.031635772436857224, -0.08164314180612564, -0.07090243697166443, -0.017517685890197754, -0.0023995903320610523, 0.021987276151776314, -0.004014285746961832, 0.00012487520871218294, 0.03786151856184006, 0.043772485107183456, 0.027386058121919632, 0.009662366472184658, 0.058382548391819, -0.025805208832025528, -0.009197239764034748, -0.033856380730867386, -0.02944524958729744, 0.039180587977170944, 0.10005717724561691, -0.09203533083200455, 0.015306769870221615, 0.03756527975201607, 0.05997958779335022, 0.01118823979049921, 0.056566305458545685, 0.01708628237247467, 0.03858540207147598, 0.06554986536502838, 0.03328812122344971, 0.020225107669830322, 0.10541801899671555, 0.021267147734761238, 0.04279620945453644, -0.03091409057378769, -0.0011299260659143329, 0.012570425868034363, 0.03842955455183983, 0.030193228274583817, 0.024172833189368248, 0.0033357671927660704, -0.06557013839483261, 0.07161200791597366, 0.010674439370632172, 0.1090216413140297, -0.07635138183832169, -0.05485815927386284, -0.02765875682234764 ]
0.037221
[[search-request-search-after]] === Search After Pagination of results can be done by using the `from` and `size` but the cost becomes prohibitive when the deep pagination is reached. The `index.max\_result\_window` which defaults to 10,000 is a safeguard, search requests take heap memory and time proportional to `from + size`. The <> api is recommended for efficient deep scrolling but scroll contexts are costly and it is not recommended to use it for real time user requests. The `search\_after` parameter circumvents this problem by providing a live cursor. The idea is to use the results from the previous page to help the retrieval of the next page. Suppose that the query to retrieve the first page looks like this: [source,js] -------------------------------------------------- GET twitter/\_search { "size": 10, "query": { "match" : { "title" : "elasticsearch" } }, "sort": [ {"date": "asc"}, {"\_id": "desc"} ] } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] NOTE: A field with one unique value per document should be used as the tiebreaker of the sort specification. Otherwise the sort order for documents that have the same sort values would be undefined. The recommended way is to use the field `\_id` which is certain to contain one unique value for each document. The result from the above request includes an array of `sort values` for each document. These `sort values` can be used in conjunction with the `search\_after` parameter to start returning results "after" any document in the result list. For instance we can use the `sort values` of the last document and pass it to `search\_after` to retrieve the next page of results: [source,js] -------------------------------------------------- GET twitter/\_search { "size": 10, "query": { "match" : { "title" : "elasticsearch" } }, "search\_after": [1463538857, "654323"], "sort": [ {"date": "asc"}, {"\_id": "desc"} ] } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] NOTE: The parameter `from` must be set to 0 (or -1) when `search\_after` is used. `search\_after` is not a solution to jump freely to a random page but rather to scroll many queries in parallel. It is very similar to the `scroll` API but unlike it, the `search\_after` parameter is stateless, it is always resolved against the latest version of the searcher. For this reason the sort order may change during a walk depending on the updates and deletes of your index.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/search-after.asciidoc
6.2
elasticsearch-6-2
[ -0.14453125, 0.042627036571502686, 0.01708149164915085, 0.005906390957534313, -0.01688872091472149, 0.031288594007492065, -0.02062455378472805, -0.03760908171534538, 0.03950289636850357, -0.02408253774046898, -0.002736907685175538, 0.08107688277959824, 0.04207553341984749, -0.06257732212543488, -0.023655561730265617, -0.03492274135351181, 0.014687541872262955, 0.09194948524236679, -0.05901114270091057, -0.07625149935483932, 0.03454994782805443, 0.06249861419200897, 0.020350825041532516, -0.0022733970545232296, -0.04786968231201172, -0.05154285952448845, -0.08777458965778351, -0.14942559599876404, 0.08434976637363434, 0.03592456877231598, -0.010795354843139648, 0.025542058050632477, -0.08986721932888031, 0.04546481743454933, -0.04925644397735596, 0.003931483253836632, -0.1756715625524521, -0.010207941755652428, 0.02705654874444008, -0.02544519118964672, 0.05772428587079048, 0.048965368419885635, -0.05899487063288689, 0.0045698960311710835, -0.019592173397541046, -0.009877997450530529, -0.040578506886959076, 0.02668035216629505, -0.005262439604848623, 0.0023777850437909365, -0.09308725595474243, -0.023647841066122055, 0.03441562503576279, 0.015280326828360558, 0.03750718757510185, 0.014767046086490154, 0.007168136537075043, -0.023572416976094246, -0.02548031136393547, 0.04697085916996002, 0.028907138854265213, -0.06828192621469498, 0.015678908675909042, -0.02644023858010769, 0.0001804032362997532, -0.04683736711740494, 0.04392622783780098, 0.02497716248035431, 0.06180167570710182, 0.10882994532585144, 0.015046420507133007, 0.027304159477353096, 0.015445444732904434, 0.0006315218633972108, 0.009450672194361687, -0.03133629634976387, -0.045915309339761734, -0.06880739331245422, -0.06521435081958771, 0.05282106623053551, 0.004401044920086861, -0.090394526720047, 0.011340527795255184, 0.03152204677462578, 0.05339386314153671, -0.06479118019342422, -0.030799919739365578, -0.06083104386925697, 0.033969759941101074, -0.03687169402837753, -0.030154865235090256, -0.03305143117904663, -0.07801999151706696, 0.02967429906129837, -0.01234324648976326, 0.05179504677653313, -0.007868008688092232, -0.04642782732844353, 0.0380384661257267, -0.05253658816218376, 0.035119377076625824, 0.051408082246780396, 0.04350906237959862, 0.00330918631516397, -0.017919356003403664, -0.015928838402032852, 0.010223355144262314, 0.02399458922445774, 0.016495410352945328, 0.055734600871801376, 0.03488698974251747, 0.056930430233478546, 0.03941495344042778, -0.03860034793615341, -0.05561652407050133, 0.02140546776354313, 0.04778098315000534, 0.0037792925722897053, 0.07672656327486038, 0.036456167697906494, 0.08985869586467743, 0.0462648831307888, -0.06542383134365082, -0.06751688569784164, 0.039633963257074356, 0.02419530227780342, -0.012164220213890076, 2.1809988105332332e-33, 0.015996305271983147, -0.029249561950564384, -0.02084120362997055, -0.04353450983762741, -0.03730404004454613, 0.0823495090007782, 0.04295254871249199, 0.05386350676417351, -0.07582627981901169, -0.012574000284075737, -0.05523276701569557, 0.0006599178304895759, -0.027765434235334396, -0.012737438082695007, -0.045100051909685135, -0.08145840466022491, -0.018876394256949425, 0.027078289538621902, -0.02478393353521824, 0.03451542556285858, -0.016481071710586548, -0.00273897428996861, 0.005805443041026592, -0.052082549780607224, 0.04158850386738777, -0.01708208955824375, -0.08890361338853836, -0.04696613550186157, -0.08364491909742355, -0.008704615756869316, -0.07756750285625458, 0.06368894875049591, -0.06601637601852417, -0.015780000016093254, 0.0017876779893413186, 0.020982269197702408, -0.015582140535116196, 0.034841056913137436, -0.011404854245483875, -0.02349817007780075, -0.006164046004414558, 0.03977468982338905, 0.0042303516529500484, -0.08357135206460953, -0.04955025017261505, -0.09743548929691315, -0.10242554545402527, 0.04617716744542122, 0.013458621688187122, 0.030745232477784157, -0.004951220005750656, 0.09328784793615341, -0.06631626188755035, -0.01376956608146429, 0.06347136944532394, -0.07082128524780273, 0.0277261845767498, 0.10418248921632767, 0.05521204695105553, 0.10893295705318451, 0.020637769252061844, -0.04260828718543053, 0.049078796058893204, 0.06190336123108864, 0.015060832723975182, 0.013647963292896748, -0.010293155908584595, 0.08289749175310135, -0.016254371032118797, -0.03305862471461296, 0.0491144061088562, -0.030075984075665474, 0.04763399437069893, -0.03324142470955849, 0.035973843187093735, -0.021664435043931007, -0.07381605356931686, -0.018212858587503433, 0.07819393277168274, -0.012300489470362663, 0.10773547738790512, -0.060939714312553406, -0.0569610670208931, 0.002612659940496087, 0.04895547777414322, 0.02274891547858715, -0.027130965143442154, -0.03687981516122818, -0.02656516060233116, -0.05705744028091431, -0.003695075400173664, 0.03867539390921593, 0.02886197715997696, -0.02183106541633606, -0.08453710377216339, -4.2248291852690136e-33, 0.07432005554437637, -0.035065051168203354, 0.03452673554420471, 0.07587101310491562, 0.0031454842537641525, -0.015929536893963814, -0.01941431313753128, -0.008377157151699066, -0.041683487594127655, -0.005011110566556454, -0.004452264402061701, -0.0038364820647984743, 0.021946744993329048, -0.022465696558356285, -0.0067167943343520164, 0.08480717986822128, 0.02375122718513012, -0.11091705411672592, -0.015719303861260414, 0.011811323463916779, 0.060606949031353, -0.03619200363755226, -0.0797937884926796, 0.02512650564312935, -0.0755947157740593, -0.05491984263062477, 0.11911216378211975, 0.06207363307476044, -0.06956546008586884, 0.014422522857785225, -0.010689166374504566, -0.08785037696361542, -0.038593798875808716, 0.03448384255170822, -0.04553708806633949, 0.057198766618967056, 0.045981258153915405, -0.030743613839149475, 0.020027106627821922, 0.09839508682489395, 0.13124215602874756, -0.020476453006267548, 0.10908167064189911, -0.016147885471582413, -0.047409337013959885, -0.027586227282881737, -0.05975818634033203, 0.03434031084179878, 0.06011541560292244, -0.040917277336120605, 0.045608144253492355, 0.05187462642788887, -0.0034636231139302254, -0.008163608610630035, -0.03422757238149643, -0.10937654972076416, -0.049208980053663254, 0.023976145312190056, -0.05980905890464783, -0.024746911600232124, -0.02804148755967617, 0.0033777037169784307, -0.04364905133843422, 0.01952386647462845, -0.009528297930955887, -0.006079435348510742, -0.05632425844669342, 0.033393774181604385, -0.004793831612914801, -0.00007995114719960839, -0.028010543435811996, 0.055197931826114655, 0.09485813230276108, 0.030831918120384216, 0.03647614270448685, 0.06230529770255089, 0.048215772956609726, -0.04030855745077133, 0.10895001143217087, -0.038355909287929535, -0.06392312049865723, 0.0037545831874012947, 0.03535858914256096, -0.014238511212170124, -0.004689632449299097, 0.08368679881095886, -0.09028711169958115, 0.05390693247318268, 0.033376988023519516, -0.03952128440141678, -0.01144200935959816, -0.059333156794309616, -0.024135852232575417, -0.017682895064353943, 0.03848801180720329, -5.1267885936567836e-8, -0.11247610300779343, -0.011473961174488068, -0.006324477028101683, 0.058298349380493164, 0.07500558346509933, 0.0426974780857563, 0.075588159263134, 0.12089040130376816, -0.07667858153581619, -0.049197129905223846, 0.06874579191207886, 0.06644444167613983, 0.08714691549539566, 0.03733133152127266, -0.03729236498475075, -0.042238280177116394, 0.024142511188983917, -0.12477239966392517, 0.027432885020971298, -0.02235066331923008, -0.018211323767900467, 0.0685422271490097, -0.0036053324583917856, -0.0065194545313715935, 0.06220586970448494, 0.06626642495393753, -0.06325744092464447, 0.058690253645181656, -0.03661752864718437, -0.07447340339422226, -0.02857118286192417, 0.006824737414717674, -0.1009896993637085, 0.04027559980750084, 0.02370854839682579, -0.042990509420633316, 0.010952385142445564, -0.027241263538599014, -0.049323584884405136, 0.008635769598186016, -0.01210931595414877, 0.03064892627298832, -0.030618660151958466, 0.016884442418813705, -0.0489281602203846, 0.007757935207337141, -0.011473087593913078, -0.05240475386381149, 0.03792533278465271, -0.0638565793633461, 0.08641493320465088, -0.09125398099422455, 0.04372941702604294, 0.01975862868130207, 0.02691684477031231, -0.06388039141893387, -0.019313011318445206, 0.042327072471380234, -0.022071179002523422, 0.08941160887479782, 0.04989790543913841, -0.008053255267441273, -0.017693061381578445, 0.054969996213912964 ]
0.026082
[[search-request-rescore]] === Rescoring Rescoring can help to improve precision by reordering just the top (eg 100 - 500) documents returned by the <> and <> phases, using a secondary (usually more costly) algorithm, instead of applying the costly algorithm to all documents in the index. A `rescore` request is executed on each shard before it returns its results to be sorted by the node handling the overall search request. Currently the rescore API has only one implementation: the query rescorer, which uses a query to tweak the scoring. In the future, alternative rescorers may be made available, for example, a pair-wise rescorer. NOTE: An error will be thrown if an explicit <> (other than `\_score` in descending order) is provided with a `rescore` query. NOTE: when exposing pagination to your users, you should not change `window\_size` as you step through each page (by passing different `from` values) since that can alter the top hits causing results to confusingly shift as the user steps through pages. ==== Query rescorer The query rescorer executes a second query only on the Top-K results returned by the <> and <> phases. The number of docs which will be examined on each shard can be controlled by the `window\_size` parameter, which defaults to 10. By default the scores from the original query and the rescore query are combined linearly to produce the final `\_score` for each document. The relative importance of the original query and of the rescore query can be controlled with the `query\_weight` and `rescore\_query\_weight` respectively. Both default to `1`. For example: [source,js] -------------------------------------------------- POST /\_search { "query" : { "match" : { "message" : { "operator" : "or", "query" : "the quick brown" } } }, "rescore" : { "window\_size" : 50, "query" : { "rescore\_query" : { "match\_phrase" : { "message" : { "query" : "the quick brown", "slop" : 2 } } }, "query\_weight" : 0.7, "rescore\_query\_weight" : 1.2 } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] The way the scores are combined can be controlled with the `score\_mode`: [cols="<,<",options="header",] |======================================================================= |Score Mode |Description |`total` |Add the original score and the rescore query score. The default. |`multiply` |Multiply the original score by the rescore query score. Useful for <> rescores. |`avg` |Average the original score and the rescore query score. |`max` |Take the max of original score and the rescore query score. |`min` |Take the min of the original score and the rescore query score. |======================================================================= ==== Multiple Rescores It is also possible to execute multiple rescores in sequence: [source,js] -------------------------------------------------- POST /\_search { "query" : { "match" : { "message" : { "operator" : "or", "query" : "the quick brown" } } }, "rescore" : [ { "window\_size" : 100, "query" : { "rescore\_query" : { "match\_phrase" : { "message" : { "query" : "the quick brown", "slop" : 2 } } }, "query\_weight" : 0.7, "rescore\_query\_weight" : 1.2 } }, { "window\_size" : 10, "query" : { "score\_mode": "multiply", "rescore\_query" : { "function\_score" : { "script\_score": { "script": { "source": "Math.log10(doc.likes.value + 2)" } } } } } } ] } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] The first one gets the results of the query then the second one gets the results of the first, etc. The second rescore will "see" the sorting done by the first rescore so it is possible to use a large window on the first rescore to pull documents into a smaller window for the second rescore.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/rescore.asciidoc
6.2
elasticsearch-6-2
[ -0.03087003156542778, 0.03263529762625694, -0.04485996812582016, 0.051517896354198456, -0.01258546020835638, 0.022328048944473267, -0.07110192626714706, 0.051110751926898956, -0.006905073765665293, 0.04691115766763687, -0.0755460113286972, 0.012565074488520622, 0.1028035581111908, -0.015643136575818062, -0.04304732754826546, -0.04732273519039154, 0.0004718240234069526, 0.07351573556661606, -0.014614634215831757, -0.04335513710975647, 0.02970089018344879, 0.05973504111170769, 0.07780241221189499, -0.05347991734743118, 0.0010613263584673405, -0.05760065093636513, -0.1386248767375946, -0.07293222844600677, 0.02764040045440197, 0.01835331693291664, 0.028714898973703384, 0.01282060332596302, -0.03417681157588959, 0.10357452183961868, -0.0641828179359436, 0.020586421713232994, -0.04106065630912781, -0.11489112675189972, 0.026994066312909126, -0.021146662533283234, 0.005815512966364622, 0.041487060487270355, -0.03905101865530014, -0.026314793154597282, 0.047608885914087296, 0.012676296755671501, -0.08877824246883392, 0.048805251717567444, -0.03451329097151756, -0.0016722454456612468, -0.13701093196868896, 0.017656931653618813, -0.015132058411836624, -0.0031967884860932827, -0.010813787579536438, 0.040889713913202286, -0.03658515214920044, -0.07166801393032074, -0.04633531719446182, -0.010610192082822323, 0.009441234171390533, -0.12803633511066437, 0.00008373606397071853, -0.06055532395839691, 0.012548819184303284, -0.048786524683237076, 0.11620529741048813, -0.016567707061767578, 0.059761691838502884, 0.014816870912909508, 0.044702958315610886, 0.05192190408706665, 0.021555831655859947, -0.0026792187709361315, 0.030294546857476234, 0.03066862002015114, -0.09504455327987671, -0.053954143077135086, -0.03237948939204216, 0.044887978583574295, -0.05929742753505707, -0.034734565764665604, 0.03168824315071106, 0.025601889938116074, 0.06730842590332031, -0.12585659325122833, 0.06822557747364044, -0.047057684510946274, 0.10097622126340866, 0.030566910281777382, -0.019348762929439545, -0.008316264487802982, -0.02623257227241993, -0.03518685698509216, 0.0336725115776062, 0.05252528935670853, -0.02442294918000698, 0.00712739210575819, 0.019986120983958244, -0.0189379695802927, 0.022583674639463425, 0.03331140801310539, -0.0045263925567269325, -0.15578195452690125, 0.02145322412252426, -0.017620043829083443, 0.02826925367116928, 0.05799715593457222, -0.059191130101680756, -0.08843246102333069, 0.05013790726661682, 0.04910248890519142, 0.011293257586658001, -0.059405338019132614, 0.006291963160037994, 0.023057846352458, 0.07887700945138931, -0.0737200528383255, 0.06663567572832108, 0.0552908331155777, 0.028947977349162102, 0.06953564286231995, 0.018333401530981064, -0.028931615874171257, 0.04086381196975708, 0.03277318924665451, -0.04388889670372009, 7.893839091063155e-33, 0.06477849930524826, 0.042698804289102554, 0.06575877219438553, -0.06866952031850815, -0.05270133167505264, 0.06759972870349884, 0.009886840358376503, 0.016661016270518303, -0.11253700405359268, -0.02582680806517601, -0.056990399956703186, 0.08977312594652176, -0.0023809727281332016, -0.0034565224777907133, 0.03138798475265503, -0.0711326152086258, 0.03927270323038101, 0.07879268378019333, -0.08022751659154892, -0.041112229228019714, 0.048105839639902115, -0.016902366653084755, 0.013781477697193623, -0.017996525391936302, 0.06126406043767929, -0.02945258840918541, -0.07956334948539734, -0.034108106046915054, -0.07754867523908615, -0.02914164960384369, -0.0058141592890024185, -0.0015163486823439598, -0.06703143566846848, 0.03180719539523125, -0.008626772090792656, 0.053929220885038376, -0.0006239897920750082, 0.04862133786082268, -0.026346975937485695, -0.012607980519533157, -0.044076282531023026, 0.050358932465314865, 0.02372969314455986, -0.07786896079778671, -0.09754175692796707, 0.008688384667038918, -0.11354481428861618, 0.021825268864631653, -0.002363716484978795, 0.006745330058038235, 0.0002672856498975307, 0.026397405192255974, 0.04236265644431114, 0.044400542974472046, 0.026454316452145576, -0.057188525795936584, 0.09483208507299423, 0.09573924541473389, 0.013849782757461071, 0.03100152686238289, 0.0023450234439224005, -0.14221467077732086, -0.015113236382603645, -0.027426276355981827, -0.0038580987602472305, 0.0037805086467415094, 0.024008402600884438, 0.07000388205051422, 0.045554447919130325, 0.03442786633968353, 0.009259249083697796, 0.04946810379624367, 0.09381316602230072, -0.052379634231328964, 0.04732128605246544, -0.009225997142493725, 0.024540511891245842, -0.035324160009622574, -0.0771508738398552, -0.05544975399971008, 0.003184262430295348, 0.04368468374013901, -0.0035604771692305803, -0.03895357623696327, 0.02040007710456848, 0.03620624542236328, 0.012152308598160744, 0.0465417355298996, -0.014169840142130852, -0.07442298531532288, -0.022374289110302925, 0.021046673879027367, 0.033387910574674606, -0.060549985617399216, -0.051639776676893234, -5.6754619478966735e-33, -0.0029267023783177137, -0.06870001554489136, 0.036853887140750885, 0.08839168399572372, 0.0683504194021225, -0.07460419833660126, 0.00959504023194313, -0.07690337300300598, -0.03308407589793205, -0.07051023840904236, 0.015345959924161434, -0.08661780506372452, 0.07420912384986877, -0.009992562234401703, -0.026590971276164055, 0.05834463983774185, -0.01576569862663746, -0.08554798364639282, 0.04618723317980766, 0.03840435668826103, -0.015473463572561741, 0.04204181954264641, -0.006362738087773323, 0.04589485004544258, -0.021126333624124527, 0.0006582998321391642, 0.003700797213241458, -0.04048265889286995, -0.005030472297221422, -0.06174251064658165, 0.002893216675147414, -0.07901577651500702, -0.0689617395401001, -0.012188124470412731, -0.025005046278238297, -0.017981961369514465, -0.016747716814279556, -0.022766679525375366, -0.023316171020269394, 0.18953317403793335, 0.031372375786304474, 0.0321064330637455, -0.0074041723273694515, 0.025156835094094276, 0.04526409134268761, 0.00548623176291585, -0.028760354965925217, 0.014207005500793457, -0.04392674192786217, -0.040094178169965744, -0.006548346020281315, 0.014811558648943901, -0.03691762313246727, 0.07259044051170349, -0.011516178958117962, -0.042959146201610565, -0.07805053144693375, 0.015365852043032646, -0.05867301672697067, 0.022238418459892273, -0.02687622606754303, 0.029659373685717583, -0.04107564315199852, 0.07735052704811096, 0.005140842404216528, 0.013610494323074818, -0.06826125830411911, -0.0485132597386837, -0.09398399293422699, 0.023792266845703125, -0.05967305973172188, -0.0007709976052865386, 0.1030578687787056, 0.028518149629235268, -0.005538018885999918, -0.010325446724891663, -0.000920147926080972, 0.012321285903453827, 0.03457116335630417, 0.060693949460983276, -0.020335668697953224, 0.06861885637044907, -0.005959737580269575, 0.0195841696113348, -0.004555615596473217, 0.04936914145946503, 0.04488123953342438, 0.07531382143497467, -0.03784801438450813, -0.0027858391404151917, -0.05395001173019409, -0.052249785512685776, 0.026675250381231308, 0.005834653042256832, 0.0026362233329564333, -6.193393886633203e-8, -0.0714416354894638, 0.047012809664011, -0.08808654546737671, 0.10772770643234253, 0.05603794753551483, 0.044960398226976395, 0.04308851808309555, 0.13176871836185455, -0.049339041113853455, 0.002020210726186633, 0.13085556030273438, -0.06388210505247116, 0.020817101001739502, -0.027077944949269295, 0.08651013672351837, -0.013286801986396313, 0.012599197216331959, 0.019878853112459183, -0.036336179822683334, -0.0626390278339386, -0.006116735748946667, 0.07944848388433456, 0.03324274718761444, 0.03574642166495323, 0.019980113953351974, 0.07488533854484558, 0.020964084193110466, 0.03582848608493805, -0.009693448431789875, -0.021794812753796577, -0.03711756318807602, 0.013622002676129341, 0.04595279321074486, -0.0068932934664189816, 0.054781220853328705, 0.046037644147872925, -0.04536787420511246, 0.0888676568865776, -0.03364316001534462, 0.03727591410279274, 0.028500555083155632, 0.004835385829210281, -0.013330156914889812, 0.06435804069042206, 0.033723242580890656, -0.01803646981716156, -0.016195641830563545, 0.013790014199912548, 0.09523331373929977, -0.0357113853096962, 0.010280373506247997, -0.056665100157260895, 0.007040201686322689, 0.016301792114973068, -0.019838156178593636, 0.026197222992777824, 0.008791854605078697, -0.02027360536158085, 0.011594674549996853, 0.0185456071048975, 0.09344189614057541, -0.0665508285164833, -0.023321956396102905, 0.05907977744936943 ]
0.034526
so it is possible to use a large window on the first rescore to pull documents into a smaller window for the second rescore.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/rescore.asciidoc
6.2
elasticsearch-6-2
[ -0.02476450614631176, -0.009012998081743717, -0.0399770550429821, 0.10472384095191956, 0.05898657813668251, -0.026752470061182976, -0.08052778244018555, 0.09590867906808853, -0.004215773660689592, 0.018290158361196518, -0.05300290882587433, 0.058465927839279175, -0.024746883660554886, -0.040057167410850525, -0.00689066294580698, -0.021369224414229393, -0.013546132482588291, 0.008391451090574265, -0.054022084921598434, 0.07039256393909454, 0.048871953040361404, -0.06024044007062912, -0.007365055847913027, -0.07513558864593506, 0.021997706964612007, 0.032531846314668655, -0.22127555310726166, 0.02074124850332737, 0.00427382392808795, 0.023553036153316498, 0.08679370582103729, -0.015368260443210602, -0.05534724146127701, 0.05206809937953949, 0.024775797501206398, 0.008738934993743896, -0.0319540873169899, -0.01566275767982006, -0.0471968799829483, -0.028431037440896034, 0.042192231863737106, 0.0669921487569809, -0.04006420448422432, 0.03138936683535576, -0.03489261865615845, -0.02574325166642666, -0.07492898404598236, 0.06046241521835327, -0.005949781741946936, 0.024231184273958206, -0.1236061304807663, -0.014314061962068081, -0.09021120518445969, 0.030859125778079033, 0.029117176309227943, 0.1289842575788498, 0.004352109506726265, 0.01086821872740984, -0.07143709063529968, 0.0860159769654274, -0.0029975567013025284, -0.058178480714559555, -0.02983403392136097, 0.010155071504414082, 0.03676203638315201, 0.028933973982930183, 0.05247317627072334, 0.020527802407741547, -0.06185392290353775, -0.03267381712794304, 0.02886103093624115, -0.003760190913453698, 0.024762002751231194, -0.08334033191204071, 0.07582806795835495, -0.062280189245939255, -0.08223184198141098, 0.023630652576684952, -0.025923900306224823, -0.05844404175877571, 0.04614663124084473, 0.0035750886891037226, -0.0022820045705884695, -0.03703680634498596, 0.02938161790370941, -0.030685339123010635, 0.041997943073511124, -0.10577224940061569, -0.010871951468288898, -0.0032916110940277576, 0.020215997472405434, -0.08073418587446213, 0.03375636041164398, 0.07826752215623856, -0.032019756734371185, -0.06406630575656891, -0.01814712956547737, 0.02379937469959259, 0.0420340932905674, -0.0225755013525486, 0.0030507624614983797, 0.016955353319644928, 0.10828346759080887, 0.014804902486503124, 0.020541494712233543, -0.08686170727014542, -0.029496416449546814, 0.019038530066609383, -0.11882045120000839, -0.0620540976524353, 0.057072099298238754, 0.06728041917085648, 0.048433899879455566, 0.04812832921743393, 0.023047247901558876, 0.04085848107933998, 0.029101330786943436, -0.018203500658273697, 0.011451134458184242, 0.06200540065765381, 0.04479452222585678, 0.018305644392967224, -0.010604966431856155, -0.08050286769866943, 0.021044209599494934, -0.046624861657619476, 0.030641760677099228, -3.907976887056774e-34, 0.002678314922377467, -0.0862562283873558, -0.08277305960655212, -0.015491197817027569, 0.0730009600520134, 0.04289356619119644, -0.026149315759539604, 0.08320306241512299, -0.08800436556339264, -0.015152444131672382, 0.008795141242444515, 0.04033983498811722, 0.05518762394785881, -0.009567136876285076, -0.03561751917004585, -0.0421895906329155, 0.004313325975090265, 0.1683768928050995, -0.06488890200853348, -0.03118916228413582, -0.0072102718986570835, 0.007344779558479786, -0.005571513436734676, -0.05817524716258049, 0.042709797620773315, -0.0354963056743145, -0.029996993020176888, 0.01981193758547306, -0.057099469006061554, -0.020246246829628944, -0.060613617300987244, -0.025601183995604515, 0.005845189094543457, 0.010919690132141113, -0.06544555723667145, 0.04785560816526413, 0.020290235057473183, -0.019800515845417976, 0.0017906802240759134, 0.009480124339461327, -0.06793557107448578, 0.04777054116129875, 0.03411250188946724, -0.028303030878305435, -0.07631979882717133, -0.06457621604204178, -0.03367286175489426, 0.043778736144304276, -0.04415511339902878, -0.05819625407457352, 0.07562445104122162, 0.02899787575006485, 0.006800173781812191, 0.049003858119249344, 0.02861172705888748, -0.06444758176803589, 0.028986617922782898, 0.0931270569562912, 0.07691049575805664, 0.02673802338540554, -0.08078633248806, -0.07418069243431091, -0.09644048660993576, 0.04143410921096802, 0.016183948144316673, 0.03586239740252495, 0.020975079387426376, 0.04610835760831833, 0.025991005823016167, 0.024083171039819717, -0.03728018328547478, 0.039286885410547256, 0.04646775871515274, -0.029679961502552032, 0.09549035131931305, -0.000003477240625215927, -0.023124676197767258, -0.0006747118313796818, -0.07116258144378662, -0.019937966018915176, -0.031644731760025024, 0.05297015607357025, -0.015941938385367393, -0.026833876967430115, -0.04134632274508476, 0.030169246718287468, -0.01971476711332798, -0.00802739430218935, -0.040629882365465164, -0.0475713387131691, -0.032724104821681976, 0.007517216727137566, 0.05672561749815941, -0.0633118599653244, 0.07488802075386047, 7.872957903288736e-34, 0.02780061773955822, -0.07578928768634796, -0.000427194987423718, 0.006811380852013826, 0.05837320536375046, 0.10068859905004501, 0.06710844486951828, -0.01490737684071064, -0.10098123550415039, -0.036487966775894165, 0.03682822734117508, -0.047819189727306366, 0.05309715121984482, -0.00047381717013195157, -0.043249186128377914, 0.0009381460258737206, 0.08668632805347443, -0.023426508530974388, 0.05176706612110138, 0.019278697669506073, 0.079064279794693, -0.06606969237327576, 0.03435058519244194, 0.03768593445420265, 0.014249761588871479, -0.04036550596356392, -0.031548045575618744, -0.03730739653110504, 0.006510708946734667, -0.05507638305425644, 0.005550715606659651, -0.047333333641290665, -0.09217265993356705, -0.01941611059010029, 0.08457183092832565, 0.023399673402309418, -0.053080566227436066, -0.02463514916598797, -0.03356490656733513, 0.13489004969596863, 0.039190761744976044, 0.017981309443712234, 0.00739855645224452, 0.02438737265765667, 0.02958500012755394, 0.009053847752511501, 0.05506334453821182, -0.02316528931260109, -0.06121469661593437, -0.06327591091394424, -0.00023375434102490544, -0.03009522706270218, -0.024096202105283737, -0.024760957807302475, -0.026737989857792854, -0.020084481686353683, 0.04480338841676712, -0.030383499339222908, -0.04516487941145897, -0.011374633759260178, 0.13090896606445312, -0.03950048238039017, -0.030830860137939453, -0.057873714715242386, 0.042911794036626816, 0.0017636260017752647, -0.06996586173772812, 0.010599371045827866, -0.04171725735068321, 0.06156797334551811, -0.0031245730351656675, 0.010130954906344414, 0.07711070030927658, 0.015716100111603737, -0.000587176182307303, 0.02206747978925705, 0.054741270840168, -0.04643338546156883, 0.018007447943091393, 0.07595353573560715, -0.019656265154480934, 0.022706875577569008, 0.07254350930452347, -0.017374670132994652, 0.0004669033514801413, 0.06469970941543579, 0.0017044077394530177, 0.038110438734292984, -0.012205042876303196, -0.008715083822607994, -0.0742708370089531, -0.006614285055547953, 0.1210152879357338, 0.03086676634848118, -0.0017426206031814218, -2.293535850128592e-8, -0.07475065439939499, 0.02383073791861534, -0.028194906190037727, 0.08600873500108719, -0.06496863067150116, 0.01765965297818184, -0.053310178220272064, 0.05688289925456047, -0.04695798456668854, -0.024280382320284843, 0.02882811799645424, -0.024337828159332275, 0.002540724817663431, -0.018300622701644897, 0.06603074073791504, -0.04849126935005188, 0.05315026268362999, -0.05861636623740196, 0.023132650181651115, -0.04369455948472023, 0.08167099952697754, 0.031295519322156906, 0.07819311320781708, 0.0551069900393486, -0.04303270950913429, 0.029294166713953018, 0.012694752775132656, -0.002633908065035939, -0.011936846189200878, -0.06710153073072433, -0.038555536419153214, 0.01827894151210785, 0.01692366600036621, 0.09306379407644272, 0.028105704113841057, 0.0032493360340595245, 0.06105056032538414, 0.14554671943187714, -0.05881873145699501, -0.0302574522793293, 0.08665721863508224, -0.05614829808473587, -0.07110866904258728, 0.05695540830492973, 0.01513548195362091, 0.00294575490988791, 0.025128111243247986, -0.05148295685648918, 0.056661494076251984, -0.06229466199874878, 0.034313373267650604, -0.07652577757835388, 0.10832128673791885, 0.017701271921396255, -0.031421829015016556, -0.008133435621857643, 0.028199076652526855, 0.00004099003126611933, -0.028966335579752922, 0.04495938494801521, -0.004752085544168949, 0.025599157437682152, -0.0070506613701581955, 0.0931127741932869 ]
0.033341
[[search-request-preference]] === Preference Controls a `preference` of which shard copies on which to execute the search. By default, Elasticsearch selects from the available shard copies in an unspecified order, taking the <> and <> configuration into account. However, it may sometimes be desirable to try and route certain searches to certain sets of shard copies, for instance to make better use of per-copy caches. The `preference` is a query string parameter which can be set to: [horizontal] `\_primary`:: The operation will be executed only on primary shards. ifdef::asciidoctor[] deprecated:[6.1.0, "will be removed in 7.0. See the warning below for more information."] endif::[] ifndef::asciidoctor[] deprecated[6.1.0, will be removed in 7.0. See the warning below for more information.] endif::[] `\_primary\_first`:: The operation will be executed on primary shards if possible, but will fall back to other shards if not. ifdef::asciidoctor[] deprecated:[6.1.0, "will be removed in 7.0. See the warning below for more information."] endif::[] ifndef::asciidoctor[] deprecated[6.1.0, will be removed in 7.0. See the warning below for more information.] endif::[] `\_replica`:: The operation will be executed only on replica shards. If there are multiple replicas then the order of preference between them is unspecified. ifdef::asciidoctor[] deprecated:[6.1.0, "will be removed in 7.0. See the warning below for more information."] endif::[] ifndef::asciidoctor[] deprecated[6.1.0, will be removed in 7.0. See the warning below for more information.] endif::[] `\_replica\_first`:: The operation will be executed on replica shards if possible, but will fall back to other shards if not. If there are multiple replicas then the order of preference between them is unspecified. ifdef::asciidoctor[] deprecated:[6.1.0, "will be removed in 7.0. See the warning below for more information."] endif::[] ifndef::asciidoctor[] deprecated[6.1.0, will be removed in 7.0. See the warning below for more information.] endif::[] `\_only\_local`:: The operation will be executed only on shards allocated to the local node. `\_local`:: The operation will be executed on shards allocated to the local node if possible, and will fall back to other shards if not. `\_prefer\_nodes:abc,xyz`:: The operation will be executed on nodes with one of the provided node ids (`abc` or `xyz` in this case) if possible. If suitable shard copies exist on more than one of the selected nodes then the order of preference between these copies is unspecified. `\_shards:2,3`:: Restricts the operation to the specified shards. (`2` and `3` in this case). This preference can be combined with other preferences but it has to appear first: `\_shards:2,3|\_local` `\_only\_nodes:abc\*,x\*yz,...`:: Restricts the operation to nodes specified according to the <>. If suitable shard copies exist on more than one of the selected nodes then the order of preference between these copies is unspecified. Custom (string) value:: Any value that does not start with `\_`. If two searches both give the same custom string value for their preference and the underlying cluster state does not change then the same ordering of shards will be used for the searches. This does not guarantee that the exact same shards will be used each time: the cluster state, and therefore the selected shards, may change for a number of reasons including shard relocations and shard failures, and nodes may sometimes reject searches causing fallbacks to alternative nodes. However, in practice the ordering of shards tends to remain stable for long periods of time. A good candidate for a custom preference value is something like the web session id or the user name. For instance, use the user's session ID `xyzabc123` as follows: [source,js] ------------------------------------------------ GET /\_search?preference=xyzabc123 { "query": { "match": { "title": "elasticsearch" } } } ------------------------------------------------ // CONSOLE NOTE: The `\_only\_local` preference guarantees only to use shard copies on the local node, which is
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/preference.asciidoc
6.2
elasticsearch-6-2
[ 0.037154678255319595, 0.012728311121463776, 0.02902625873684883, 0.017670171335339546, 0.0024938464630395174, 0.014149758964776993, -0.030928904190659523, -0.06992673873901367, 0.08020660281181335, -0.0012920870212838054, 0.017998527735471725, 0.04739133641123772, -0.005463693756610155, -0.008307055570185184, -0.03149266168475151, -0.024816980585455894, -0.019419066607952118, -0.0839943215250969, -0.05971132963895798, 0.06717626750469208, 0.059085913002491, 0.04559672996401787, -0.0007709819474257529, -0.02296430990099907, -0.037677641957998276, -0.06034906208515167, -0.08044707030057907, -0.01661152020096779, 0.002747841877862811, -0.05335130915045738, 0.013392860069870949, -0.01745976321399212, -0.004571853671222925, 0.041390560567379, -0.014669058844447136, 0.037710826843976974, -0.061052680015563965, -0.07709458470344543, -0.048956748098134995, 0.013427963480353355, -0.017546281218528748, -0.03207588195800781, -0.0668502077460289, -0.07077424973249435, -0.10034744441509247, 0.0025411834940314293, -0.029201071709394455, -0.00336820213124156, -0.004084103740751743, 0.027491861954331398, -0.012382997199892998, -0.07937944680452347, -0.023350968956947327, 0.03785250335931778, 0.05722538009285927, 0.048473745584487915, -0.09564269334077835, -0.02183929830789566, -0.030826322734355927, -0.02850225381553173, 0.056509535759687424, -0.053018830716609955, 0.0080520985648036, -0.02565866895020008, -0.004630304407328367, 0.005538526456803083, 0.07180914282798767, -0.059540342539548874, 0.03963754326105118, 0.02644091472029686, -0.0070888325572013855, 0.0008835947373881936, -0.0472094863653183, 0.05107233300805092, 0.10575329512357712, 0.1542823612689972, 0.03743678703904152, -0.009008914232254028, -0.05027123540639877, -0.053127653896808624, -0.10096319019794464, -0.08173839002847672, 0.016074884682893753, 0.007399497088044882, 0.021780943498015404, -0.03591339662671089, -0.022658821195364, -0.06954309344291687, 0.1492834836244583, 0.012975170277059078, 0.009477744810283184, -0.02470671571791172, 0.13102325797080994, -0.053357623517513275, 0.05426783859729767, 0.031013673171401024, -0.012550621293485165, 0.1372915357351303, 0.01216793805360794, 0.0008399150683544576, -0.002373351948335767, -0.04420822113752365, -0.014346116222441196, 0.011397709138691425, 0.0189077015966177, -0.029726052656769753, -0.07441377639770508, 0.035149723291397095, -0.021919390186667442, -0.04222670570015907, 0.034207507967948914, -0.0228605717420578, 0.08790643513202667, -0.038490600883960724, -0.019581153988838196, 0.10286302864551544, 0.051621660590171814, -0.020382681861519814, -0.0327758714556694, 0.04279877245426178, 0.03346683084964752, -0.03895924612879753, 0.07872237265110016, 0.0025561500806361437, -0.06092757731676102, 0.048111312091350555, -0.09035225957632065, 6.320598594224885e-33, 0.07353943586349487, 0.017074352130293846, 0.009868024848401546, -0.09312521666288376, -0.021772585809230804, 0.036073774099349976, 0.01862429827451706, 0.05860678851604462, -0.07302355766296387, -0.08795839548110962, -0.04583800956606865, 0.054432809352874756, -0.024190161377191544, -0.010700828395783901, 0.013444392010569572, -0.05449006333947182, 0.12258569151163101, 0.06254041939973831, 0.015620021149516106, -0.003026053076609969, 0.07981056720018387, 0.028631476685404778, -0.025561654940247536, -0.0444190539419651, -0.024000678211450577, -0.030741997063159943, -0.030516307801008224, -0.09055431932210922, -0.03672812879085541, 0.010653357952833176, -0.04330787807703018, -0.044998835772275925, -0.0238806065171957, 0.036037396639585495, 0.007354614790529013, 0.06056107580661774, -0.07884873449802399, 0.0660223737359047, -0.06951320916414261, -0.04547751322388649, 0.06426076591014862, 0.022995058447122574, 0.012973795644938946, -0.022365499287843704, -0.03503129258751869, -0.06686671078205109, -0.06267132610082626, 0.06781643629074097, 0.028344053775072098, -0.054001882672309875, 0.017241083085536957, 0.04640422761440277, 0.07834954559803009, 0.02005036734044552, 0.04041343554854393, -0.04283346235752106, -0.0025408403016626835, 0.022924596443772316, 0.00686021288856864, 0.018370529636740685, 0.05931156873703003, 0.015218926593661308, 0.06509111076593399, 0.10046382993459702, 0.008243774063885212, 0.02617170475423336, 0.05460634082555771, 0.028111446648836136, 0.014678487554192543, 0.05998516082763672, -0.04928402975201607, 0.07080738991498947, -0.0009288539295084774, -0.026193302124738693, -0.00763836782425642, -0.07761641591787338, -0.06348730623722076, -0.053367696702480316, -0.0007408186793327332, -0.0380825400352478, -0.07382654398679733, 0.014696050435304642, -0.046910498291254044, 0.007678964640945196, -0.04684025049209595, 0.005211981479078531, 0.06752689182758331, -0.06673037260770798, -0.015854135155677795, -0.03944898396730423, 0.013729672878980637, 0.010983677580952644, -0.06782466173171997, 0.0045616514980793, 0.00215145549736917, -5.515557981986379e-33, 0.04161888360977173, -0.09569459408521652, 0.048257000744342804, 0.07706456631422043, -0.012446808628737926, -0.0027648971881717443, 0.07349161058664322, -0.03512639179825783, -0.05820463225245476, -0.07650479674339294, 0.07282903045415878, -0.005879945587366819, 0.06067386642098427, -0.06243610754609108, -0.029525598511099815, 0.08501493185758591, -0.015404553152620792, -0.12280555069446564, -0.004176612012088299, 0.005481477361172438, -0.0726235955953598, 0.01612756960093975, -0.0715971514582634, 0.10943049192428589, -0.05429477617144585, -0.02497953176498413, 0.02000008523464203, -0.04524959623813629, -0.02051943726837635, -0.020807374268770218, -0.016803238540887833, 0.05332066863775253, -0.0506649948656559, -0.04849790036678314, -0.05750023573637009, 0.04409574717283249, -0.023660562932491302, 0.04246851056814194, 0.0009504927438683808, 0.10027255117893219, 0.03282046690583229, 0.03433789685368538, -0.07024599611759186, 0.029243282973766327, 0.0010399435414001346, -0.014982483349740505, 0.0074129910208284855, 0.09305576235055923, 0.055710114538669586, -0.057796578854322433, 0.03642569109797478, -0.0321328304708004, 0.026218749582767487, 0.07096482813358307, 0.027603622525930405, 0.08641845732927322, -0.03226166218519211, 0.10371238738298416, -0.06778951734304428, 0.06033982336521149, 0.03458394110202789, 0.0024054772220551968, -0.05273475497961044, -0.053538091480731964, -0.008380644954741001, -0.016841920092701912, -0.057705193758010864, -0.03863584250211716, -0.041386086493730545, -0.06872274726629257, -0.024257544428110123, -0.06370295584201813, 0.026857364922761917, -0.006837932392954826, 0.0535716749727726, -0.044153083115816116, 0.05117431655526161, 0.026625104248523712, 0.03282182291150093, 0.1123562604188919, -0.08603890985250473, 0.09841960668563843, -0.0062518659979105, 0.0690377876162529, 0.011653129942715168, -0.05423472821712494, 0.016938280314207077, 0.08271247148513794, -0.07987986505031586, 0.01546418759971857, 0.028525637462735176, -0.06212037056684494, -0.03876080736517906, 0.02030787244439125, 0.02398572862148285, -5.1166747283559744e-8, 0.04360109567642212, -0.006966033484786749, 0.005430284421890974, 0.05712944269180298, 0.09117192775011063, -0.003005401464179158, 0.038486842066049576, 0.018422434106469154, -0.08064591139554977, -0.005142844282090664, -0.016875209286808968, 0.07403404265642166, -0.020121533423662186, -0.01317806076258421, -0.0008539876434952021, -0.02575422078371048, 0.04736374691128731, 0.002019519917666912, -0.05834305286407471, -0.06419814378023148, -0.024423716589808464, -0.039910126477479935, 0.029437728226184845, 0.012132743373513222, 0.026790186762809753, 0.0014359583146870136, 0.03190872445702553, 0.008283224888145924, 0.035868577659130096, 0.08028245717287064, -0.02828625962138176, -0.022159790620207787, 0.02536294050514698, -0.06300272047519684, -0.003869512351229787, 0.10316631942987442, -0.11159909516572952, 0.041755396872758865, -0.002248448319733143, 0.10225653648376465, 0.04697827249765396, 0.00971230585128069, -0.06064622849225998, 0.03172780200839043, -0.05569707974791527, -0.04828497767448425, 0.0063926465809345245, 0.024591226130723953, -0.0035744302440434694, 0.0003545137878973037, 0.005219091661274433, -0.007610165048390627, 0.07850578427314758, 0.05531369149684906, 0.018737614154815674, 0.022229595109820366, 0.034949589520692825, -0.03368488699197769, 0.01869531348347664, 0.0276747215539217, 0.15930722653865814, -0.1190749779343605, 0.034925322979688644, -0.0425603948533535 ]
0.046917
web session id or the user name. For instance, use the user's session ID `xyzabc123` as follows: [source,js] ------------------------------------------------ GET /\_search?preference=xyzabc123 { "query": { "match": { "title": "elasticsearch" } } } ------------------------------------------------ // CONSOLE NOTE: The `\_only\_local` preference guarantees only to use shard copies on the local node, which is sometimes useful for troubleshooting. All other options do not \_fully\_ guarantee that any particular shard copies are used in a search, and on a changing index this may mean that repeated searches may yield different results if they are executed on different shard copies which are in different refresh states. WARNING: The `\_primary`, `\_primary\_first`, `\_replica` and `\_replica\_first` are deprecated as their use is not recommended. They do not help to avoid inconsistent results that arise from the use of shards that have different refresh states, and Elasticsearch uses synchronous replication so the primary does not in general hold fresher data than its replicas. The `\_primary\_first` and `\_replica\_first` preferences silently fall back to non-preferred copies if it is not possible to search the preferred copies. The `\_primary` and `\_replica` preferences will silently change their preferred shards if a replica is promoted to primary, which can happen at any time. The `\_primary` preference can also put undesirable extra load on the primary shards. The cache-related benefits of these options can also be obtained using `\_only\_nodes`, `\_prefer\_nodes`, or a custom string value instead.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/search/request/preference.asciidoc
6.2
elasticsearch-6-2
[ -0.010584921576082706, 0.0948423221707344, -0.00883669126778841, 0.04481067135930061, 0.013088920153677464, 0.022885819897055626, 0.045202624052762985, -0.021864153444767, 0.04372578486800194, -0.03212296590209007, -0.06434663385152817, -0.03783629462122917, 0.006915752775967121, -0.013189428485929966, 0.014236128889024258, -0.02675969898700714, -0.020204683765769005, 0.014846919104456902, -0.003348079277202487, -0.0169745534658432, 0.06960969418287277, 0.02816619910299778, 0.010153473354876041, -0.07363992929458618, -0.050180502235889435, -0.052462708204984665, -0.030055860057473183, -0.006657615769654512, 0.0628746971487999, 0.02265211194753647, 0.026578715071082115, 0.01669253222644329, -0.07573160529136658, 0.018567072227597237, -0.011174445040524006, 0.0066131651401519775, -0.04641342908143997, -0.0857936292886734, 0.001563873142004013, -0.016866233199834824, 0.024081461131572723, 0.04817858338356018, -0.04341666400432587, -0.05311892554163933, -0.04561607912182808, -0.08963637053966522, -0.05023006722331047, -0.036113936454057693, -0.004790071863681078, 0.016104333102703094, -0.05788271129131317, -0.04227418079972267, -0.028531385585665703, -0.01083419844508171, 0.014671253971755505, 0.06736186146736145, -0.08704788982868195, 0.027917465195059776, 0.012776270508766174, -0.029095327481627464, 0.03099234029650688, -0.05890287831425667, 0.05089794099330902, -0.00860628578811884, 0.011636500246822834, -0.007693995721638203, 0.04192902147769928, -0.08445753902196884, 0.04959753900766373, 0.002362648956477642, 0.028250349685549736, 0.0018754461780190468, -0.07969916611909866, -0.015991805121302605, 0.04443846270442009, -0.006426815874874592, 0.03595667704939842, -0.003960894886404276, -0.027963194996118546, 0.02863643690943718, -0.09524907171726227, -0.0908689796924591, -0.01479440275579691, -0.0063775633461773396, 0.0010087938280776143, -0.029736198484897614, -0.039577633142471313, -0.09627797454595566, 0.0736711174249649, -0.015157937072217464, -0.01426977664232254, -0.06641106307506561, 0.002918745158240199, -0.05787258222699165, 0.011557402089238167, 0.0608011856675148, -0.016579467803239822, 0.13761623203754425, 0.07185734808444977, 0.041311487555503845, 0.04542766138911247, -0.04117695987224579, -0.003794804448261857, 0.07056298106908798, -0.010122592560946941, 0.024512968957424164, -0.04234972596168518, 0.03532372787594795, -0.030317042022943497, -0.006481832824647427, -0.017962148413062096, 0.06873028725385666, 0.02253212034702301, 0.029163485392928123, -0.010426086373627186, 0.029420126229524612, 0.06900978833436966, -0.03746546432375908, 0.0078040435910224915, 0.11906007677316666, 0.08328092843294144, -0.03880493342876434, -0.022806143388152122, 0.0010885378578677773, -0.030942805111408234, 0.07933048903942108, -0.014005525968968868, -2.606842577611731e-33, 0.11533506214618683, -0.003990584053099155, -0.03337102383375168, -0.03110557608306408, -0.014113795943558216, 0.09910929948091507, 0.052837856113910675, 0.08687209337949753, -0.08671625703573227, 0.04207117483019829, -0.0910080224275589, 0.11515641212463379, 0.03533388301730156, -0.046460047364234924, -0.04103422909975052, 0.02536715380847454, 0.0060390206053853035, 0.024698764085769653, 0.02218710072338581, 0.016761930659413338, 0.061735522001981735, 0.013024688698351383, 0.041585471481084824, 0.012411369942128658, 0.004159405827522278, -0.036303721368312836, -0.009055141359567642, -0.02843141183257103, -0.0237690731883049, 0.010944630019366741, 0.002957144984975457, -0.05312059447169304, -0.007383518386632204, 0.028859475627541542, 0.04135368764400482, 0.06848020851612091, -0.025400731712579727, 0.08730724453926086, -0.10039348900318146, -0.04598308354616165, 0.04126711189746857, 0.03404301032423973, -0.011544830165803432, -0.06164959818124771, -0.09114682674407959, -0.05642324313521385, -0.09045234322547913, -0.00015092786634340882, 0.0008733227150514722, -0.02567649632692337, -0.11608633399009705, 0.07157804816961288, -0.014317428693175316, -0.004087184555828571, 0.03860493004322052, -0.0408962108194828, -0.0002459550159983337, 0.08751967549324036, -0.04696691408753395, 0.012330436147749424, 0.03494624048471451, -0.0049234055913984776, 0.049693092703819275, 0.05015099048614502, 0.011538156308233738, 0.025331195443868637, 0.024093259125947952, 0.01773522049188614, -0.0018520808080211282, -0.008786280639469624, 0.0088190957903862, 0.045144837349653244, 0.07107462733983994, -0.010621629655361176, 0.0042580231092870235, -0.1705462485551834, -0.06961090862751007, 0.06404895335435867, 0.005763056688010693, 0.01598541997373104, -0.000005792081992694875, -0.04090535268187523, -0.08100933581590652, 0.08296500146389008, -0.1148049458861351, 0.014775695279240608, -0.023926276713609695, -0.052427519112825394, -0.021109865978360176, -0.06297946721315384, 0.02711120806634426, 0.01861424185335636, -0.01966274157166481, -0.049097124487161636, -0.029758159071207047, -1.1393521239673254e-33, 0.022583985701203346, -0.11355273425579071, 0.031243933364748955, 0.013563768938183784, 0.008956433273851871, -0.032272495329380035, 0.11814238876104355, -0.03447942063212395, -0.07392242550849915, -0.05736600235104561, 0.08657996356487274, 0.011931870132684708, 0.05061563849449158, -0.03836485743522644, -0.06081772968173027, 0.13524919748306274, -0.06935253739356995, -0.09090832620859146, -0.010077343322336674, -0.03127302601933479, -0.05445389077067375, 0.07851852476596832, -0.06261155754327774, 0.08364209532737732, -0.026609208434820175, -0.09972216188907623, 0.02930554188787937, -0.05074048414826393, -0.07146167010068893, -0.009566339664161205, -0.008754132315516472, 0.026244977489113808, -0.09415668994188309, 0.0026378489565104246, -0.06189502030611038, 0.0061905221082270145, -0.02082998864352703, 0.05387933924794197, -0.010183594189584255, 0.1429480016231537, 0.0514855720102787, 0.062144357711076736, 0.006619209423661232, 0.08741934597492218, -0.004506552591919899, 0.04244871437549591, -0.09977322071790695, 0.029221726581454277, -0.00641861604526639, 0.023456063121557236, 0.017410872504115105, -0.03337412327528, -0.008833912201225758, 0.005075402557849884, 0.027239616960287094, -0.038701824843883514, -0.0631747841835022, -0.0007167342700995505, -0.10100255906581879, 0.03571583703160286, 0.030452970415353775, -0.025861632078886032, -0.06868714094161987, 0.07676047831773758, -0.022205965593457222, -0.05159828066825867, -0.07825663685798645, 0.009538172744214535, 0.03675924986600876, -0.06274784356355667, -0.017909308895468712, -0.10989794135093689, 0.08039627969264984, 0.032580453902482986, 0.0590137280523777, 0.022110801190137863, -0.0021767853759229183, -0.05890114977955818, 0.033279016613960266, 0.044579971581697464, -0.06063039228320122, 0.0601167157292366, 0.012683131732046604, 0.027521491050720215, -0.030729494988918304, 0.026155637577176094, -0.06928840279579163, 0.17962653934955597, -0.08873158693313599, -0.011534593999385834, 0.00909859873354435, -0.056104496121406555, -0.14816589653491974, -0.08069733530282974, 0.033078499138355255, -5.4413590078183915e-8, -0.038569141179323196, 0.010604331269860268, -0.018650805577635765, 0.09487976133823395, 0.018567336723208427, 0.04256879538297653, 0.029892977327108383, 0.06418659538030624, -0.04920919984579086, 0.00764031196013093, -0.016516393050551414, 0.05582128465175629, 0.023181306198239326, -0.014780471101403236, -0.01578383706510067, -0.005664648953825235, 0.024076228961348534, 0.05275801941752434, -0.010109289549291134, -0.034569740295410156, -0.05783648416399956, 0.023802297189831734, 0.06948237121105194, -0.0047211297787725925, 0.045910414308309555, 0.010507699102163315, -0.029414599761366844, 0.04624029994010925, -0.0026709733065217733, 0.026305466890335083, -0.09529195725917816, -0.006896884646266699, -0.04733184352517128, -0.04182448238134384, 0.015504778362810612, 0.030499400570988655, -0.09693296253681183, -0.006900668144226074, -0.07630184292793274, 0.04845799133181572, 0.03129589185118675, -0.0038272531237453222, -0.0038597825914621353, 0.036319393664598465, -0.04563574120402336, 0.014371213503181934, 0.012999434024095535, 0.04370031878352165, 0.06364843249320984, -0.03650897368788719, 0.025044754147529602, -0.08322431892156601, 0.011966453865170479, 0.02385018765926361, 0.025952601805329323, -0.009792258962988853, 0.008757040835916996, -0.0174317117780447, 0.0575435496866703, -0.004262746777385473, 0.06377427279949188, -0.010616214945912361, -0.0599554181098938, -0.033193737268447876 ]
0.04827
[[testing-framework]] == Java Testing Framework [[testing-intro]] Testing is a crucial part of your application, and as information retrieval itself is already a complex topic, there should not be any additional complexity in setting up a testing infrastructure, which uses Elasticsearch. This is the main reason why we decided to release an additional file to the release, which allows you to use the same testing infrastructure we do in the Elasticsearch core. The testing framework allows you to setup clusters with multiple nodes in order to check if your code covers everything needed to run in a cluster. The framework prevents you from writing complex code yourself to start, stop or manage several test nodes in a cluster. In addition there is another very important feature called randomized testing, which you are getting for free as it is part of the Elasticsearch infrastructure. [[why-randomized-testing]] === why randomized testing? The key concept of randomized testing is not to use the same input values for every testcase, but still be able to reproduce it in case of a failure. This allows to test with vastly different input variables in order to make sure, that your implementation is actually independent from your provided test data. All of the tests are run using a custom junit runner, the `RandomizedRunner` provided by the randomized-testing project. If you are interested in the implementation being used, check out the http://labs.carrotsearch.com/randomizedtesting.html[RandomizedTesting webpage]. [[using-elasticsearch-test-classes]] === Using the Elasticsearch test classes First, you need to include the testing dependency in your project, along with the Elasticsearch dependency you have already added. If you use maven and its `pom.xml` file, it looks like this [source,xml] -------------------------------------------------- org.apache.lucene lucene-test-framework ${lucene.version} test org.elasticsearch.test framework ${elasticsearch.version} test -------------------------------------------------- Replace the elasticsearch version and the lucene version with the corresponding elasticsearch version and its accompanying lucene release. We provide a few classes that you can inherit from in your own test classes which provide: \* pre-defined loggers \* randomized testing infrastructure \* a number of helper methods [[unit-tests]] === unit tests If your test is a well isolated unit test which doesn't need a running Elasticsearch cluster, you can use the `ESTestCase`. If you are testing lucene features, use `ESTestCase` and if you are testing concrete token streams, use the `ESTokenStreamTestCase` class. Those specific classes execute additional checks which ensure that no resources leaks are happening, after the test has run. [[integration-tests]] === Integration tests These kind of tests require firing up a whole cluster of nodes, before the tests can actually be run. Compared to unit tests they are obviously way more time consuming, but the test infrastructure tries to minimize the time cost by only restarting the whole cluster, if this is configured explicitly. The class your tests have to inherit from is `ESIntegTestCase`. By inheriting from this class, you will no longer need to start Elasticsearch nodes manually in your test, although you might need to ensure that at least a certain number of nodes are up. The integration test behaviour can be configured heavily by specifying different system properties on test runs. See the `TESTING.asciidoc` documentation in the https://github.com/elastic/elasticsearch/blob/master/TESTING.asciidoc[source repository] for more information. [[number-of-shards]] ==== Number of shards The number of shards used for indices created during integration tests is randomized between `1` and `10` unless overwritten upon index creation via index settings. The rule of thumb is not to specify the number of shards unless needed, so that each test will use a different one all the time. Alternatively you can override the `numberOfShards()` method. The same applies to the `numberOfReplicas()` method. [[helper-methods]] ==== Generic helper methods There are a couple
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/testing/testing-framework.asciidoc
6.2
elasticsearch-6-2
[ 0.08030780404806137, 0.033056389540433884, -0.014374727383255959, 0.029583415016531944, 0.07707106322050095, -0.026057563722133636, -0.04869306832551956, 0.0054033431224524975, -0.019254030659794807, 0.037358734756708145, -0.009161633439362049, -0.01390465721487999, 0.06563352793455124, -0.028479186818003654, -0.014442467130720615, -0.10962550342082977, -0.025094125419855118, -0.007821375504136086, -0.035863783210515976, -0.004649071954190731, 0.01572934165596962, -0.03118784911930561, 0.02791166678071022, -0.03737550973892212, -0.1367950141429901, 0.01324683427810669, -0.052032336592674255, -0.0005737821338698268, 0.009528310969471931, 0.011407352983951569, 0.05679193139076233, 0.0028626432176679373, 0.02979862317442894, 0.043742045760154724, -0.02727264165878296, 0.021290630102157593, 0.013053764589130878, -0.00909634493291378, -0.10117826610803604, 0.08232090622186661, -0.018812593072652817, -0.03049381636083126, -0.012795784510672092, -0.0631762221455574, 0.009780338034033775, -0.05298696458339691, -0.03327831253409386, -0.0029605682939291, -0.03280412778258324, -0.01177594717592001, 0.0014945357106626034, -0.053592365235090256, 0.006313692312687635, -0.04022878408432007, -0.02993742749094963, 0.034656669944524765, -0.0005981219583190978, -0.07850724458694458, -0.05568261444568634, -0.06709413230419159, 0.10081622749567032, -0.07846198230981827, 0.006889599375426769, -0.03316585347056389, 0.023740733042359352, -0.005585305858403444, 0.10190071165561676, 0.0028850226663053036, 0.117804154753685, -0.09048333019018173, 0.006175448186695576, 0.022915633395314217, 0.037155747413635254, 0.056492142379283905, 0.025594623759388924, 0.09943841397762299, 0.0034596137702465057, 0.006569946650415659, 0.07872916013002396, 0.056533344089984894, -0.017239443957805634, -0.07850303500890732, -0.04369998723268509, 0.003450709627941251, -0.06481856852769852, -0.005695412866771221, 0.10084258764982224, -0.07483907788991928, 0.0045890649780631065, 0.017666013911366463, 0.04756917431950569, -0.015448561869561672, -0.02930838242173195, -0.01938685216009617, 0.060696057975292206, 0.039624787867069244, -0.011468221433460712, 0.04055848717689514, 0.08313445746898651, -0.023454084992408752, 0.05846230313181877, -0.07211679220199585, 0.10200196504592896, -0.027454692870378494, -0.03396284580230713, 0.0038281220477074385, -0.046775247901678085, -0.053302086889743805, 0.04519238322973251, -0.05304456129670143, 0.024025902152061462, 0.035586126148700714, -0.010450899600982666, -0.002459314651787281, -0.012938138097524643, 0.0583169162273407, 0.022561129182577133, -0.016927052289247513, -0.03027367778122425, 0.13693204522132874, 0.051112402230501175, -0.008659329265356064, 0.02061828412115574, -0.06532174348831177, 0.04531416296958923, 0.11120980232954025, -0.08130019903182983, 2.8309004334150977e-33, 0.034253038465976715, -0.028744054958224297, -0.048043131828308105, 0.02350994199514389, -0.008352278731763363, 0.00363196711987257, 0.028008826076984406, 0.11889144778251648, -0.07114192843437195, -0.08129333704710007, -0.02089632675051689, 0.037755001336336136, 0.07307399809360504, -0.04243239015340805, 0.031168274581432343, 0.029831446707248688, 0.027991080656647682, -0.010983488522469997, 0.008635008707642555, 0.039085086435079575, 0.11074312031269073, -0.06459015607833862, -0.052410777658224106, -0.08480581641197205, -0.10034749656915665, -0.03898768872022629, -0.011075898073613644, -0.07385740429162979, 0.007666715886443853, 0.019377391785383224, -0.03145982697606087, 0.018652331084012985, -0.06434402614831924, 0.11746817827224731, -0.0031000005546957254, 0.02815067209303379, 0.01122323889285326, 0.010220067575573921, -0.0768127366900444, -0.05847053974866867, -0.07004313170909882, -0.03839856758713722, 0.06827934086322784, -0.051802150905132294, 0.06134552136063576, -0.060279183089733124, -0.09205591678619385, -0.03538375720381737, 0.09843961894512177, -0.04641233757138252, 0.020846471190452576, -0.007067161612212658, 0.06068367511034012, 0.019094184041023254, 0.04525410756468773, 0.09348981827497482, 0.029127290472388268, -0.02350422739982605, -0.013072388246655464, 0.11483529955148697, -0.10036059468984604, -0.043431393802165985, 0.02724478580057621, 0.09474965184926987, 0.034406162798404694, 0.006772192195057869, 0.018917609006166458, -0.06878625601530075, 0.022798243910074234, 0.004585740622133017, 0.04799526929855347, 0.003534109564498067, 0.005966731812804937, 0.01817341521382332, -0.00042341690277680755, -0.034030038863420486, 0.10584693402051926, 0.06873948127031326, -0.0623837374150753, -0.057911209762096405, -0.01555207371711731, -0.020475639030337334, 0.004381735343486071, 0.07340538501739502, -0.028759382665157318, 0.0027240687049925327, -0.008067199029028416, -0.002556373830884695, -0.0009365439182147384, -0.09306781738996506, 0.05009248107671738, 0.08835861831903458, -0.010925325565040112, -0.06786781549453735, 0.05298137664794922, -3.4626735456843824e-33, 0.030511049553751945, -0.01988825760781765, -0.03567628934979439, -0.017040390521287918, 0.06633257865905762, 0.0010456354357302189, 0.004564271774142981, -0.042897194623947144, -0.09921883046627045, -0.0534990094602108, -0.02392328903079033, -0.09547071903944016, 0.030931809917092323, -0.0467899851500988, -0.11011295765638351, -0.006165096536278725, 0.017338989302515984, -0.10377601534128189, 0.08287473767995834, -0.0015753046609461308, -0.02531314082443714, -0.0017435889458283782, -0.013062474317848682, -0.01724068820476532, -0.02588513121008873, -0.09817492216825485, -0.05372372642159462, -0.023034319281578064, -0.011982702650129795, 0.029785390943288803, -0.013355376198887825, 0.05821561440825462, 0.01134275272488594, 0.03125999495387077, 0.0076546436175704, -0.012881474569439888, 0.06842874735593796, -0.04535973444581032, 0.06346123665571213, 0.03763670474290848, -0.02428700216114521, 0.09049612283706665, -0.016631754115223885, -0.0037670056335628033, 0.09393054991960526, 0.03188062831759453, -0.012103758752346039, 0.06902678310871124, 0.0010118174832314253, -0.02115580439567566, -0.03828331083059311, -0.034625183790922165, 0.011891777627170086, -0.005247526802122593, -0.049834538251161575, 0.015449879691004753, -0.08540484309196472, 0.08767959475517273, -0.08897480368614197, 0.10631637275218964, 0.015398439951241016, 0.011075570248067379, -0.05607876926660538, 0.06141882762312889, -0.021150732412934303, -0.06216511130332947, 0.0008576054824516177, -0.06637850403785706, -0.09197290986776352, 0.00962910521775484, -0.10019543766975403, -0.017930958420038223, -0.0013803648762404919, 0.05002043396234512, 0.08207087963819504, 0.02448458783328533, 0.01617426797747612, -0.0032967189326882362, 0.03778722137212753, 0.020306766033172607, -0.0060554202646017075, 0.03802817687392235, -0.029771754518151283, 0.033107690513134, 0.005284236278384924, 0.10291772335767746, 0.0580376572906971, 0.0662907063961029, 0.01116066612303257, 0.036043450236320496, -0.008209624327719212, 0.0036766640841960907, -0.05302409455180168, -0.01627078466117382, 0.003926967736333609, -6.064922786208626e-8, 0.04005676507949829, -0.005784743465483189, -0.08344750106334686, 0.0478830523788929, -0.028528032824397087, 0.061567239463329315, -0.016575800254940987, 0.07161213457584381, 0.0062484415248036385, 0.020821282640099525, -0.02247719094157219, 0.03113843873143196, -0.11040797084569931, 0.07402963936328888, 0.0060410527512431145, 0.00844330433756113, -0.00699473125860095, 0.02702072076499462, -0.053436990827322006, 0.06445685774087906, -0.015536858700215816, -0.007338004186749458, -0.021070780232548714, 0.06344696134328842, 0.028288472443819046, -0.014339559711515903, 0.14738626778125763, 0.014428216964006424, -0.002822995651513338, -0.06910784542560577, -0.07326392084360123, -0.01590782403945923, -0.03088545985519886, 0.0301030483096838, -0.06710510700941086, 0.06851473450660706, -0.050995904952287674, 0.04189677536487579, -0.0156472846865654, 0.1075248122215271, 0.03366222605109215, 0.054682470858097076, -0.025599738582968712, -0.040212564170360565, 0.009423310868442059, -0.04430412873625755, -0.05252210050821304, 0.054352011531591415, 0.013352520763874054, -0.05438747629523277, -0.0330425463616848, -0.024872247129678726, -0.03315160796046257, 0.014197468757629395, 0.042780086398124695, 0.04895363375544548, -0.04236562177538872, -0.03224463760852814, 0.06675399839878082, 0.03614550456404686, 0.0710119754076004, -0.030258826911449432, -0.035467907786369324, -0.05368148535490036 ]
0.096516
settings. The rule of thumb is not to specify the number of shards unless needed, so that each test will use a different one all the time. Alternatively you can override the `numberOfShards()` method. The same applies to the `numberOfReplicas()` method. [[helper-methods]] ==== Generic helper methods There are a couple of helper methods in `ESIntegTestCase`, which will make your tests shorter and more concise. [horizontal] `refresh()`:: Refreshes all indices in a cluster `ensureGreen()`:: Ensures a green health cluster state, waiting for relocations. Waits the default timeout of 30 seconds before failing. `ensureYellow()`:: Ensures a yellow health cluster state, also waits for 30 seconds before failing. `createIndex(name)`:: Creates an index with the specified name `flush()`:: Flushes all indices in a cluster `flushAndRefresh()`:: Combines `flush()` and `refresh()` calls `forceMerge()`:: Waits for all relocations and force merges all indices in the cluster to one segment. `indexExists(name)`:: Checks if given index exists `admin()`:: Returns an `AdminClient` for administrative tasks `clusterService()`:: Returns the cluster service java class `cluster()`:: Returns the test cluster class, which is explained in the next paragraphs [[test-cluster-methods]] ==== Test cluster methods The `InternalTestCluster` class is the heart of the cluster functionality in a randomized test and allows you to configure a specific setting or replay certain types of outages to check, how your custom code reacts. [horizontal] `ensureAtLeastNumNodes(n)`:: Ensure at least the specified number of nodes is running in the cluster `ensureAtMostNumNodes(n)`:: Ensure at most the specified number of nodes is running in the cluster `getInstance()`:: Get a guice instantiated instance of a class from a random node `getInstanceFromNode()`:: Get a guice instantiated instance of a class from a specified node `stopRandomNode()`:: Stop a random node in your cluster to mimic an outage `stopCurrentMasterNode()`:: Stop the current master node to force a new election `stopRandomNonMaster()`:: Stop a random non master node to mimic an outage `buildNode()`:: Create a new Elasticsearch node `startNode(settings)`:: Create and start a new Elasticsearch node [[changing-node-settings]] ==== Changing node settings If you want to ensure a certain configuration for the nodes, which are started as part of the `EsIntegTestCase`, you can override the `nodeSettings()` method [source,java] ----------------------------------------- public class Mytests extends ESIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder().put(super.nodeSettings(nodeOrdinal)) .put("node.mode", "network") .build(); } } ----------------------------------------- [[accessing-clients]] ==== Accessing clients In order to execute any actions, you have to use a client. You can use the `ESIntegTestCase.client()` method to get back a random client. This client can be a `TransportClient` or a `NodeClient` - and usually you do not need to care as long as the action gets executed. There are several more methods for client selection inside of the `InternalTestCluster` class, which can be accessed using the `ESIntegTestCase.internalCluster()` method. [horizontal] `iterator()`:: An iterator over all available clients `masterClient()`:: Returns a client which is connected to the master node `nonMasterClient()`:: Returns a client which is not connected to the master node `clientNodeClient()`:: Returns a client, which is running on a client node `client(String nodeName)`:: Returns a client to a given node `smartClient()`:: Returns a smart client [[scoping]] ==== Scoping By default the tests are run with unique cluster per test suite. Of course all indices and templates are deleted between each test. However, sometimes you need to start a new cluster for each test - for example, if you load a certain plugin, but you do not want to load it for every test. You can use the `@ClusterScope` annotation at class level to configure this behaviour [source,java] ----------------------------------------- @ClusterScope(scope=TEST, numDataNodes=1) public class CustomSuggesterSearchTests extends ESIntegTestCase { // ... tests go here } ----------------------------------------- The above sample configures the test to use a new cluster for
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/testing/testing-framework.asciidoc
6.2
elasticsearch-6-2
[ 0.04965706169605255, -0.0375848188996315, 0.04480714350938797, 0.04592162370681763, 0.015618688426911831, -0.06320268660783768, -0.08007856458425522, 0.014509438537061214, -0.0014586610486730933, -0.0219226386398077, 0.028635287657380104, -0.038148943334817886, 0.03274963051080704, -0.036330558359622955, -0.06925465166568756, -0.107638880610466, -0.005148419179022312, -0.05656136944890022, -0.008504162542521954, -0.04618602618575096, 0.019474728032946587, -0.01649356447160244, 0.0051049464382231236, -0.016318220645189285, -0.060188353061676025, -0.050879232585430145, -0.06907221674919128, -0.04285639896988869, 0.06189234182238579, -0.03294965997338295, 0.06796368956565857, 0.043198373168706894, -0.019751857966184616, 0.04626143351197243, -0.008752900175750256, 0.07533686608076096, 0.03247171267867088, -0.05146365240216255, -0.13323712348937988, 0.001013986417092383, 0.02889241836965084, -0.022692974656820297, -0.029012324288487434, 0.016145654022693634, 0.07754405587911606, -0.05408332124352455, -0.0721815750002861, -0.0004599473613779992, -0.011480866000056267, 0.022918488830327988, -0.027823440730571747, -0.04700136184692383, -0.0328788198530674, 0.07184146344661713, 0.02911936491727829, 0.04310862347483635, 0.01046278141438961, -0.060510553419589996, 0.027802851051092148, -0.038414642214775085, 0.08718101680278778, -0.057806797325611115, 0.038808323442935944, -0.052616018801927567, 0.0032135634683072567, 0.04376528412103653, 0.15119580924510956, -0.04238272085785866, 0.05671624094247818, 0.010863511823117733, -0.018830636516213417, 0.05924120917916298, -0.0012683062814176083, 0.06660934537649155, -0.036597561091184616, 0.12305126339197159, -0.012861710973083973, -0.026730898767709732, -0.011396861635148525, -0.000021590905816992745, -0.07937098294496536, -0.03655674308538437, 0.04607633128762245, 0.0031178437639027834, 0.02110440284013748, 0.016231629997491837, 0.03594692423939705, -0.02823331579566002, 0.022934235632419586, -0.04413814842700958, 0.09074706584215164, 0.024095850065350533, -0.02798101305961609, -0.03920109570026398, 0.040572382509708405, 0.06259632855653763, -0.03835499286651611, 0.042923957109451294, 0.038449231535196304, 0.010270178318023682, -0.019939476624131203, -0.05569150671362877, 0.009012521244585514, 0.010440932586789131, -0.060083650052547455, -0.014750035479664803, -0.030051684007048607, -0.001173798693343997, -0.024003302678465843, 0.018196703866124153, 0.066523477435112, 0.04180840402841568, 0.05863143131136894, 0.028326893225312233, -0.011372602544724941, 0.1246412843465805, 0.053112804889678955, -0.04085606336593628, 0.04556107521057129, 0.05125465616583824, 0.10529071092605591, 0.022886382415890694, 0.09345885366201401, -0.05713142827153206, 0.017572203651070595, 0.09482324123382568, -0.034155674278736115, 2.5128719061680663e-33, 0.038155436515808105, -0.05825234577059746, 0.03590831905603409, 0.0013821842148900032, 0.0036913668736815453, 0.01790553703904152, -0.010588287375867367, 0.055962178856134415, -0.07098834216594696, -0.08244463056325912, -0.09268808364868164, 0.0657132938504219, 0.05092659965157509, -0.08797760307788849, -0.003825858235359192, -0.040246106684207916, 0.07594849169254303, 0.05597987398505211, -0.03003510646522045, -0.007152607664465904, 0.08138096332550049, -0.14674347639083862, -0.001988689647987485, -0.05597604438662529, -0.039526768028736115, 0.04123706370592117, -0.002818196313455701, -0.05162568762898445, 0.04766606539487839, 0.010193909518420696, -0.03271707519888878, 0.019770735874772072, -0.047333527356386185, 0.05780847370624542, -0.003937222063541412, 0.025530975311994553, -0.0018589382525533438, 0.02309638261795044, -0.01637950912117958, -0.07222004234790802, -0.026426028460264206, 0.04662320390343666, 0.041013263165950775, -0.06581230461597443, 0.05211004987359047, -0.07025779783725739, -0.08728405088186264, -0.017658963799476624, 0.02303045429289341, 0.023244591429829597, -0.018482204526662827, -0.000758644484449178, 0.017906557768583298, -0.017248723655939102, -0.0054621570743620396, 0.0319201797246933, 0.029283108189702034, 0.012582216411828995, -0.0007405741489492357, 0.10427659004926682, 0.0022760273423045874, -0.028253883123397827, -0.036984410136938095, 0.04261297732591629, -0.028069673106074333, 0.0574517585337162, -0.024220095947384834, 0.027168909087777138, 0.03300319239497185, 0.08354439586400986, -0.007603161968290806, 0.03823414444923401, -0.03625006601214409, 0.025252683088183403, -0.010762176476418972, -0.11773528903722763, -0.024664731696248055, -0.0240903552621603, -0.16805201768875122, -0.01792186312377453, 0.0055604116059839725, 0.022977206856012344, -0.06148107722401619, 0.02847089059650898, 0.012853444553911686, -0.04699035361409187, -0.030047453939914703, 0.010418365709483624, -0.05219952017068863, -0.13792690634727478, 0.03334468975663185, -0.005053739529103041, 0.05628276988863945, -0.06500301510095596, -0.07664874941110611, -3.126715790851434e-33, 0.084966279566288, -0.0653771311044693, 0.033936820924282074, 0.0847158432006836, 0.07842396944761276, -0.05012280121445656, 0.062279026955366135, 0.07338427752256393, -0.013321198523044586, -0.06297270953655243, 0.0015087351202964783, -0.028705397620797157, 0.028908761218190193, -0.02094084396958351, -0.09365642070770264, 0.07844369858503342, 0.014920727349817753, -0.11324598640203476, 0.03181228041648865, 0.01885857619345188, -0.05632330849766731, -0.04280184581875801, 0.031759437173604965, 0.02394743077456951, -0.09007690101861954, 0.04906458780169487, 0.009928633458912373, -0.05936630442738533, -0.06116033345460892, -0.048436492681503296, -0.025776240974664688, -0.012280435301363468, -0.07307228446006775, 0.015724478289484978, 0.002024431712925434, 0.000039581351302331313, 0.012167108245193958, -0.039885081350803375, 0.006729588378220797, 0.0899486094713211, 0.11572162061929703, 0.0616525374352932, -0.07046492397785187, 0.013230368494987488, -0.02556745707988739, 0.07317741960287094, -0.004240507259964943, -0.008216350339353085, -0.04984712228178978, -0.04288361221551895, -0.0009894132381305099, -0.037570059299468994, 0.002732967957854271, 0.0847305878996849, 0.00029492395697161555, 0.005447442177683115, -0.04785667359828949, 0.044171251356601715, -0.16690951585769653, 0.025502264499664307, 0.008639312349259853, -0.03678657487034798, -0.05828108265995979, 0.061406027525663376, 0.014496617950499058, -0.03926204890012741, 0.031919099390506744, -0.044926270842552185, -0.012077929452061653, -0.0322549007833004, -0.04495920240879059, 0.02564331702888012, -0.05647183209657669, -0.02327081933617592, 0.04400808364152908, -0.02898419089615345, -0.05235796794295311, -0.0606674998998642, 0.014837244525551796, 0.01144537515938282, -0.05157928913831711, 0.037421729415655136, -0.006666163448244333, 0.022969922050833702, 0.015116042457520962, 0.04401152953505516, 0.0408170185983181, 0.12266600131988525, 0.035249076783657074, 0.06932077556848526, -0.07561930269002914, 0.02608746849000454, -0.024809835478663445, 0.016650313511490822, 0.03881304711103439, -5.125097146674307e-8, 0.0868879109621048, -0.03528868407011032, -0.007089377846568823, 0.04938310384750366, -0.03508219122886658, -0.03834346681833267, -0.0781748965382576, 0.06360174715518951, -0.04079733043909073, 0.021795334294438362, 0.024115603417158127, 0.036392465233802795, -0.049181804060935974, -0.012935451231896877, 0.04300972819328308, -0.020542368292808533, 0.019133370369672775, 0.033297885209321976, -0.0671788677573204, -0.03163684904575348, -0.08859042823314667, 0.02877902053296566, 0.04467155784368515, 0.020816490054130554, -0.01305488869547844, 0.04237261041998863, 0.08077447861433029, 0.00824347697198391, 0.008436813950538635, -0.04532330110669136, -0.03351011499762535, -0.04858057200908661, 0.009144519455730915, 0.022239698097109795, -0.08153392374515533, 0.07668821513652802, -0.03202309086918831, 0.11505764722824097, 0.05557743459939957, 0.11288408190011978, -0.012360653840005398, 0.011158126406371593, -0.04660115763545036, -0.014515827409923077, 0.03143389895558357, -0.043861426413059235, -0.08044498413801193, 0.045186858624219894, 0.038797929883003235, -0.037450361996889114, -0.03877686709165573, -0.04109933599829674, -0.04409951716661453, 0.036217764019966125, -0.009404357522726059, -0.005239108111709356, -0.01067576464265585, -0.044364262372255325, 0.061161283403635025, 0.023878661915659904, 0.1158457025885582, -0.0784447193145752, -0.019892338663339615, -0.03912918269634247 ]
0.131735
not want to load it for every test. You can use the `@ClusterScope` annotation at class level to configure this behaviour [source,java] ----------------------------------------- @ClusterScope(scope=TEST, numDataNodes=1) public class CustomSuggesterSearchTests extends ESIntegTestCase { // ... tests go here } ----------------------------------------- The above sample configures the test to use a new cluster for each test method. The default scope is `SUITE` (one cluster for all test methods in the test). The `numDataNodes` settings allows you to only start a certain number of data nodes, which can speed up test execution, as starting a new node is a costly and time consuming operation and might not be needed for this test. By default, the testing infrastructure will randomly start dedicated master nodes. If you want to disable dedicated masters you can set `supportsDedicatedMasters=false` in a similar fashion to the `numDataNodes` setting. If dedicated master nodes are not used, data nodes will be allowed to become masters as well. [[changing-node-configuration]] ==== Changing plugins via configuration As Elasticsearch is using JUnit 4, using the `@Before` and `@After` annotations is not a problem. However you should keep in mind, that this does not have any effect in your cluster setup, as the cluster is already up and running when those methods are run. So in case you want to configure settings - like loading a plugin on node startup - before the node is actually running, you should overwrite the `nodePlugins()` method from the `ESIntegTestCase` class and return the plugin classes each node should load. [source,java] ----------------------------------------- @Override protected Collection> nodePlugins() { return Arrays.asList(CustomSuggesterPlugin.class); } ----------------------------------------- [[randomized-testing]] === Randomized testing The code snippets you saw so far did not show any trace of randomized testing features, as they are carefully hidden under the hood. However when you are writing your own tests, you should make use of these features as well. Before starting with that, you should know, how to repeat a failed test with the same setup, how it failed. Luckily this is quite easy, as the whole mvn call is logged together with failed tests, which means you can simply copy and paste that line and run the test. [[generating-random-data]] ==== Generating random data The next step is to convert your test using static test data into a test using randomized test data. The kind of data you could randomize varies a lot with the functionality you are testing against. Take a look at the following examples (note, that this list could go on for pages, as a distributed system has many, many moving parts): \* Searching for data using arbitrary UTF8 signs \* Changing your mapping configuration, index and field names with each run \* Changing your response sizes/configurable limits with each run \* Changing the number of shards/replicas when creating an index So, how can you create random data. The most important thing to know is, that you never should instantiate your own `Random` instance, but use the one provided in the `RandomizedTest`, from which all Elasticsearch dependent test classes inherit from. [horizontal] `getRandom()`:: Returns the random instance, which can recreated when calling the test with specific parameters `randomBoolean()`:: Returns a random boolean `randomByte()`:: Returns a random byte `randomShort()`:: Returns a random short `randomInt()`:: Returns a random integer `randomLong()`:: Returns a random long `randomFloat()`:: Returns a random float `randomDouble()`:: Returns a random double `randomInt(max)`:: Returns a random integer between 0 and max `between()`:: Returns a random between the supplied range `atLeast()`:: Returns a random integer of at least the specified integer `atMost()`:: Returns a random integer of at most the specified integer `randomLocale()`:: Returns a random locale `randomTimeZone()`:: Returns a random timezone `randomFrom()`::
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/testing/testing-framework.asciidoc
6.2
elasticsearch-6-2
[ 0.015220938250422478, -0.014843382872641087, -0.014756220392882824, 0.010827714577317238, 0.014394337311387062, -0.049620307981967926, -0.03342558443546295, -0.0029406908433884382, -0.039558738470077515, -0.002106752712279558, -0.007570287678390741, -0.057555489242076874, 0.07799363881349564, -0.045831624418497086, 0.014336645603179932, -0.08432230353355408, 0.03436291590332985, 0.012336159124970436, 0.03096383437514305, -0.01854044385254383, -0.004295710939913988, -0.019917896017432213, 0.025914635509252548, -0.03959689289331436, -0.026488397270441055, -0.0021245297975838184, 0.008882793597877026, -0.07411246001720428, 0.05065299570560455, -0.04162655025720596, 0.02599981240928173, 0.05751459300518036, -0.06588801741600037, 0.0594426728785038, 0.060941968113183975, 0.040278345346450806, 0.0021175171714276075, 0.04436396807432175, -0.07855574786663055, 0.07635245472192764, 0.058994781225919724, 0.001396440202370286, 0.0423152819275856, -0.024031268432736397, 0.01753341592848301, -0.0758708044886589, -0.08352554589509964, -0.007233170326799154, 0.007719251327216625, -0.005343351047486067, 0.02462594397366047, -0.0920354425907135, -0.025259237736463547, 0.0005643550539389253, -0.017037706449627876, -0.035332679748535156, 0.08177794516086578, -0.013058332726359367, -0.006102811545133591, 0.0012593960855156183, 0.03956066071987152, -0.09594141691923141, 0.04826393723487854, -0.030428212136030197, -0.03523305431008339, -0.001123257097788155, 0.11179571598768234, -0.023905741050839424, 0.06836563348770142, -0.02742329053580761, 0.009337221272289753, 0.025729933753609657, 0.055805742740631104, 0.06772672384977341, -0.00871890876442194, 0.09607706218957901, 0.011992772109806538, 0.016620760783553123, 0.06852420419454575, -0.026534048840403557, -0.046480633318424225, -0.025967970490455627, 0.018254250288009644, -0.04967767372727394, 0.0008646903443150222, 0.07121454924345016, 0.011439427733421326, -0.08847907930612564, 0.042897794395685196, 0.06622781604528427, 0.028106797486543655, -0.005831321235746145, -0.11921360343694687, 0.0009991397382691503, -0.013688381761312485, 0.016797486692667007, -0.05568726733326912, 0.020125357434153557, 0.08548012375831604, 0.021573621779680252, 0.02444584295153618, 0.004133320413529873, 0.05470661073923111, 0.10825149714946747, -0.11039674282073975, -0.017170842736959457, 0.016730619594454765, -0.1006680428981781, -0.004560923203825951, -0.02795964479446411, 0.024982284754514694, 0.03421053662896156, 0.02418407052755356, -0.07786659151315689, -0.07639137655496597, 0.030268169939517975, 0.05340969190001488, 0.004056474659591913, -0.03592086583375931, 0.03309322148561478, 0.015428292565047741, -0.017732534557580948, 0.029157347977161407, -0.07175983488559723, 0.09936752915382385, 0.12099393457174301, -0.07675360143184662, -5.734012219485178e-33, 0.013025949709117413, -0.09121713042259216, 0.030093910172581673, 0.021573763340711594, -0.04623134806752205, -0.00540219945833087, 0.009515918791294098, 0.09644509106874466, -0.027956170961260796, -0.06534532457590103, -0.034666307270526886, 0.008321573957800865, -0.005116638727486134, -0.0617404505610466, 0.02485639415681362, 0.04446126148104668, 0.06939216703176498, -0.018433157354593277, -0.050204284489154816, -0.00810955185443163, 0.06413013488054276, -0.06826881319284439, -0.04706363007426262, -0.07851534336805344, -0.09619595110416412, 0.05360642448067665, 0.033380478620529175, -0.02519749104976654, 0.006914904341101646, 0.05158267915248871, 0.02256101369857788, 0.019931558519601822, -0.08268438279628754, 0.14855609834194183, 0.0014568247133865952, -0.006886895280331373, 0.050867799669504166, 0.04017321765422821, -0.033787861466407776, -0.039178162813186646, -0.1090506911277771, 0.04280203953385353, 0.10222331434488297, -0.03440462052822113, 0.004031183198094368, -0.08166881650686264, -0.08788583427667618, -0.02172158472239971, 0.10094178467988968, -0.02944495901465416, -0.006805087439715862, 0.011038371361792088, 0.02783309295773506, -0.06111583113670349, -0.0003871796652674675, 0.07422289252281189, -0.0087819192558527, 0.001274540787562728, -0.005719743203371763, 0.07755553722381592, -0.10359940677881241, -0.07662959396839142, -0.03186224400997162, 0.07899148017168045, 0.03563416749238968, 0.061416145414114, -0.028285617008805275, -0.08140993863344193, 0.03516656532883644, 0.030742762610316277, 0.064505435526371, -0.0034244104754179716, -0.018005581572651863, 0.006588462740182877, 0.013808471150696278, -0.0775245949625969, 0.06809742003679276, 0.08405355364084244, -0.09816475957632065, -0.04572334140539169, 0.03161934018135071, -0.04123539850115776, 0.00009243386011803523, 0.03449484705924988, 0.05229038745164871, -0.002920572878792882, -0.026204083114862442, -0.07070119678974152, 0.06496382504701614, -0.0958445817232132, 0.045331019908189774, 0.055573590099811554, -0.009209876880049706, -0.07133807986974716, -0.04342390224337578, 3.8354970074110255e-33, 0.07291246950626373, 0.04201328381896019, -0.048764608800411224, 0.0470312125980854, 0.06812883913516998, 0.00411104504019022, -0.012601818889379501, 0.028245938941836357, -0.09537924081087112, 0.046994056552648544, -0.009237252175807953, -0.062136419117450714, -0.0063651204109191895, -0.06841309368610382, -0.06529700011014938, 0.006751180160790682, 0.05331408232450485, -0.0609096921980381, 0.027958782389760017, 0.001896433997899294, -0.047464270144701004, 0.02470778487622738, 0.03915144503116608, -0.03330715000629425, -0.04702385142445564, -0.038887254893779755, -0.08607755601406097, -0.005019024014472961, -0.0570344515144825, 0.03707478195428848, -0.00349295767955482, 0.0006792229251004755, -0.04427960515022278, 0.0013128569116815925, -0.0011096947127953172, -0.011405562981963158, 0.06396090984344482, 0.023161878809332848, -0.009819984436035156, 0.09677357226610184, 0.002891003154218197, 0.019037922844290733, -0.040925681591033936, 0.0448157824575901, 0.019360002130270004, -0.04035931080579758, -0.022522898390889168, 0.00890534371137619, -0.039046090096235275, 0.04432809725403786, -0.05829061567783356, 0.010562271811068058, 0.02579890377819538, 0.03937777131795883, -0.026498442515730858, 0.01647917367517948, -0.018586616963148117, 0.04495518282055855, -0.03614792227745056, 0.04689239710569382, 0.06417164951562881, -0.031017791479825974, -0.09186024963855743, 0.05174611881375313, -0.010611806064844131, -0.024775709956884384, 0.06378641724586487, 0.030895991250872612, -0.0518234558403492, -0.010090016759932041, -0.11038810759782791, 0.02418578788638115, -0.00806533545255661, -0.0028365624602884054, 0.04900297522544861, 0.013442955911159515, -0.008366154506802559, -0.06974456459283829, 0.07265164703130722, -0.018706096336245537, -0.03605916351079941, -0.033234406262636185, -0.0828777328133583, -0.005138863809406757, 0.0583333745598793, 0.03301692008972168, 0.06130744889378548, 0.08869283646345139, 0.016285501420497894, 0.025544077157974243, -0.030213642865419388, -0.0016287602484226227, -0.009270594455301762, 0.009340484626591206, 0.010279195383191109, -5.1551133140037564e-8, -0.004894504323601723, -0.05225633829832077, -0.10023628920316696, 0.02678966335952282, 0.025372635573148727, -0.03730160370469093, -0.06461500376462936, 0.11604058742523193, -0.008180126547813416, 0.05484591796994209, 0.05480211600661278, 0.10848530381917953, -0.012069793418049812, 0.005218947771936655, 0.040339354425668716, -0.018737969920039177, 0.043434713035821915, -0.01946190558373928, -0.08374567329883575, 0.04329145327210426, -0.05155009403824806, 0.06012634560465813, -0.022771798074245453, 0.012722434476017952, -0.006806890945881605, 0.045950748026371, 0.13479647040367126, 0.02653113193809986, 0.0339035801589489, -0.025066368281841278, -0.0935903862118721, -0.02136739157140255, -0.06875625997781754, -0.005677328445017338, -0.12439632415771484, 0.0912046805024147, -0.004258621484041214, 0.06977734714746475, 0.06990475952625275, 0.13727474212646484, -0.039357252418994904, -0.006706452462822199, -0.0010742106242105365, 0.007405879907310009, -0.03509672358632088, -0.0014749562833458185, -0.10823759436607361, 0.016670847311615944, 0.017654340714216232, -0.0005796323530375957, -0.10848329216241837, -0.02210536040365696, -0.06084704399108887, 0.005855252966284752, -0.006827113684266806, -0.04199538007378578, 0.004756874404847622, -0.02424067072570324, 0.005280788522213697, 0.04996179789304733, 0.06120952218770981, -0.06102130562067032, 0.01936175487935543, -0.05370562896132469 ]
0.111347
`randomInt(max)`:: Returns a random integer between 0 and max `between()`:: Returns a random between the supplied range `atLeast()`:: Returns a random integer of at least the specified integer `atMost()`:: Returns a random integer of at most the specified integer `randomLocale()`:: Returns a random locale `randomTimeZone()`:: Returns a random timezone `randomFrom()`:: Returns a random element from a list/array In addition, there are a couple of helper methods, allowing you to create random ASCII and Unicode strings, see methods beginning with `randomAscii`, `randomUnicode`, and `randomRealisticUnicode` in the random test class. The latter one tries to create more realistic unicode string by not being arbitrary random. If you want to debug a specific problem with a specific random seed, you can use the `@Seed` annotation to configure a specific seed for a test. If you want to run a test more than once, instead of starting the whole test suite over and over again, you can use the `@Repeat` annotation with an arbitrary value. Each iteration than gets run with a different seed. [[assertions]] === Assertions As many Elasticsearch tests are checking for a similar output, like the amount of hits or the first hit or special highlighting, a couple of predefined assertions have been created. Those have been put into the `ElasticsearchAssertions` class. There is also a specific geo assertions in `ElasticsearchGeoAssertions`. [horizontal] `assertHitCount()`:: Checks hit count of a search or count request `assertAcked()`:: Ensure the a request has been acknowledged by the master `assertSearchHits()`:: Asserts a search response contains specific ids `assertMatchCount()`:: Asserts a matching count from a percolation response `assertFirstHit()`:: Asserts the first hit hits the specified matcher `assertSecondHit()`:: Asserts the second hit hits the specified matcher `assertThirdHit()`:: Asserts the third hits hits the specified matcher `assertSearchHit()`:: Assert a certain element in a search response hits the specified matcher `assertNoFailures()`:: Asserts that no shard failures have occurred in the response `assertFailures()`:: Asserts that shard failures have happened during a search request `assertHighlight()`:: Assert specific highlights matched `assertSuggestion()`:: Assert for specific suggestions `assertSuggestionSize()`:: Assert for specific suggestion count `assertThrows()`:: Assert a specific exception has been thrown Common matchers [horizontal] `hasId()`:: Matcher to check for a search hit id `hasType()`:: Matcher to check for a search hit type `hasIndex()`:: Matcher to check for a search hit index `hasScore()`:: Matcher to check for a certain score of a hit `hasStatus()`:: Matcher to check for a certain `RestStatus` of a response Usually, you would combine assertions and matchers in your test like this [source,java] ---------------------------- SearchResponse searchResponse = client().prepareSearch() ...; assertHitCount(searchResponse, 4); assertFirstHit(searchResponse, hasId("4")); assertSearchHits(searchResponse, "1", "2", "3", "4"); ----------------------------
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/testing/testing-framework.asciidoc
6.2
elasticsearch-6-2
[ -0.013342206366360188, 0.035932425409555435, -0.042580604553222656, 0.014535014517605305, -0.008389054797589779, -0.049084536731243134, 0.02879757061600685, -0.024361226707696915, -0.007172638550400734, -0.030549466609954834, 0.008949999697506428, -0.049083516001701355, 0.04156837612390518, -0.0112308319658041, -0.015183143317699432, -0.11421225965023041, -0.011548303067684174, -0.028796197846531868, 0.0007712175720371306, -0.02060369774699211, 0.05932065099477768, -0.029833946377038956, 0.023162340745329857, 0.02118714712560177, 0.02099032886326313, -0.12252691388130188, 0.023546641692519188, 0.0386052280664444, 0.06536846607923508, 0.012500748969614506, 0.0857948437333107, 0.07387236505746841, 0.02320324257016182, -0.03515190631151199, 0.05064728483557701, 0.0480114221572876, -0.06177030876278877, -0.06677332520484924, -0.044470854103565216, -0.0006331101758405566, 0.015707075595855713, -0.025896012783050537, 0.0030733486637473106, 0.08129086345434189, 0.04762062802910805, -0.0012266188859939575, -0.00537783233448863, 0.012992286123335361, -0.029373664408922195, 0.039528992027044296, -0.00012111107935197651, 0.04860101267695427, 0.013789708726108074, -0.064886175096035, -0.002455215435475111, -0.01915626972913742, 0.02666659839451313, -0.01914350874722004, -0.037703804671764374, -0.045389752835035324, -0.005407020449638367, -0.014496098272502422, -0.05285271629691124, -0.003059529000893235, 0.005301305558532476, -0.04785425215959549, 0.009547467343509197, 0.052088815718889236, 0.056249070912599564, -0.014199313707649708, -0.07237230241298676, 0.015936309471726418, 0.015259899199008942, 0.2077241986989975, 0.09952352195978165, 0.0977143868803978, -0.051615118980407715, -0.08163009583950043, -0.01642470620572567, -0.004157616291195154, -0.05014082044363022, -0.09084661304950714, 0.08151526749134064, -0.01641697995364666, 0.05894271656870842, 0.02844185195863247, 0.10261773318052292, 0.09439267218112946, 0.09760718047618866, 0.04398529231548309, -0.012945052236318588, 0.028682559728622437, -0.06130046397447586, 0.05873367190361023, 0.08426467329263687, 0.032791972160339355, 0.11849489063024521, -0.04525836184620857, 0.03264118731021881, 0.016394227743148804, 0.01599213294684887, -0.05261359363794327, 0.031102964654564857, -0.0031672348268330097, -0.004045255947858095, -0.02525668404996395, -0.03082052618265152, -0.12172190845012665, 0.01407780684530735, -0.07051166892051697, -0.0004445025115273893, 0.01591467298567295, 0.04006866365671158, -0.0341765470802784, 0.017498759552836418, 0.01597420498728752, -0.07860897481441498, 0.0337512344121933, -0.045808788388967514, 0.037432409822940826, -0.04620042443275452, 0.01773054711520672, -0.057296186685562134, -0.0038726888597011566, -0.020271850749850273, 0.06923933327198029, 0.07224065810441971, 9.511137850854215e-34, 0.053208235651254654, -0.07728511095046997, -0.018939917907118797, 0.01731730066239834, 0.003703411901369691, 0.032105810940265656, 0.01686212606728077, 0.042373135685920715, 0.007486223708838224, 0.0505451075732708, 0.0110439108684659, -0.022065961733460426, 0.046216949820518494, 0.053142156451940536, 0.04336940869688988, 0.07194743305444717, 0.03340676426887512, -0.023946622386574745, 0.030715281143784523, -0.018416987732052803, 0.054061006754636765, -0.013210699893534184, -0.023334220051765442, -0.1271471232175827, 0.001413197023794055, 0.05162878707051277, 0.01633894257247448, -0.03247251361608505, 0.002185060176998377, 0.058200836181640625, -0.1077677309513092, 0.008330818265676498, -0.06143943965435028, 0.052388157695531845, 0.06124073266983032, 0.029306240379810333, -0.037290386855602264, 0.049474626779556274, -0.1884927898645401, -0.014615138061344624, 0.018476031720638275, -0.03168056532740593, 0.027768833562731743, 0.012983370572328568, 0.08305481821298599, -0.033190205693244934, -0.02124820090830326, -0.010230746120214462, 0.031492993235588074, -0.016022536903619766, -0.028438305482268333, 0.05898424983024597, -0.009630944579839706, -0.02946513146162033, 0.03977955877780914, -0.01234638225287199, 0.09670453518629074, 0.028884204104542732, -0.06668870896100998, 0.0767781063914299, -0.05327465757727623, 0.015851270407438278, -0.012904887087643147, 0.061366330832242966, -0.04921633377671242, -0.002913760719820857, -0.05746784433722496, -0.07572732865810394, 0.06138742342591286, 0.08400788903236389, 0.03613736480474472, -0.004638925194740295, -0.027437621727585793, 0.027570240199565887, -0.10088303685188293, 0.011844364926218987, 0.09119053184986115, 0.0022038358729332685, -0.007741045672446489, -0.042732179164886475, 0.05216388404369354, 0.005664106458425522, -0.05884099379181862, -0.04437665268778801, -0.10232602059841156, 0.026957878842949867, 0.014336888678371906, -0.04369093477725983, -0.02072804607450962, -0.1508743315935135, 0.007885126397013664, -0.042565569281578064, 0.09555438160896301, -0.05446500703692436, -0.0007288235938176513, -4.251727802093689e-33, -0.05241098627448082, 0.01810596138238907, 0.027356741949915886, 0.049849215894937515, -0.02376740798354149, -0.07181036472320557, 0.051662154495716095, 0.035930413752794266, 0.006841731257736683, -0.043847810477018356, -0.10583160817623138, -0.001350761391222477, 0.07882743328809738, -0.004012229386717081, 0.03240342065691948, -0.027706192806363106, -0.013300527818500996, -0.010794985108077526, 0.047403156757354736, 0.061176519840955734, -0.01584835723042488, 0.05553581938147545, 0.008371963165700436, -0.016309868544340134, 0.04459111765027046, 0.008054367266595364, 0.03560465946793556, -0.009665279649198055, -0.003433950711041689, -0.06360765546560287, 0.0025863221380859613, 0.0836811363697052, 0.0004344884364400059, 0.029459524899721146, -0.029806332662701607, -0.026338519528508186, 0.11483897268772125, -0.025673717260360718, 0.024865923449397087, 0.04422370344400406, 0.0076371110044419765, -0.008585147559642792, 0.06275586038827896, -0.006816698703914881, 0.04704209417104721, 0.06077631935477257, -0.04794566333293915, -0.036251187324523926, 0.01563495211303234, -0.01138215884566307, 0.02409287542104721, -0.03637880086898804, -0.06545863300561905, 0.05020243674516678, -0.010014219209551811, -0.07856778800487518, -0.17161256074905396, 0.05451086163520813, 0.01575934700667858, 0.056299127638339996, -0.02412211149930954, -0.014255400747060776, 0.02248593233525753, 0.07045120745897293, -0.07425729930400848, -0.04666408896446228, -0.05058687925338745, -0.06128387153148651, 0.015308738686144352, -0.026762664318084717, 0.054872263222932816, 0.026110809296369553, -0.07020086795091629, 0.005742528475821018, -0.06734133511781693, -0.049664683640003204, -0.02439098432660103, -0.02726023644208908, 0.0028204480186104774, 0.015761440619826317, -0.012289512902498245, 0.02267812006175518, -0.006521328818053007, 0.03287062793970108, -0.028886865824460983, 0.018778061494231224, 0.01260762196034193, -0.005648789461702108, 0.086700439453125, -0.03214103728532791, -0.0062153534963727, 0.09663426876068115, -0.05717859044671059, 0.052152134478092194, 0.030014976859092712, -5.72369778240045e-8, 0.039251476526260376, -0.05284721031785011, -0.06198079511523247, 0.011299854144454002, 0.011207515373826027, 0.026594189926981926, -0.10254758596420288, -0.06453372538089752, 0.06318216770887375, -0.05424351245164871, 0.062361858785152435, -0.014695877209305763, -0.08932043612003326, -0.04387837275862694, 0.01476958952844143, -0.0037997609470039606, -0.04319620132446289, 0.030346283689141273, -0.006367445457726717, 0.017362266778945923, -0.03446534276008606, 0.05388787388801575, -0.011311729438602924, -0.05898036062717438, -0.109940305352211, 0.016135212033987045, 0.018788348883390427, 0.03457915037870407, 0.06795715540647507, -0.07734715938568115, 0.008397890254855156, -0.029457151889801025, 0.01573275215923786, -0.028217852115631104, -0.09448286890983582, 0.08206059783697128, -0.045520856976509094, -0.0049072979018092155, 0.045852918177843094, 0.04130927845835686, 0.07538528740406036, -0.10866854339838028, -0.03435921296477318, -0.020294606685638428, -0.11364302039146423, -0.06722980737686157, -0.030843710526823997, -0.005036152433604002, 0.029170168563723564, -0.05154449865221977, -0.039741791784763336, -0.04459976777434349, -0.06784266233444214, -0.0568351149559021, 0.03873123228549957, 0.033735234290361404, -0.079470694065094, -0.057832203805446625, -0.004989312030375004, 0.004438452888280153, 0.04886394739151001, 0.013300668448209763, -0.063865527510643, -0.027964022010564804 ]
0.03725
[[query-dsl-span-near-query]] === Span Near Query Matches spans which are near one another. One can specify \_slop\_, the maximum number of intervening unmatched positions, as well as whether matches are required to be in-order. The span near query maps to Lucene `SpanNearQuery`. Here is an example: [source,js] -------------------------------------------------- GET /\_search { "query": { "span\_near" : { "clauses" : [ { "span\_term" : { "field" : "value1" } }, { "span\_term" : { "field" : "value2" } }, { "span\_term" : { "field" : "value3" } } ], "slop" : 12, "in\_order" : false } } } -------------------------------------------------- // CONSOLE The `clauses` element is a list of one or more other span type queries and the `slop` controls the maximum number of intervening unmatched positions permitted.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/span-near-query.asciidoc
6.2
elasticsearch-6-2
[ -0.010982712730765343, 0.05289182811975479, 0.04231772944331169, 0.03466978296637535, 0.006715210620313883, 0.050517886877059937, -0.022110803052783012, -0.02840028889477253, 0.041027799248695374, -0.09343626350164413, -0.03718705475330353, -0.0070439171977341175, 0.013255172409117222, -0.02695656567811966, -0.028727788478136063, -0.004878845531493425, -0.0358300544321537, 0.02227429300546646, -0.05186042934656143, 0.007539022248238325, 0.12027664482593536, 0.0224837027490139, 0.02083042822778225, -0.0543350949883461, -0.01290854811668396, 0.0067589464597404, -0.06876999884843826, -0.020573554560542107, 0.01678226888179779, 0.03432050347328186, -0.042311377823352814, 0.021199600771069527, -0.05307617411017418, 0.08834093809127808, -0.006149701774120331, -0.026058830320835114, -0.04171906039118767, 0.0365372933447361, -0.012560590170323849, -0.02838134951889515, 0.0044612945057451725, 0.016457777470350266, -0.013399516232311726, -0.04366514831781387, -0.016071628779172897, -0.0772123858332634, -0.07311172783374786, -0.03584827482700348, -0.03677014634013176, 0.010302774608135223, -0.15694397687911987, -0.024477625265717506, -0.012589143589138985, 0.08652351796627045, 0.039753787219524384, 0.028320012614130974, -0.053544316440820694, -0.05931369960308075, -0.02366567961871624, -0.05279567092657089, 0.0488414503633976, -0.09335096180438995, -0.012336044572293758, -0.030976200476288795, -0.020431922748684883, -0.052168454974889755, 0.06958016008138657, -0.014766397885978222, 0.0015730122104287148, -0.007550315000116825, 0.055341534316539764, -0.0013217877130955458, -0.02499236725270748, 0.04504059627652168, 0.05526522174477577, 0.10257596522569656, -0.01449438277631998, 0.0006749602034687996, 0.07470805197954178, -0.015751292929053307, -0.02839372493326664, -0.03992411121726036, -0.030579689890146255, 0.07446447014808655, -0.0015001288847997785, -0.07270671427249908, -0.03319752588868141, -0.1489218771457672, 0.09177574515342712, -0.02793068438768387, 0.009534725919365883, -0.0635678619146347, -0.028779620304703712, 0.00600125128403306, -0.001307563274167478, 0.05629004165530205, 0.02829151041805744, 0.02469877153635025, 0.059232767671346664, 0.005956351291388273, 0.053165536373853683, -0.01808992214500904, -0.010568736121058464, -0.04525401443243027, -0.07152272015810013, 0.017362751066684723, -0.06007592752575874, -0.022657521069049835, -0.006406316999346018, -0.03717854619026184, 0.01482478529214859, 0.06827065348625183, 0.007477929349988699, 0.003500399412587285, -0.06217960640788078, 0.012049371376633644, 0.10200845450162888, -0.03418821841478348, 0.10865302383899689, 0.0032187465112656355, 0.03051384910941124, 0.07174220681190491, -0.061056192964315414, -0.01869494467973709, 0.04740999639034271, -0.022382477298378944, 0.01495958212763071, -9.6957170962272e-34, 0.08709071576595306, -0.001174367731437087, 0.012669268995523453, -0.030779989436268806, -0.020606644451618195, 0.026307551190257072, -0.013882686384022236, 0.12117567658424377, -0.09423161298036575, 0.00914365891367197, -0.04142872244119644, 0.07345010340213776, -0.01797478459775448, -0.11801693588495255, 0.038408998399972916, -0.035590268671512604, 0.039222393184900284, -0.026469871401786804, -0.05047919228672981, 0.0032132018823176622, -0.010930747725069523, -0.05094359442591667, -0.012594956904649734, -0.009710141457617283, 0.005458203610032797, -0.03974568471312523, -0.027350082993507385, -0.07304932922124863, -0.07872370630502701, 0.018695205450057983, -0.08694937080144882, 0.0031621663365513086, 0.08029727637767792, 0.014628012664616108, 0.04724162817001343, 0.059572577476501465, -0.03466774523258209, -0.0013610036112368107, -0.011431924998760223, -0.0416097529232502, -0.03097367286682129, 0.025974169373512268, 0.0563933327794075, -0.081647127866745, -0.01440011989325285, -0.02449158951640129, -0.03566964715719223, 0.01679876632988453, -0.019458889961242676, 0.04304342716932297, 0.0010563473915681243, 0.06393595039844513, -0.041565775871276855, -0.002599570667371154, 0.06885194778442383, 0.04817813262343407, 0.0021616218145936728, 0.06954337656497955, 0.02079075202345848, 0.06978403776884079, 0.012489489279687405, -0.007856402546167374, 0.07777465879917145, -0.013721837662160397, 0.07511011511087418, 0.017527451738715172, -0.027139822021126747, 0.019848914816975594, 0.015944914892315865, 0.07536523044109344, 0.027268262580037117, 0.008936063386499882, 0.03438844159245491, -0.001648541889153421, -0.002529800869524479, -0.056700002402067184, 0.0027934873942285776, 0.007264432962983847, 0.007628175895661116, -0.05793820694088936, -0.04636046290397644, -0.061531033366918564, -0.0333050936460495, 0.11453414708375931, -0.06601724028587341, 0.0030810129828751087, 0.00414014607667923, -0.03627261146903038, -0.07349862158298492, -0.033799659460783005, 0.033768732100725174, 0.01123566459864378, -0.04784870520234108, -0.08062036335468292, -0.015267521142959595, -3.3069578753296176e-34, 0.086490198969841, -0.13484026491641998, 0.08749855309724808, -0.027077922597527504, 0.004846604540944099, -0.08406276255846024, 0.014415315352380276, -0.023833921179175377, -0.010226608254015446, 0.018627598881721497, 0.0029853517189621925, -0.01327087264508009, 0.04234318807721138, -0.10040568560361862, -0.028432367369532585, 0.12210460752248764, 0.07062474638223648, -0.06258364021778107, 0.015828371047973633, 0.05257275700569153, 0.11716682463884354, 0.04344099760055542, -0.0730229839682579, 0.11924505978822708, -0.0026115933433175087, -0.09026949107646942, 0.09125655889511108, -0.02871318906545639, -0.1166311651468277, 0.023183733224868774, 0.009493464604020119, -0.11593032628297806, 0.028977688401937485, -0.051017001271247864, -0.0699632540345192, -0.0420122928917408, -0.0009711305028758943, -0.018769126385450363, 0.0037925171200186014, 0.03954587131738663, 0.030288228765130043, 0.005802060943096876, -0.006111567374318838, 0.008024937473237514, 0.04189681634306908, -0.04366161674261093, -0.08300944417715073, 0.05657664313912392, -0.01814291439950466, -0.006429737433791161, 0.012407231144607067, 0.030150627717375755, -0.07329066842794418, 0.05533447116613388, -0.023530233651399612, -0.05425643175840378, -0.04098042845726013, 0.0027697717305272818, -0.05976153910160065, -0.019893839955329895, -0.019554341211915016, 0.09258516132831573, 0.008161453530192375, -0.03952544555068016, 0.11470494419336319, 0.023736802861094475, -0.09029724448919296, 0.005747656803578138, -0.04973908141255379, -0.08593890815973282, -0.008243254385888577, -0.05478736013174057, 0.05857805535197258, 0.06877122819423676, 0.006213990040123463, 0.0023505911231040955, 0.07111397385597229, 0.0014305259101092815, 0.013980195857584476, 0.010599840432405472, -0.0253590140491724, 0.016471177339553833, 0.06486570090055466, 0.1037093997001648, -0.050674039870500565, 0.056032199412584305, -0.014246262609958649, 0.07567298412322998, -0.03160400316119194, -0.030541149899363518, 0.04139526188373566, -0.03615507110953331, -0.016973216086626053, -0.04324079304933548, 0.0757208988070488, -4.490512139909697e-8, -0.12110237032175064, 0.047241076827049255, -0.050850655883550644, 0.06170620024204254, 0.01025625690817833, 0.010512430220842361, 0.14423952996730804, 0.0806366354227066, -0.06788715720176697, 0.00021900750289205462, 0.049445755779743195, 0.08837882429361343, 0.04429283365607262, -0.03161480650305748, 0.0036352372262626886, -0.018989067524671555, -0.08478205651044846, -0.02635282650589943, -0.06109244003891945, 0.021883081644773483, 0.0005779420025646687, 0.04391459748148918, -0.0059042442589998245, 0.07441958039999008, 0.06817705929279327, 0.00000661575177218765, -0.013700857758522034, -0.027715452015399933, 0.11658256500959396, 0.00873928889632225, -0.05526288226246834, -0.011465420015156269, 0.012258574366569519, 0.01219599787145853, 0.007770202588289976, 0.017947250977158546, -0.04034898430109024, -0.02515058033168316, -0.04868774116039276, 0.07292673736810684, 0.04659231752157211, -0.0012231089640408754, -0.021197931841015816, 0.0648195743560791, 0.03589482232928276, -0.008680444210767746, 0.01537399087101221, -0.007040783297270536, 0.12036799639463425, 0.0006560256006196141, 0.04067651182413101, -0.037243831902742386, 0.0005724618094973266, -0.0215457733720541, -0.0723923072218895, -0.052873291075229645, 0.017868291586637497, 0.04295429214835167, -0.006795851979404688, -0.011569622904062271, 0.11796534061431885, -0.0310077928006649, -0.0021783208940178156, 0.081301748752594 ]
0.005267
[[query-dsl-span-within-query]] === Span Within Query Returns matches which are enclosed inside another span query. The span within query maps to Lucene `SpanWithinQuery`. Here is an example: [source,js] -------------------------------------------------- GET /\_search { "query": { "span\_within" : { "little" : { "span\_term" : { "field1" : "foo" } }, "big" : { "span\_near" : { "clauses" : [ { "span\_term" : { "field1" : "bar" } }, { "span\_term" : { "field1" : "baz" } } ], "slop" : 5, "in\_order" : true } } } } } -------------------------------------------------- // CONSOLE The `big` and `little` clauses can be any span type query. Matching spans from `little` that are enclosed within `big` are returned.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/span-within-query.asciidoc
6.2
elasticsearch-6-2
[ -0.017393657937645912, 0.07355199754238129, 0.10358648002147675, 0.08388182520866394, 0.025988388806581497, 0.005586833693087101, 0.026340186595916748, -0.033058349043130875, 0.026068123057484627, -0.08999775350093842, -0.04829007759690285, -0.005286820232868195, 0.002678654855117202, -0.031938470900058746, 0.016059555113315582, 0.02304566651582718, -0.040272828191518784, 0.023602629080414772, -0.054653629660606384, -0.01749386079609394, 0.10643242299556732, 0.022053027525544167, -0.0033458524849265814, -0.0682566836476326, -0.019964143633842468, 0.0181496050208807, -0.07405457645654678, -0.01573602296411991, 0.015838103368878365, 0.05532338097691536, -0.04106660559773445, 0.035333823412656784, -0.049170151352882385, 0.0898909941315651, -0.013492882251739502, -0.01581369712948799, -0.004414915107190609, 0.014105836860835552, 0.007859318517148495, -0.03207917883992195, -0.0014040492242202163, 0.014217241667211056, -0.029592566192150116, -0.05231384187936783, 0.010966656729578972, -0.07272949069738388, -0.04393327236175537, -0.040722839534282684, -0.040874041616916656, 0.01930830627679825, -0.147365540266037, -0.018271123990416527, -0.03318796679377556, 0.09011929482221603, 0.03798092156648636, 0.029120275750756264, -0.04881570488214493, -0.04539605975151062, -0.023789657279849052, -0.05698957294225693, 0.016161486506462097, -0.08818784356117249, -0.03232039883732796, 0.005013895686715841, -0.019800780341029167, -0.08161593228578568, 0.05577637255191803, 0.03335089236497879, -0.013562073931097984, -0.04488224536180496, 0.04347900301218033, -0.009965155273675919, -0.002025672234594822, 0.025910602882504463, 0.04183255136013031, 0.09238139539957047, -0.004756276961416006, -0.02088487334549427, 0.08248624205589294, 0.024034420028328896, -0.036436304450035095, -0.05669402331113815, -0.06806936860084534, 0.05550173297524452, -0.023235401138663292, -0.047016412019729614, -0.028426049277186394, -0.16583462059497833, 0.05246642976999283, -0.02616722136735916, -0.007308807224035263, -0.11017607152462006, -0.007802482228726149, 0.004147928208112717, 0.03717285394668579, 0.03976156935095787, 0.017189962789416313, -0.005286273080855608, 0.08246447890996933, 0.02355748787522316, 0.04840219020843506, -0.01323006208986044, 0.004007063806056976, -0.08117835223674774, -0.08043006807565689, 0.020192641764879227, -0.02353500947356224, -0.02113296650350094, -0.001761291059665382, -0.02772747166454792, 0.0018403144786134362, 0.060394421219825745, 0.012954175472259521, 0.01757248304784298, -0.07384661585092545, 0.012903750874102116, 0.09513113647699356, -0.019436176866292953, 0.11172644793987274, 0.04089956730604172, 0.035766199231147766, 0.10304782539606094, -0.039048630744218826, -0.03946688026189804, 0.009895059280097485, -0.01835273765027523, 0.014982031658291817, 7.689564254171151e-34, 0.07873886078596115, 0.004751189611852169, -0.016107818111777306, -0.028092723339796066, -0.026489583775401115, 0.04704301431775093, 0.0042696865275502205, 0.11841779947280884, -0.07985730469226837, 0.017578013241291046, -0.041976187378168106, 0.0882333293557167, -0.036969494074583054, -0.09792380779981613, 0.0348060168325901, -0.0035829846747219563, 0.0007898732437752187, -0.030954690650105476, -0.027631938457489014, 0.01291502546519041, -0.025893501937389374, -0.01539422757923603, -0.013112692162394524, -0.002731329295784235, 0.014481553807854652, -0.04824404418468475, -0.011828135699033737, -0.050509385764598846, -0.09104551374912262, 0.019923051819205284, -0.07232668995857239, -0.014645189046859741, 0.07176480442285538, 0.015844151377677917, 0.05329403281211853, 0.07944884151220322, -0.01025045569986105, 0.014496535994112492, -0.032805655151605606, -0.04542272910475731, -0.03431522473692894, -0.013766269199550152, 0.06811120361089706, -0.08922964334487915, -0.05502643808722496, -0.030283043161034584, -0.0725221112370491, 0.025648627430200577, -0.019730418920516968, 0.0377785824239254, -0.005042665172368288, 0.05997074767947197, -0.024503102526068687, -0.016246477141976357, 0.067644864320755, 0.0707969069480896, 0.019635077565908432, 0.08668141812086105, 0.00819824542850256, 0.03995230048894882, 0.0035745990462601185, -0.012834765017032623, 0.06447132676839828, 0.013784755952656269, 0.03742130100727081, 0.03324434161186218, 0.0007393397972919047, 0.045175664126873016, -0.0043808454647660255, 0.03313516825437546, -0.0016826450591906905, 0.004624451510608196, 0.032092031091451645, 0.0010452748974785209, 0.013817421160638332, -0.07006818801164627, -0.024024661630392075, -0.01488649845123291, -0.024341942742466927, -0.06837049871683121, -0.03648403286933899, -0.06680738180875778, -0.023466555401682854, 0.14180169999599457, -0.05593385547399521, 0.040983352810144424, -0.007990896701812744, -0.039481330662965775, -0.05078425258398056, -0.04958828538656235, 0.016098393127322197, 0.022297615185379982, -0.07482773810625076, -0.08880972117185593, 0.003709954908117652, -3.014988726225622e-33, 0.09602777659893036, -0.10463465005159378, 0.07864461839199066, -0.04635515809059143, 0.006347920745611191, -0.08230970054864883, 0.014786572195589542, -0.025296419858932495, 0.017459740862250328, 0.032450031489133835, -0.0011185928015038371, -0.011236388236284256, 0.017166195437312126, -0.10714861750602722, -0.03914108872413635, 0.08869007974863052, 0.02810755744576454, -0.041964467614889145, 0.019183708354830742, 0.048970092087984085, 0.09601185470819473, 0.04967603459954262, -0.04451921954751015, 0.11017096787691116, -0.007202676497399807, -0.09844374656677246, 0.0847666934132576, 0.0068488637916743755, -0.11306677758693695, 0.04448872059583664, 0.015776004642248154, -0.1015748381614685, 0.005292242858558893, -0.020344598218798637, -0.10160539299249649, -0.04659329727292061, 0.030912203714251518, -0.03469126671552658, -0.015704955905675888, 0.010753810405731201, 0.0008531284402124584, 0.0215969979763031, -0.014268476516008377, -0.00634917663410306, 0.03214722499251366, -0.06327812373638153, -0.06358262896537781, 0.08376935869455338, 0.0055040824227035046, -0.019175846129655838, 0.023123370483517647, 0.00265518412925303, -0.07343512028455734, 0.03609534725546837, -0.034341227263212204, -0.06353625655174255, -0.036960650235414505, -0.0037336619570851326, -0.1033216193318367, -0.016088128089904785, -0.03218598663806915, 0.08464454859495163, -0.004770567175000906, -0.011598962359130383, 0.08141691982746124, -0.027661077678203583, -0.07591874897480011, 0.011974605731666088, -0.034735146909952164, -0.08921269327402115, -0.003947667311877012, -0.0708681046962738, 0.04801536351442337, 0.06029445305466652, 0.012986191548407078, 0.04776810482144356, 0.0663381814956665, 0.007751709781587124, -0.0017076703952625394, 0.004112124443054199, -0.006762044969946146, -0.02712765708565712, 0.037083327770233154, 0.1253080666065216, -0.031622134149074554, 0.015226420946419239, -0.02987193502485752, 0.09399617463350296, -0.0473506934940815, -0.0359782837331295, 0.03458276391029358, -0.04795436933636665, -0.040726546198129654, -0.006152883637696505, 0.06658829003572464, -4.621925953074424e-8, -0.10959510505199432, 0.06318175792694092, -0.07332683354616165, 0.06436231732368469, -0.03432818502187729, 0.0336499959230423, 0.12108729034662247, 0.04711127653717995, -0.062475353479385376, -0.03122064657509327, 0.039902836084365845, 0.10037216544151306, 0.01722419261932373, -0.05006694048643112, -0.02673710510134697, -0.01101965643465519, -0.09318852424621582, -0.024468332529067993, -0.04122287407517433, 0.010564853437244892, 0.023831911385059357, 0.008965296670794487, -0.005170577205717564, 0.07488714158535004, 0.06241950765252113, 0.021756606176495552, -0.02969910018146038, -0.02910318411886692, 0.10031083226203918, 0.05677031725645065, -0.03992181643843651, 0.0255137886852026, -0.007979475893080235, -0.00526000652462244, -0.014521878212690353, -0.012917779386043549, 0.00653016148135066, -0.04455062374472618, -0.01036499161273241, 0.08677321672439575, 0.06600295007228851, 0.011294367723166943, -0.039009276777505875, 0.032801516354084015, -0.007196755614131689, -0.027788130566477776, 0.03854581341147423, 0.021950898692011833, 0.1390560269355774, 0.014742889441549778, 0.06151314824819565, -0.028310110792517662, -0.030148398131132126, -0.048220932483673096, -0.0514315627515316, -0.04235624521970749, 0.048016272485256195, 0.0724596157670021, -0.015103098005056381, -0.01054398063570261, 0.10389935970306396, -0.029846834018826485, 0.03564169630408287, 0.06219052895903587 ]
0.013429
[[joining-queries]] == Joining queries Performing full SQL-style joins in a distributed system like Elasticsearch is prohibitively expensive. Instead, Elasticsearch offers two forms of join which are designed to scale horizontally. <>:: Documents may contain fields of type <>. These fields are used to index arrays of objects, where each object can be queried (with the `nested` query) as an independent document. <> and <> queries:: A <> can exist between documents within a single index. The `has\_child` query returns parent documents whose child documents match the specified query, while the `has\_parent` query returns child documents whose parent document matches the specified query. Also see the <> in the `terms` query, which allows you to build a `terms` query from values contained in another document. include::nested-query.asciidoc[] include::has-child-query.asciidoc[] include::has-parent-query.asciidoc[] include::parent-id-query.asciidoc[]
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/joining-queries.asciidoc
6.2
elasticsearch-6-2
[ -0.009899094700813293, 0.0892895758152008, 0.033138275146484375, 0.08906563371419907, 0.05700289085507393, -0.00849929079413414, -0.03703716769814491, 0.048119500279426575, 0.07563979923725128, -0.011382833123207092, -0.020853642374277115, -0.01946830190718174, 0.04588628560304642, -0.008259303867816925, 0.020003091543912888, 0.014238850213587284, -0.05212194100022316, -0.010879755020141602, -0.046990711241960526, -0.019871972501277924, 0.028760850429534912, 0.05025896802544594, 0.02250857651233673, -0.03724538907408714, -0.01379530318081379, 0.07354585826396942, -0.07152412831783295, -0.01607273891568184, 0.005590157583355904, 0.01910216733813286, 0.010027931071817875, 0.06013615056872368, 0.003516759490594268, 0.10307303816080093, -0.05697322264313698, -0.015605722554028034, 0.07858709245920181, -0.07335328310728073, -0.012084775604307652, -0.020105382427573204, 0.02349139004945755, 0.07148762047290802, -0.004021843429654837, -0.05568772554397583, -0.01606888137757778, -0.014243502169847488, -0.030212659388780594, -0.01330083142966032, -0.020128265023231506, 0.060823146253824234, -0.10812702775001526, -0.03478216007351875, -0.03306077793240547, 0.07351792603731155, -0.013086807914078236, 0.10946587473154068, -0.14132726192474365, -0.04289718344807625, -0.07306626439094543, -0.04316414147615433, 0.020018190145492554, -0.03676486015319824, -0.052311740815639496, -0.031747013330459595, -0.07755856215953827, -0.029951976612210274, 0.051524870097637177, 0.01782459020614624, 0.046333663165569305, 0.015583425760269165, 0.07370457053184509, 0.010603932663798332, -0.002840256318449974, 0.055809881538152695, 0.0347013957798481, 0.0929112434387207, 0.06797536462545395, -0.017122279852628708, 0.02418573759496212, -0.07335299998521805, -0.09754502028226852, 0.0011654882691800594, -0.053494542837142944, -0.06459785252809525, 0.010500852018594742, -0.07758785784244537, 0.07821820676326752, -0.15861624479293823, -0.018806546926498413, 0.001000857213512063, 0.0017585497116670012, -0.11403841525316238, 0.010516786947846413, -0.021284786984324455, 0.050426773726940155, -0.026397228240966797, 0.051384422928094864, 0.051862820982933044, 0.04652704298496246, -0.030684707686305046, 0.03737456724047661, 0.02917580120265484, 0.08949535340070724, -0.03259434178471565, -0.04532177746295929, -0.01612749509513378, -0.058569032698869705, 0.013193785212934017, 0.018237600103020668, -0.007095908746123314, -0.034033842384815216, -0.016889313235878944, 0.034662287682294846, 0.02633817493915558, -0.02790262922644615, 0.02850908227264881, 0.04036329686641693, -0.03695185109972954, 0.09426014125347137, 0.029739491641521454, 0.10790127515792847, 0.011548872105777264, 0.03453286737203598, -0.01051278319209814, 0.021571801975369453, -0.050150491297245026, -0.05206999555230141, 6.294535680415247e-33, 0.04846925660967827, 0.01549453753978014, -0.0486416257917881, 0.010057414881885052, -0.03444570302963257, 0.14341281354427338, 0.018872087821364403, 0.06832067668437958, -0.1122114434838295, 0.033698920160532, -0.09389064460992813, 0.09883583337068558, 0.03117610327899456, 0.041202910244464874, 0.05226434767246246, 0.045727863907814026, 0.024461274966597557, -0.012578612193465233, 0.01615653932094574, 0.06374523043632507, 0.008654824458062649, 0.025161055848002434, -0.028111014515161514, 0.07951527833938599, 0.03925100713968277, -0.025903934612870216, 0.0019117589108645916, -0.04894646257162094, -0.041027605533599854, 0.011734602972865105, -0.07802102714776993, 0.012127725407481194, -0.048181306570768356, -0.06821668893098831, 0.026980184018611908, 0.10354247689247131, 0.03325534611940384, -0.03385674208402634, -0.07754027098417282, 0.005194647703319788, -0.055517591536045074, -0.009144003503024578, 0.01024180930107832, -0.09379751980304718, -0.032915811985731125, -0.05789102613925934, -0.06686903536319733, -0.006511996500194073, 0.04108060151338577, 0.00066566769964993, -0.0026066352147608995, 0.0001459339400753379, 0.05653548985719681, 0.007147558499127626, 0.07386603206396103, 0.04010123386979103, 0.020444633439183235, 0.15682516992092133, -0.03244268149137497, 0.03166135028004646, 0.0028261190745979548, -0.10451564937829971, 0.012854852713644505, 0.02169160358607769, -0.01927907019853592, 0.014679528772830963, 0.01351315900683403, 0.09588045626878738, 0.09360816329717636, 0.005851746071130037, -0.009883031249046326, 0.04507340118288994, -0.03796106576919556, -0.028358234092593193, -0.03201055899262428, -0.08086507022380829, 0.026940327137708664, -0.0397413931787014, 0.023082826286554337, 0.0034397609997540712, -0.10404913127422333, 0.006695799995213747, 0.04189308360219002, 0.029337983578443527, -0.12462173402309418, 0.03435003384947777, 0.014271286316215992, 0.030386313796043396, -0.0546552948653698, -0.07319655269384384, -0.02864544466137886, -0.023807261139154434, -0.024319926276803017, -0.04767628386616707, 0.08375220000743866, -7.132253198896688e-33, 0.05217873677611351, -0.10097255557775497, -0.0027484570164233446, -0.03507073596119881, -0.010413731448352337, -0.06769882887601852, 0.07004992663860321, -0.04721137508749962, -0.0418265275657177, -0.0670609399676323, 0.017807187512516975, -0.051641032099723816, 0.015037814155220985, -0.09750951826572418, 0.04715913161635399, -0.005801768973469734, 0.005306605715304613, -0.08213545382022858, 0.08143182843923569, 0.05537629872560501, -0.03914904221892357, -0.007167466916143894, 0.015308287926018238, 0.08502456545829773, 0.06537675112485886, -0.04806065559387207, -0.05822257325053215, -0.011349264532327652, -0.07266731560230255, -0.017605317756533623, 0.04415646567940712, -0.05412541702389717, 0.0398084819316864, -0.018998343497514725, -0.06411979347467422, -0.011809781193733215, -0.052725501358509064, -0.027299966663122177, 0.019088899716734886, -0.07059312611818314, 0.06312295794487, 0.06019829958677292, 0.09058478474617004, 0.05824708938598633, -0.010239927098155022, 0.05544193089008331, 0.01866946741938591, 0.04540998116135597, -0.04102926328778267, 0.0040279473178088665, 0.035734184086322784, -0.05334978550672531, -0.03495372459292412, -0.013439926318824291, -0.04378141835331917, -0.06058137118816376, -0.0545753613114357, 0.04895992949604988, -0.08051398396492004, 0.014887218363583088, 0.056064143776893616, 0.056932296603918076, -0.028787637129426003, -0.0018821598496288061, -0.038153283298015594, -0.061128512024879456, -0.08091253787279129, -0.0603119432926178, -0.030380113050341606, -0.000488497840706259, -0.035260703414678574, -0.07058496028184891, 0.009825045242905617, 0.0663900077342987, 0.007335049100220203, 0.011389796622097492, 0.01869315840303898, -0.013317203149199486, 0.027035130187869072, -0.04142342135310173, -0.07837983965873718, 0.008320183493196964, 0.04570809006690979, 0.06492670625448227, 0.01666072942316532, 0.021096080541610718, -0.021566186100244522, 0.09093709290027618, -0.02974516712129116, 0.031920623034238815, 0.06676673144102097, -0.07314040511846542, -0.036001574248075485, -0.06795300543308258, 0.035849396139383316, -5.230998567640199e-8, 0.0285381767898798, -0.0013462965143844485, -0.0735965222120285, -0.026076331734657288, 0.041779566556215286, -0.01567172445356846, 0.07077141851186752, 0.09606324136257172, -0.0675181970000267, 0.01663476973772049, -0.00901226606220007, -0.04661251977086067, -0.09715443104505539, -0.042105916887521744, 0.0168807003647089, -0.0012565897777676582, 0.010968889109790325, 0.01543270144611597, -0.04834822192788124, 0.03238353505730629, -0.029709620401263237, 0.017397576943039894, -0.03283694386482239, 0.048518676310777664, 0.012971140444278717, 0.05698108300566673, 0.020431291311979294, 0.03110460750758648, 0.08123741298913956, -0.038060080260038376, -0.03313059359788895, -0.024369977414608, -0.005092630162835121, 0.026126064360141754, 0.05519116669893265, -0.012897602282464504, 0.00552828935906291, 0.06326188892126083, -0.09578055143356323, 0.044588927179574966, 0.07324422150850296, 0.014928389340639114, -0.009112590923905373, 0.03145889192819595, 0.009077554568648338, -0.04080474376678467, -0.025708116590976715, 0.053917448967695236, 0.08585477620363235, 0.014622436836361885, -0.022069135680794716, -0.10198590904474258, 0.010929799638688564, -0.0022713765501976013, -0.054665785282850266, 0.013346749357879162, -0.0046806237660348415, 0.0019080754136666656, 0.062411725521087646, -0.0021978532895445824, 0.09498140960931778, -0.09195601940155029, 0.0004125408595427871, 0.05782464146614075 ]
0.118187
[[query-dsl-parent-id-query]] === Parent Id Query The `parent\_id` query can be used to find child documents which belong to a particular parent. Given the following mapping definition: [source,js] -------------------------------------------- PUT my\_index { "mappings": { "\_doc": { "properties": { "my\_join\_field": { "type": "join", "relations": { "my\_parent": "my\_child" } } } } } } PUT my\_index/\_doc/1?refresh { "text": "This is a parent document", "my\_join\_field": "my\_parent" } PUT my\_index/\_doc/2?routing=1&refresh { "text": "This is a child document", "my\_join\_field": { "name": "my\_child", "parent": "1" } } -------------------------------------------- // CONSOLE // TESTSETUP [source,js] -------------------------------------------------- GET /my\_index/\_search { "query": { "parent\_id": { "type": "my\_child", "id": "1" } } } -------------------------------------------------- // CONSOLE ==== Parameters This query has two required parameters: [horizontal] `type`:: The \*\*child\*\* type name, as specified in the <>. `id`:: The ID of the parent document. `ignore\_unmapped`:: When set to `true` this will ignore an unmapped `type` and will not match any documents for this query. This can be useful when querying multiple indexes which might have different mappings. When set to `false` (the default value) the query will throw an exception if the `type` is not mapped.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/parent-id-query.asciidoc
6.2
elasticsearch-6-2
[ -0.028587283566594124, 0.05581178143620491, 0.10844102501869202, 0.10582826286554337, 0.01669670082628727, 0.003991041798144579, -0.03312675654888153, 0.06059746816754341, 0.0880354717373848, -0.022067131474614143, -0.039370305836200714, -0.010125069878995419, 0.01488358061760664, 0.0010915407910943031, -0.0030422653071582317, 0.10718580335378647, -0.047884613275527954, 0.0516643188893795, -0.047140903770923615, -0.05766475573182106, 0.025620000436902046, 0.06726042926311493, 0.043637409806251526, -0.05136164650321007, 0.004846398252993822, 0.07065679877996445, -0.008485090918838978, -0.04752659052610397, -0.026175543665885925, 0.07563207298517227, -0.004880987107753754, 0.017122384160757065, -0.07671919465065002, 0.002184314886108041, 0.030551346018910408, 0.03803752362728119, 0.08338118344545364, -0.03554733097553253, 0.08536960184574127, 0.015622545033693314, 0.06509134918451309, 0.05960672348737717, 0.04631742462515831, -0.0879807099699974, 0.06365981698036194, -0.07291697710752487, -0.007152053527534008, 0.01245824620127678, -0.05358503758907318, 0.07176835834980011, -0.11528049409389496, -0.05607621371746063, -0.04098636284470558, 0.0224903654307127, 0.05275079980492592, 0.11711061000823975, -0.0734434425830841, 0.04057250916957855, -0.031320806592702866, -0.024374088272452354, 0.058873262256383896, -0.05335172638297081, -0.011512897908687592, -0.06775712966918945, -0.09503083676099777, -0.015288741327822208, -0.01314611081033945, -0.0013106490951031446, 0.025144286453723907, 0.019777173176407814, 0.009602951817214489, 0.0428469181060791, -0.003041846677660942, -0.046645525842905045, 0.02549855224788189, 0.013536135666072369, -0.001927381381392479, -0.027792762964963913, 0.009877380914986134, -0.112957663834095, -0.03445218876004219, -0.028954997658729553, 0.004980514291673899, -0.0325138196349144, 0.01117863692343235, -0.06429839879274368, 0.03464090824127197, -0.13748471438884735, 0.036454636603593826, -0.016631724312901497, -0.11212574690580368, -0.13430854678153992, 0.04351508617401123, 0.0007553144823759794, 0.06122535839676857, 0.06130322441458702, -0.0067533329129219055, -0.008184198290109634, 0.056704871356487274, -0.012905112467706203, -0.004937842953950167, 0.03943423181772232, 0.005488261114805937, -0.011097722686827183, -0.017344146966934204, 0.05243067070841789, -0.042000867426395416, 0.030399492010474205, -0.07721514999866486, 0.007212688680738211, -0.05354699864983559, 0.08094288408756256, -0.04346732422709465, 0.03405681997537613, -0.03882552310824394, 0.008100747130811214, 0.05349239706993103, -0.011096194386482239, 0.02402075007557869, 0.029801858589053154, 0.09646742790937424, 0.0067114331759512424, -0.02989085018634796, -0.03101518005132675, -0.011379419825971127, -0.056999750435352325, -0.0010704095475375652, -2.365658871142837e-33, 0.07096605747938156, 0.041513293981552124, -0.018377523869276047, 0.05862590670585632, -0.016905872151255608, 0.05289900675415993, 0.0683944895863533, 0.06894225627183914, -0.07807737588882446, 0.06546903401613235, -0.08804385364055634, 0.08888474106788635, -0.04320733621716499, -0.09880716353654861, -0.05828213691711426, -0.010030077770352364, -0.0346624031662941, 0.01970217190682888, 0.027481263503432274, -0.024823222309350967, -0.020987296476960182, 0.062054894864559174, -0.026110751554369926, 0.029651252552866936, 0.0603536032140255, -0.01461502443999052, -0.038251351565122604, -0.03053971193730831, -0.07968311756849289, -0.02201736345887184, -0.013610279187560081, 0.020892148837447166, -0.007072391454130411, -0.10162851959466934, -0.023970024660229683, 0.023101311177015305, 0.0205735731869936, -0.03616805747151375, -0.07763645797967911, 0.03159954771399498, 0.01908094249665737, -0.04061172902584076, 0.013055691495537758, -0.09159084409475327, -0.051904067397117615, -0.022488132119178772, -0.05822206661105156, -0.038607433438301086, 0.007061901967972517, 0.008654983714222908, -0.04133693128824234, -0.0032125823199748993, -0.024694088846445084, -0.019452104344964027, 0.04265725985169411, -0.011467410251498222, -0.09172138571739197, 0.14503364264965057, -0.0013924051309004426, 0.03261108323931694, -0.000051463670388329774, -0.022661468014121056, -0.011124514043331146, 0.029894176870584488, 0.021859286352992058, 0.03627972677350044, 0.048307206481695175, 0.1093684509396553, 0.032151367515325546, -0.012819417752325535, 0.008420564234256744, 0.056908588856458664, -0.056467995047569275, -0.05090765655040741, 0.058837566524744034, -0.07817494124174118, -0.049468040466308594, -0.03295423462986946, -0.017161715775728226, 0.007778553292155266, -0.11589273810386658, -0.032594840973615646, -0.024003945291042328, 0.03885866701602936, -0.04075276851654053, 0.036223314702510834, -0.04899409040808678, 0.03343905135989189, -0.034026362001895905, -0.01792982593178749, -0.02227083034813404, 0.01618489809334278, -0.04262084141373634, -0.06916165351867676, 0.08368431031703949, 9.317798417502719e-34, 0.10708513110876083, -0.10946662724018097, 0.041586071252822876, 0.004899322986602783, 0.030516017228364944, -0.12374325841665268, 0.11542289704084396, 0.013343976810574532, 0.0037357171531766653, 0.031598083674907684, -0.011369172483682632, -0.0572039894759655, 0.043939244002103806, -0.04924013093113899, 0.024440614506602287, 0.04424448311328888, -0.08522607386112213, -0.05315317586064339, 0.08123811334371567, 0.03454413637518883, 0.0025111509021371603, 0.06954929232597351, -0.021512547507882118, 0.09165620058774948, 0.009941088035702705, -0.04584803432226181, -0.049686137586832047, 0.002723561367020011, -0.08905908465385437, 0.015959616750478745, 0.03706895932555199, -0.022431714460253716, 0.016475792974233627, 0.05880291014909744, 0.0028108935803174973, 0.04443563148379326, -0.04033326357603073, 0.05479094758629799, -0.009305463172495365, 0.010995309799909592, -0.0016945251263678074, 0.022680817171931267, 0.00734341237694025, 0.07013542205095291, -0.010028786025941372, 0.03843231499195099, 0.07852582633495331, 0.09066805243492126, -0.03217752277851105, 0.00669213617220521, 0.07402335852384567, -0.034924693405628204, -0.04924993962049484, -0.02491702325642109, 0.025956762954592705, -0.01180074829608202, -0.01825026236474514, -0.040916088968515396, -0.05398973077535629, 0.02064540982246399, 0.08530125766992569, -0.017080184072256088, -0.043850332498550415, 0.03889814391732216, 0.011984181590378284, -0.08186066150665283, -0.11607322841882706, 0.00766823859885335, -0.007597220130264759, -0.03326035290956497, -0.03771490976214409, -0.05444465950131416, 0.10930032283067703, 0.05648615583777428, 0.07851574569940567, -0.016824519261717796, 0.06391641497612, 0.03870859369635582, 0.05298350006341934, -0.022377513349056244, -0.01768379658460617, 0.02392437309026718, -0.011748060584068298, -0.014531731605529785, -0.013959269970655441, -0.004830467980355024, -0.020475342869758606, 0.06846983730792999, -0.05710473656654358, -0.045819029211997986, -0.0034934580326080322, -0.05981826037168503, -0.02894880436360836, -0.11540529876947403, 0.008847706951200962, -4.1902403324911575e-8, -0.028624683618545532, 0.061708223074674606, -0.012428371235728264, -0.006997999269515276, -0.01738462597131729, 0.0015283519169315696, 0.08917142450809479, 0.13580742478370667, -0.05720003694295883, -0.02994564361870289, -0.020638741552829742, 0.024211663752794266, 0.008770330809056759, -0.04518837109208107, -0.06840275973081589, -0.08793936669826508, 0.0064695775508880615, -0.004547105170786381, -0.004980126861482859, 0.04365122318267822, 0.021807529032230377, 0.01024734228849411, 0.04175964742898941, 0.031545285135507584, 0.09363258630037308, 0.006058459635823965, 0.035975147038698196, -0.059077583253383636, 0.050170451402664185, 0.0007196574588306248, -0.04547300934791565, -0.015297487378120422, 0.012251781299710274, 0.0898004025220871, 0.006546561606228352, -0.048322904855012894, 0.04171031713485718, 0.06252041459083557, -0.06005549803376198, 0.027004163712263107, 0.03553175926208496, 0.04273465648293495, -0.032690078020095825, 0.0301506370306015, 0.03100128285586834, -0.0335473008453846, 0.01830057054758072, 0.04741126671433449, 0.09677933901548386, -0.014168187975883484, -0.06395364552736282, -0.09519689530134201, 0.040186066180467606, -0.07498692721128464, -0.0843985453248024, 0.016904670745134354, 0.03495149686932564, 0.0479373075067997, -0.04477671533823013, -0.007650315295904875, 0.027212588116526604, 0.020820539444684982, 0.02082214318215847, -0.010293453000485897 ]
0.008833
[[query-dsl-has-child-query]] === Has Child Query The `has\_child` filter accepts a query and the child type to run against, and results in parent documents that have child docs matching the query. Here is an example: [source,js] -------------------------------------------------- GET /\_search { "query": { "has\_child" : { "type" : "blog\_tag", "query" : { "term" : { "tag" : "something" } } } } } -------------------------------------------------- // CONSOLE Note that the `has\_child` is a slow query compared to other queries in the query dsl due to the fact that it performs a join. The performance degrades as the number of matching child documents pointing to unique parent documents increases. If you care about query performance you should not use this query. However if you do happen to use this query then use it as less as possible. Each `has\_child` query that gets added to a search request can increase query time significantly. [float] ==== Scoring capabilities The `has\_child` also has scoring support. The supported score modes are `min`, `max`, `sum`, `avg` or `none`. The default is `none` and yields the same behaviour as in previous versions. If the score mode is set to another value than `none`, the scores of all the matching child documents are aggregated into the associated parent documents. The score type can be specified with the `score\_mode` field inside the `has\_child` query: [source,js] -------------------------------------------------- GET /\_search { "query": { "has\_child" : { "type" : "blog\_tag", "score\_mode" : "min", "query" : { "term" : { "tag" : "something" } } } } } -------------------------------------------------- // CONSOLE [float] [[min-max-children]] ==== Min/Max Children The `has\_child` query allows you to specify that a minimum and/or maximum number of children are required to match for the parent doc to be considered a match: [source,js] -------------------------------------------------- GET /\_search { "query": { "has\_child" : { "type" : "blog\_tag", "score\_mode" : "min", "min\_children": 2, <1> "max\_children": 10, <1> "query" : { "term" : { "tag" : "something" } } } } } -------------------------------------------------- // CONSOLE <1> Both `min\_children` and `max\_children` are optional. The `min\_children` and `max\_children` parameters can be combined with the `score\_mode` parameter. [float] ==== Ignore Unmapped When set to `true` the `ignore\_unmapped` option will ignore an unmapped `type` and will not match any documents for this query. This can be useful when querying multiple indexes which might have different mappings. When set to `false` (the default value) the query will throw an exception if the `type` is not mapped. [float] ==== Sorting Parent documents can't be sorted by fields in matching child documents via the regular sort options. If you need to sort parent document by field in the child documents then you should use the `function\_score` query and then just sort by `\_score`. Sorting blogs by child documents' `click\_count` field: [source,js] -------------------------------------------------- GET /\_search { "query": { "has\_child" : { "type" : "blog\_tag", "score\_mode" : "max", "query" : { "function\_score" : { "script\_score": { "script": "\_score \* doc['click\_count'].value" } } } } } } -------------------------------------------------- // CONSOLE
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/has-child-query.asciidoc
6.2
elasticsearch-6-2
[ -0.08305492997169495, 0.10322844982147217, 0.05595706030726433, 0.09550654888153076, 0.0765790119767189, -0.03584287315607071, 0.011546925641596317, 0.0034469778183847666, 0.07276690006256104, -0.03858611732721329, -0.03901972621679306, -0.04024422913789749, -0.010745182633399963, 0.0020427654962986708, 0.0017504661809653044, 0.043152838945388794, 0.03730476275086403, 0.030256304889917374, -0.030846282839775085, -0.0829215943813324, 0.023450838401913643, 0.017519742250442505, 0.056168150156736374, -0.044822268187999725, 0.008281816728413105, 0.04192913696169853, -0.06524696201086044, -0.07634370028972626, 0.012044675648212433, 0.07719211280345917, -0.016758127138018608, 0.031385745853185654, -0.04980422556400299, 0.06913408637046814, -0.058270927518606186, -0.01905885525047779, 0.03708137199282646, -0.01786297932267189, 0.06781718134880066, 0.0043494743295013905, 0.04509615898132324, 0.10193712264299393, -0.034839559346437454, -0.08216778934001923, 0.011812690645456314, -0.09247715026140213, -0.06194821000099182, -0.042091794312000275, -0.03245551884174347, -0.02745674178004265, -0.1385684609413147, -0.047973886132240295, -0.07750171422958374, 0.027601875364780426, 0.02335471287369728, 0.061144810169935226, -0.10665903985500336, -0.010969344526529312, -0.0472714938223362, -0.05759868025779724, 0.00858856551349163, -0.10556524246931076, -0.06961364299058914, -0.015388495288789272, -0.022806460037827492, -0.025651300325989723, 0.057659026235342026, 0.006504835560917854, 0.04677475243806839, 0.03171916306018829, 0.036823347210884094, 0.0691128596663475, 0.006863417569547892, 0.02108001336455345, 0.0019386864732950926, 0.032538823783397675, 0.05020375922322273, -0.008775295689702034, 0.03421447053551674, -0.042628467082977295, -0.05596967786550522, -0.04290815442800522, -0.050599247217178345, -0.03264881670475006, -0.012520628981292248, -0.02076485939323902, 0.027803488075733185, -0.16041813790798187, 0.018877021968364716, -0.037652768194675446, -0.03910224139690399, -0.07695947587490082, 0.030081704258918762, -0.007926513440907001, 0.03572354465723038, 0.011853671632707119, 0.0330452136695385, -0.01180159393697977, 0.05688448250293732, 0.02566705085337162, 0.0505707748234272, 0.039691537618637085, 0.07079321891069412, -0.022939572110772133, -0.040455807000398636, 0.0028601286467164755, 0.022476639598608017, 0.03546418622136116, -0.07787372171878815, -0.039527878165245056, -0.0114503288641572, 0.058386288583278656, 0.009212522767484188, 0.0375107116997242, -0.0724906250834465, 0.009626081213355064, 0.10779339075088501, -0.0641920268535614, 0.015857551246881485, 0.058779049664735794, 0.07730434834957123, 0.09020395576953888, -0.005082837771624327, -0.055566251277923584, -0.00929749570786953, -0.025158677250146866, -0.030677149072289467, -1.0429858317708836e-33, 0.048303574323654175, -0.017042022198438644, -0.003227982670068741, 0.0004023441288154572, -0.055099982768297195, 0.1110711321234703, 0.07247857004404068, 0.07595420628786087, -0.07854025065898895, 0.06178520247340202, -0.10650394856929779, 0.021569065749645233, -0.0765870213508606, -0.0689362958073616, 0.030313830822706223, 0.00631376588717103, 0.009740948677062988, -0.01590917259454727, -0.02377564273774624, 0.0676676407456398, 0.04099714010953903, 0.018932275474071503, -0.025304794311523438, 0.028258733451366425, 0.06501137465238571, -0.03375834599137306, -0.006737180985510349, 0.00012671294098254293, -0.05003959685564041, 0.017658956348896027, -0.07017691433429718, 0.008282603695988655, -0.059830475598573685, -0.014505285769701004, 0.015966078266501427, 0.051268234848976135, 0.005494216922670603, -0.027746591717004776, 0.015294468030333519, -0.025891903787851334, -0.0949527844786644, -0.006758851930499077, 0.010231881402432919, -0.11911391466856003, -0.05127039924263954, -0.019584715366363525, -0.08299709111452103, -0.046727005392313004, -0.02476571872830391, 0.0780121311545372, 0.02752782590687275, -0.0020365274976938963, -0.06638173013925552, 0.005260053556412458, 0.043095044791698456, 0.02444094978272915, 0.03432254120707512, 0.16283760964870453, 0.013712308369576931, 0.06848213821649551, 0.0016574868932366371, -0.09238329529762268, -0.006224730983376503, -0.05097219720482826, 0.05279556289315224, 0.0717540755867958, 0.058226633816957474, 0.10640387237071991, 0.04950074851512909, -0.0407983660697937, 0.053175993263721466, 0.022387230768799782, -0.049167800694704056, -0.04365586116909981, 0.08013679832220078, -0.07280921190977097, -0.001075758133083582, -0.0069554876536130905, -0.03527311608195305, 0.018041886389255524, -0.09934099018573761, -0.03221341222524643, -0.029424915090203285, 0.06282992660999298, -0.1023600697517395, 0.015739571303129196, 0.008804861456155777, -0.029444532468914986, -0.023714551702141762, -0.010214393958449364, -0.020285312086343765, 0.05102457478642464, -0.08170317113399506, -0.058622609823942184, 0.06400823593139648, -7.884338157972634e-34, 0.0729229673743248, -0.13157162070274353, 0.03286828473210335, 0.013069959357380867, -0.005224172957241535, -0.09458627551794052, 0.02728443592786789, -0.01477279793471098, -0.0025999832432717085, 0.01211476232856512, 0.03028934821486473, -0.02997140772640705, 0.0030410047620534897, -0.06194020435214043, 0.04312494397163391, 0.0794973373413086, -0.03940178081393242, -0.05725125968456268, 0.05755719915032387, 0.04724131524562836, 0.0024340455420315266, 0.06757838279008865, 0.014831866137683392, 0.08244681358337402, 0.047386083751916885, -0.045723073184490204, -0.0672692134976387, 0.014021006412804127, -0.0465473048388958, -0.005728514399379492, -0.014591522514820099, -0.005860764998942614, -0.025890717282891273, 0.030516983941197395, -0.03865266591310501, -0.026183880865573883, -0.03678872436285019, 0.055410631000995636, 0.013722100295126438, -0.03283991664648056, 0.0017417463241145015, 0.016902709379792213, 0.0640423595905304, 0.056004930287599564, -0.0583907850086689, -0.002289730357006192, 0.041955605149269104, 0.024952923879027367, 0.026874981820583344, 0.03110477328300476, 0.060378510504961014, -0.01276305504143238, -0.06897840648889542, 0.06278227269649506, -0.02460356242954731, -0.0775657519698143, -0.024066369980573654, -0.0354917012155056, -0.12568803131580353, 0.027072150260210037, 0.004189237020909786, 0.031247081235051155, -0.057346612215042114, -0.007895879447460175, 0.028322922065854073, -0.08413670212030411, -0.0933459997177124, 0.004318612162023783, 0.027836045250296593, 0.015992213040590286, 0.03504335507750511, -0.046467479318380356, 0.07886804640293121, 0.03706272691488266, 0.004149601794779301, -0.027071233838796616, 0.04258105158805847, 0.007690399885177612, 0.037738554179668427, 0.024214422330260277, -0.0518403984606266, 0.019039418548345566, 0.02157573588192463, 0.05412384867668152, -0.05705580487847328, -0.005387688521295786, -0.021114641800522804, 0.01380680687725544, -0.05041027069091797, -0.005904271267354488, 0.07226136326789856, -0.08265608549118042, -0.04769495502114296, -0.03817190229892731, 0.05431942269206047, -5.0088729608432914e-8, -0.05358627438545227, -0.0011271961266174912, -0.06623531877994537, -0.009029903449118137, 0.02259001135826111, 0.03149167075753212, 0.05715034529566765, 0.12033196538686752, -0.07912177592515945, -0.00965944491326809, 0.002668525790795684, 0.05544986575841904, -0.027513986453413963, -0.006728564854711294, -0.03944412246346474, -0.048621464520692825, -0.009622680954635143, -0.0030116732232272625, -0.0015622396022081375, 0.034794799983501434, 0.04890851303935051, 0.01641823723912239, 0.009225554764270782, 0.03073190152645111, 0.023194342851638794, 0.009875656105577946, 0.04973163828253746, -0.0018401489360257983, 0.04652233421802521, -0.006605705711990595, -0.046551428735256195, 0.005884137470275164, -0.08399845659732819, 0.025841157883405685, 0.06953065097332001, -0.04654007405042648, 0.0005708384560421109, 0.03503270819783211, -0.07916458696126938, 0.05698387324810028, 0.09953999519348145, 0.04607335850596428, -0.03695964440703392, 0.04926695302128792, -0.008352512493729591, -0.05707120522856712, 0.006039316765964031, 0.0032188300974667072, 0.12639836966991425, -0.00019749968487303704, 0.040848907083272934, -0.09483786672353745, -0.03180791065096855, -0.06578385829925537, -0.09238738566637039, -0.006438669748604298, 0.053941596299409866, 0.02270456962287426, 0.0075635346584022045, -0.005216727964580059, 0.10395045578479767, -0.026549087837338448, 0.04351271316409111, 0.07390429824590683 ]
0.028882
[[query-dsl-geo-distance-query]] === Geo Distance Query Filters documents that include only hits that exists within a specific distance from a geo point. Assuming the following mapping and indexed document: [source,js] -------------------------------------------------- PUT /my\_locations { "mappings": { "\_doc": { "properties": { "pin": { "properties": { "location": { "type": "geo\_point" } } } } } } } PUT /my\_locations/\_doc/1 { "pin" : { "location" : { "lat" : 40.12, "lon" : -71.34 } } } -------------------------------------------------- // CONSOLE // TESTSETUP Then the following simple query can be executed with a `geo\_distance` filter: [source,js] -------------------------------------------------- GET /my\_locations/\_search { "query": { "bool" : { "must" : { "match\_all" : {} }, "filter" : { "geo\_distance" : { "distance" : "200km", "pin.location" : { "lat" : 40, "lon" : -70 } } } } } } -------------------------------------------------- // CONSOLE [float] ==== Accepted Formats In much the same way the `geo\_point` type can accept different representations of the geo point, the filter can accept it as well: [float] ===== Lat Lon As Properties [source,js] -------------------------------------------------- GET /my\_locations/\_search { "query": { "bool" : { "must" : { "match\_all" : {} }, "filter" : { "geo\_distance" : { "distance" : "12km", "pin.location" : { "lat" : 40, "lon" : -70 } } } } } } -------------------------------------------------- // CONSOLE [float] ===== Lat Lon As Array Format in `[lon, lat]`, note, the order of lon/lat here in order to conform with http://geojson.org/[GeoJSON]. [source,js] -------------------------------------------------- GET /my\_locations/\_search { "query": { "bool" : { "must" : { "match\_all" : {} }, "filter" : { "geo\_distance" : { "distance" : "12km", "pin.location" : [-70, 40] } } } } } -------------------------------------------------- // CONSOLE [float] ===== Lat Lon As String Format in `lat,lon`. [source,js] -------------------------------------------------- GET /my\_locations/\_search { "query": { "bool" : { "must" : { "match\_all" : {} }, "filter" : { "geo\_distance" : { "distance" : "12km", "pin.location" : "40,-70" } } } } } -------------------------------------------------- // CONSOLE [float] ===== Geohash [source,js] -------------------------------------------------- GET /my\_locations/\_search { "query": { "bool" : { "must" : { "match\_all" : {} }, "filter" : { "geo\_distance" : { "distance" : "12km", "pin.location" : "drm3btev3e86" } } } } } -------------------------------------------------- // CONSOLE [float] ==== Options The following are options allowed on the filter: [horizontal] `distance`:: The radius of the circle centred on the specified location. Points which fall into this circle are considered to be matches. The `distance` can be specified in various units. See <>. `distance\_type`:: How to compute the distance. Can either be `arc` (default), or `plane` (faster, but inaccurate on long distances and close to the poles). `\_name`:: Optional name field to identify the query `validation\_method`:: Set to `IGNORE\_MALFORMED` to accept geo points with invalid latitude or longitude, set to `COERCE` to additionally try and infer correct coordinates (default is `STRICT`). [float] ==== geo\_point Type The filter \*requires\* the `geo\_point` type to be set on the relevant field. [float] ==== Multi Location Per Document The `geo\_distance` filter can work with multiple locations / points per document. Once a single location / point matches the filter, the document will be included in the filter. [float] ==== Ignore Unmapped When set to `true` the `ignore\_unmapped` option will ignore an unmapped field and will not match any documents for this query. This can be useful when querying multiple indexes which might have different mappings. When set to `false` (the default value) the query will throw an exception if the field is not mapped.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/geo-distance-query.asciidoc
6.2
elasticsearch-6-2
[ 0.021101873368024826, 0.05885227024555206, 0.09463747590780258, -0.0034582384396344423, 0.014081073924899101, -0.0006952056428417563, 0.008039058186113834, 0.011355232447385788, 0.0646146833896637, -0.042450301349163055, -0.03872401639819145, 0.00456169992685318, 0.01534095499664545, -0.0012861440191045403, -0.03478541225194931, 0.05301729217171669, -0.035121381282806396, 0.024612320587038994, -0.04049214348196983, -0.017377274110913277, 0.07696686685085297, 0.05702913552522659, 0.03323253244161606, 0.02874668873846531, -0.0020272734109312296, 0.033630695194005966, -0.0072812484577298164, -0.05245374143123627, -0.025188250467181206, 0.07681053131818771, -0.029760241508483887, -0.05134004354476929, -0.07400916516780853, 0.023534400388598442, 0.0353933721780777, -0.01854461245238781, 0.011879551224410534, -0.03404444083571434, 0.024372829124331474, -0.006582301575690508, 0.04109760373830795, 0.02586147002875805, 0.02568412572145462, -0.0544770173728466, 0.0043596974574029446, -0.05761893466114998, -0.04485274851322174, 0.03727014362812042, 0.004623288754373789, 0.021258331835269928, -0.12544792890548706, -0.050655584782361984, -0.08448652178049088, -0.07018923759460449, 0.03145604953169823, 0.02313593029975891, -0.08192918449640274, 0.00691903056576848, 0.02113974094390869, -0.11307994276285172, 0.09920265525579453, -0.08293773233890533, 0.01916184090077877, -0.007597221061587334, 0.003530436661094427, -0.03298994153738022, -0.045190561562776566, 0.06082525476813316, 0.0472988523542881, 0.007369980216026306, 0.025007622316479683, 0.03439199924468994, -0.018741263076663017, -0.028981316834688187, 0.09131809324026108, 0.011270296759903431, -0.04942161589860916, 0.00042427564039826393, 0.014549653977155685, -0.031575966626405716, -0.006381286308169365, -0.09931187331676483, 0.04129600524902344, 0.04837037995457649, -0.047810595482587814, -0.03181635960936546, 0.030943959951400757, -0.08455491065979004, 0.07734887301921844, -0.11050349473953247, -0.04795112460851669, -0.10747051239013672, -0.05936772748827934, -0.03575102984905243, 0.03412969410419464, -0.014166428707540035, -0.024541204795241356, -0.034124117344617844, 0.07801050692796707, 0.01948285661637783, 0.05912798270583153, -0.0016324083553627133, -0.023370202630758286, -0.05343932285904884, 0.0456993542611599, 0.026781784370541573, -0.07611386477947235, -0.01689481921494007, -0.03099256567656994, 0.03791611269116402, -0.007030619774013758, 0.08588545024394989, -0.0456094928085804, -0.009454050101339817, -0.08507198095321655, 0.02100890316069126, 0.1126393973827362, -0.026557069271802902, 0.0010868215467780828, 0.009963649325072765, 0.007441923022270203, -0.008458295837044716, -0.02341693639755249, -0.027917584404349327, -0.018770990893244743, 0.0003537113661877811, 0.06293176114559174, -1.6829921799417245e-33, 0.05899712070822716, -0.08594007790088654, 0.007920447736978531, -0.024893565103411674, -0.01357146818190813, 0.018029462546110153, -0.013392040506005287, 0.058419518172740936, -0.03125555068254471, 0.06526493281126022, -0.07352707535028458, -0.008046820759773254, 0.016758974641561508, -0.07423515617847443, 0.00970563292503357, 0.0009700838709250093, 0.03437670320272446, -0.012648094445466995, -0.03282551094889641, 0.02797323279082775, 0.02627529948949814, -0.09037688374519348, -0.031905464828014374, 0.0028802412562072277, -0.00218399940058589, -0.03630199655890465, -0.11385393887758255, -0.002920368453487754, -0.1224588081240654, -0.00944619532674551, -0.032108429819345474, 0.025588825345039368, -0.014407949522137642, -0.025873614475131035, 0.05668757110834122, 0.030245386064052582, -0.026616336777806282, -0.018347233533859253, 0.020939387381076813, -0.024471625685691833, -0.004299470689147711, -0.008685621432960033, -0.048149771988391876, -0.08295547217130661, 0.031244978308677673, 0.020549016073346138, -0.053711749613285065, -0.03819460794329643, -0.008354280143976212, 0.024378258734941483, -0.03659359738230705, 0.04998031631112099, -0.057284291833639145, -0.04970993101596832, 0.06025366485118866, -0.054750632494688034, -0.043229151517152786, 0.09193392097949982, 0.03318043798208237, 0.04602782800793648, -0.022397467866539955, -0.006618313957005739, 0.05471197888255119, 0.006499353796243668, 0.11090356856584549, -0.02644151635468006, 0.04469174146652222, 0.1148538887500763, -0.00588979572057724, 0.028682485222816467, 0.07723680138587952, 0.027815883979201317, 0.030926000326871872, 0.011130418628454208, 0.008925294503569603, -0.11193768680095673, -0.012765808030962944, 0.016429027542471886, 0.0155242420732975, 0.018128838390111923, -0.09350881725549698, -0.07139449566602707, -0.09121837466955185, 0.03190501779317856, -0.05145278200507164, 0.05665754899382591, 0.014071037992835045, -0.017619479447603226, -0.0420280359685421, -0.04686148837208748, -0.024974793195724487, 0.014697792008519173, -0.13526064157485962, -0.13827072083950043, 0.033744364976882935, -1.765144541384817e-33, 0.04909271374344826, -0.12687867879867554, 0.0905703529715538, 0.003955037333071232, -0.024691440165042877, -0.07865012437105179, 0.06010681390762329, 0.03452972322702408, 0.06612086296081543, 0.0950169786810875, -0.05453220382332802, -0.044040974229574203, 0.04620179161429405, -0.03166872635483742, -0.012591466307640076, 0.09096764773130417, -0.037877265363931656, -0.08134036511182785, -0.02326356992125511, 0.033190034329891205, 0.012010853737592697, 0.006331227719783783, -0.00994347594678402, 0.11453615874052048, 0.012403936125338078, -0.04723168537020683, -0.01905895210802555, -0.058970678597688675, -0.13196901977062225, -0.04342450201511383, -0.029166148975491524, 0.012435242533683777, 0.0007367125945165753, 0.0336490198969841, -0.04526250809431076, -0.015442569740116596, 0.004472328349947929, 0.12426500022411346, 0.007753902580589056, 0.03603915497660637, -0.039793673902750015, -0.003499067621305585, 0.006823345087468624, 0.021900583058595657, 0.007002268452197313, 0.0056487382389605045, 0.07523868978023529, 0.037793707102537155, -0.05382709577679634, -0.016696754842996597, 0.015329253859817982, 0.006018483079969883, -0.022762831300497055, 0.04653773084282875, -0.04488131403923035, -0.0412350594997406, -0.04422544315457344, -0.04653848335146904, -0.0376337505877018, -0.006325752940028906, -0.0037967588286846876, -0.011699742637574673, 0.03889912739396095, 0.07239652425050735, 0.06000465527176857, -0.03336203470826149, -0.08548334985971451, 0.0314868800342083, -0.003874465124681592, -0.03558735176920891, -0.02010251022875309, 0.01132700964808464, 0.06641066074371338, 0.029048040509223938, 0.028960172086954117, 0.0034346673637628555, 0.050525225698947906, 0.006764769554138184, 0.05638886243104935, 0.0014061006950214505, -0.016226448118686676, 0.06873153895139694, -0.019604897126555443, 0.08158130943775177, 0.04062414541840553, 0.05501743406057358, -0.034279439598321915, -0.010650158859789371, -0.07865214347839355, -0.011557589285075665, -0.03431393578648567, 0.02780245430767536, -0.05173655226826668, -0.08464264869689941, -0.06595154851675034, -4.4609102189951955e-8, -0.11085078120231628, 0.09457196295261383, -0.06563105434179306, 0.05380161479115486, -0.06472110003232956, 0.103675477206707, 0.10895878821611404, 0.12484828382730484, -0.07356076687574387, -0.027653908357024193, 0.0570160374045372, 0.0640188679099083, 0.012685881927609444, 0.04527921602129936, -0.051054008305072784, -0.13071101903915405, 0.012982312589883804, -0.008298305794596672, -0.039726126939058304, 0.07139429450035095, 0.04431428387761116, 0.0359032079577446, 0.03509142994880676, 0.02308904007077217, 0.09183648973703384, 0.022178905084729195, 0.026491237804293633, 0.024397311732172966, 0.12791550159454346, -0.01801508665084839, 0.010382608510553837, -0.026163717731833458, -0.020725637674331665, 0.07623505592346191, 0.005181143060326576, -0.03484546020627022, 0.009443812072277069, 0.0984559878706932, -0.1324639618396759, 0.05158659815788269, -0.0028875949792563915, -0.010678097605705261, -0.03038606606423855, 0.050776779651641846, 0.01516814436763525, -0.016259629279375076, 0.04778899997472763, -0.00943304505199194, 0.07389675080776215, 0.015641722828149796, -0.030247868970036507, -0.052209969609975815, 0.00950793270021677, 0.014451857656240463, 0.0020656047854572535, -0.0654173195362091, 0.042993247509002686, 0.006389262620359659, -0.036199141293764114, -0.013347257860004902, -0.026341212913393974, -0.006375819910317659, -0.025893766433000565, 0.04686493054032326 ]
0.02559
to `false` (the default value) the query will throw an exception if the field is not mapped.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/geo-distance-query.asciidoc
6.2
elasticsearch-6-2
[ 0.06492508947849274, 0.027042530477046967, -0.00939260981976986, 0.032629143446683884, -0.059415303170681, -0.02906378172338009, 0.015060040168464184, -0.023177821189165115, 0.023416055366396904, -0.006156289950013161, 0.0434679314494133, -0.051490891724824905, 0.06866330653429031, -0.0474090538918972, -0.06060625985264778, 0.0297487061470747, 0.06640049070119858, -0.02603139355778694, 0.03817414119839668, -0.002329503418877721, 0.003654200118035078, 0.046589601784944534, -0.03509582579135895, 0.017796633765101433, -0.005811980459839106, -0.0549071729183197, -0.003782442305237055, -0.03439389541745186, 0.0032974560745060444, -0.011962284334003925, -0.14040134847164154, 0.08518198877573013, -0.13749651610851288, 0.07159990072250366, 0.11972498893737793, -0.039262015372514725, 0.003271547146141529, 0.014423184096813202, 0.04710118845105171, 0.015315382741391659, -0.0024977768771350384, -0.06355764716863632, 0.04445827752351761, -0.009293277747929096, -0.03642144054174423, 0.03102363459765911, -0.013475975021719933, -0.04818803817033768, -0.03374429792165756, -0.013551546260714531, -0.0855434238910675, 0.07481131702661514, -0.03975638747215271, 0.007947483099997044, 0.04065720736980438, 0.054517678916454315, -0.11100448668003082, 0.02353372797369957, -0.04883662611246109, 0.03870797157287598, -0.0416368804872036, -0.03958360105752945, 0.02934846468269825, 0.04217386245727539, 0.036134734749794006, 0.028987936675548553, -0.037818923592567444, -0.07774677127599716, 0.07643549889326096, -0.008917205035686493, 0.09323860704898834, -0.014074448496103287, -0.07841463387012482, 0.017090775072574615, 0.001868993858806789, 0.1320684254169464, -0.03305187076330185, -0.0314023420214653, 0.062563955783844, 0.027210015803575516, -0.028478655964136124, -0.05532553046941757, -0.08195014297962189, -0.04281775653362274, 0.06863896548748016, -0.013277750462293625, -0.043382350355386734, -0.04506814852356911, 0.041679222136735916, 0.0743921771645546, -0.06931129842996597, -0.055764392018318176, 0.022919684648513794, 0.05569607764482498, 0.03882163017988205, 0.026418032124638557, 0.062414392828941345, -0.024327732622623444, -0.0020307302474975586, -0.028256649151444435, 0.044978655874729156, -0.05415582284331322, 0.0075105540454387665, 0.015686918050050735, 0.001374347717501223, -0.07524403184652328, 0.08260338008403778, -0.08232784271240234, -0.029879974201321602, 0.012809562496840954, -0.0010041211498901248, 0.04379414767026901, 0.09648939967155457, -0.06867288053035736, -0.10530054569244385, 0.034631114453077316, 0.07556942850351334, 0.03153251111507416, -0.13567006587982178, -0.032272495329380035, -0.032732296735048294, 0.03380962461233139, 0.022892577573657036, -0.015859946608543396, -0.09613995999097824, -0.06799745559692383, 0.004043534863740206, -4.368727326224924e-33, 0.04457438364624977, 0.0021995967254042625, 0.08754517883062363, -0.0961151048541069, -0.06547861546278, 0.012141293846070766, -0.05896640196442604, 0.07251428067684174, 0.042842525988817215, 0.07132226973772049, 0.045790042728185654, -0.010834582149982452, 0.028500104323029518, -0.005872247740626335, -0.009052058681845665, 0.12939545512199402, 0.04152154177427292, -0.025257239118218422, 0.004769773688167334, -0.03857889771461487, 0.05976111441850662, -0.02121092937886715, -0.02825292944908142, 0.03914967179298401, 0.005096497479826212, 0.042512305080890656, -0.1163208931684494, -0.013203698210418224, -0.028412671759724617, 0.03939349949359894, -0.09092354029417038, -0.01254555955529213, 0.03392656892538071, 0.031041549518704414, 0.07134570181369781, 0.0516023114323616, 0.009368835017085075, 0.016268648207187653, -0.04428931325674057, 0.012572403065860271, 0.004627711605280638, -0.016934610903263092, 0.044544629752635956, -0.023872138932347298, 0.02939346805214882, -0.11878971010446548, -0.0027001628186553717, 0.013528975658118725, -0.03173059970140457, -0.047063156962394714, 0.04842023178935051, 0.01190185360610485, -0.01502922736108303, 0.05036424845457077, 0.04233044385910034, -0.043270256370306015, 0.014028173871338367, 0.01276362407952547, -0.05162018537521362, 0.0330091193318367, -0.04348742589354515, -0.05779349058866501, -0.049215301871299744, -0.03470080718398094, -0.054245080798864365, 0.03305285796523094, 0.04956560954451561, -0.060777079313993454, -0.031083518639206886, -0.08498823642730713, 0.07504823803901672, -0.03021157719194889, -0.045752547681331635, 0.003568834625184536, -0.037549350410699844, 0.014071635901927948, -0.003597160568460822, -0.019930405542254448, 0.04778362065553665, 0.03816245123744011, 0.018529310822486877, -0.03837694972753525, -0.058860428631305695, 0.06089019402861595, -0.05714729055762291, 0.04501022771000862, 0.03617886081337929, 0.05282512679696083, -0.032930999994277954, -0.006736305542290211, 0.11799325793981552, -0.021013103425502777, -0.04858802258968353, 0.049572333693504333, 0.05929381772875786, 1.1080856272743834e-33, 0.004582402296364307, -0.043928805738687515, -0.03797317296266556, -0.000820291053969413, -0.02703716792166233, -0.055519476532936096, 0.16725511848926544, -0.025844933465123177, 0.00191746826749295, -0.01206847932189703, 0.06483818590641022, -0.05409673601388931, -0.04065614193677902, 0.01992594450712204, 0.043692708015441895, -0.023528890684247017, -0.05373314395546913, -0.032626643776893616, -0.012289123609662056, 0.08343881368637085, 0.024813534691929817, 0.060763951390981674, -0.07699351012706757, 0.06913316249847412, -0.011685560457408428, 0.03240518644452095, -0.09753505885601044, -0.03276151418685913, -0.07423430681228638, 0.0064783780835568905, 0.08234324306249619, -0.006113764829933643, -0.046888917684555054, -0.10670125484466553, -0.02428763546049595, -0.021960627287626266, 0.006444214843213558, 0.04568727687001228, -0.023021001368761063, 0.0714191123843193, -0.02213229238986969, 0.0038553494960069656, -0.05799305438995361, 0.09387087821960449, 0.01787632331252098, -0.06963653862476349, 0.045614052563905716, 0.0008292303537018597, 0.09810544550418854, 0.04406885802745819, 0.0021892457734793425, 0.0027896794490516186, 0.058514632284641266, 0.023479832336306572, 0.03778364881873131, -0.002263918984681368, -0.04621706157922745, -0.022238651290535927, 0.039403095841407776, -0.0025338982231914997, 0.026372255757451057, 0.019516732543706894, -0.021724674850702286, -0.00670917984098196, -0.043900154531002045, -0.00386080052703619, -0.036785274744033813, 0.09122595191001892, 0.02910088188946247, -0.0583435595035553, 0.0038265667390078306, -0.008473257534205914, 0.009614787064492702, -0.038098495453596115, 0.012109510600566864, 0.03989695757627487, 0.022487744688987732, 0.08246710151433945, 0.06826695799827576, -0.013667328283190727, 0.03709106147289276, -0.019139189273118973, 0.0375911220908165, 0.061099473387002945, -0.002666527172550559, 0.00007404830103041604, -0.028768394142389297, -0.040432754904031754, -0.03276035562157631, 0.07014693319797516, 0.023638345301151276, -0.023010818287730217, -0.1107463613152504, -0.04213953763246536, -0.048449426889419556, -2.352665262606024e-8, -0.09613031893968582, 0.05918927490711212, -0.013644947670400143, 0.044337499886751175, 0.018343981355428696, -0.08228160440921783, 0.1085265651345253, 0.059712737798690796, -0.009914069436490536, -0.011025648564100266, -0.04307578504085541, 0.018101952970027924, -0.019917020574212074, -0.04722259193658829, 0.045590393245220184, -0.020709557458758354, -0.0028280308470129967, -0.009964833967387676, -0.03067670203745365, -0.04670465365052223, -0.08243914693593979, -0.027455735951662064, -0.11424793303012848, 0.003770479466766119, 0.04690718278288841, -0.0074470932595431805, 0.006354170851409435, -0.026229869574308395, 0.08870997279882431, 0.033335741609334946, 0.02144600637257099, -0.023549038916826248, 0.04751411825418472, 0.06588432192802429, -0.1138077974319458, 0.04388899728655815, 0.03160358965396881, -0.02747260220348835, -0.09499108791351318, -0.013746599666774273, 0.02139918878674507, 0.05149191617965698, -0.02645973674952984, 0.005852065049111843, -0.09863895922899246, 0.02267516404390335, 0.09909050911664963, 0.04872293397784233, 0.07659108936786652, -0.0442831814289093, -0.08412717282772064, 0.025235941633582115, 0.0017012580065056682, 0.03625936806201935, -0.017767565324902534, -0.015371628105640411, 0.07792975008487701, 0.07599890977144241, -0.001987866824492812, -0.021062612533569336, 0.03757501393556595, -0.04959729313850403, -0.08090611547231674, 0.02675878256559372 ]
-0.024617
[[query-dsl-term-query]] === Term Query The `term` query finds documents that contain the \*exact\* term specified in the inverted index. For instance: [source,js] -------------------------------------------------- POST \_search { "query": { "term" : { "user" : "Kimchy" } <1> } } -------------------------------------------------- // CONSOLE <1> Finds documents which contain the exact term `Kimchy` in the inverted index of the `user` field. A `boost` parameter can be specified to give this `term` query a higher relevance score than another query, for instance: [source,js] -------------------------------------------------- GET \_search { "query": { "bool": { "should": [ { "term": { "status": { "value": "urgent", "boost": 2.0 <1> } } }, { "term": { "status": "normal" <2> } } ] } } } -------------------------------------------------- // CONSOLE <1> The `urgent` query clause has a boost of `2.0`, meaning it is twice as important as the query clause for `normal`. <2> The `normal` clause has the default neutral boost of `1.0`. A `term` query can also match against <>. .Why doesn't the `term` query match my document? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* String fields can be of type `text` (treated as full text, like the body of an email), or `keyword` (treated as exact values, like an email address or a zip code). Exact values (like numbers, dates, and keywords) have the exact value specified in the field added to the inverted index in order to make them searchable. However, `text` fields are `analyzed`. This means that their values are first passed through an <> to produce a list of terms, which are then added to the inverted index. There are many ways to analyze text: the default <> drops most punctuation, breaks up text into individual words, and lower cases them. For instance, the `standard` analyzer would turn the string ``Quick Brown Fox!'' into the terms [`quick`, `brown`, `fox`]. This analysis process makes it possible to search for individual words within a big block of full text. The `term` query looks for the \*exact\* term in the field's inverted index -- it doesn't know anything about the field's analyzer. This makes it useful for looking up values in keyword fields, or in numeric or date fields. When querying full text fields, use the <> instead, which understands how the field has been analyzed. To demonstrate, try out the example below. First, create an index, specifying the field mappings, and index a document: [source,js] -------------------------------------------------- PUT my\_index { "mappings": { "\_doc": { "properties": { "full\_text": { "type": "text" <1> }, "exact\_value": { "type": "keyword" <2> } } } } } PUT my\_index/\_doc/1 { "full\_text": "Quick Foxes!", <3> "exact\_value": "Quick Foxes!" <4> } -------------------------------------------------- // CONSOLE <1> The `full\_text` field is of type `text` and will be analyzed. <2> The `exact\_value` field is of type `keyword` and will NOT be analyzed. <3> The `full\_text` inverted index will contain the terms: [`quick`, `foxes`]. <4> The `exact\_value` inverted index will contain the exact term: [`Quick Foxes!`]. Now, compare the results for the `term` query and the `match` query: [source,js] -------------------------------------------------- GET my\_index/\_search { "query": { "term": { "exact\_value": "Quick Foxes!" <1> } } } GET my\_index/\_search { "query": { "term": { "full\_text": "Quick Foxes!" <2> } } } GET my\_index/\_search { "query": { "term": { "full\_text": "foxes" <3> } } } GET my\_index/\_search { "query": { "match": { "full\_text": "Quick Foxes!" <4> } } } -------------------------------------------------- // CONSOLE // TEST[continued] <1> This query matches because the `exact\_value` field contains the exact term `Quick Foxes!`. <2> This query does not match, because the `full\_text` field only contains the terms `quick` and `foxes`. It does not contain the exact term `Quick Foxes!`. <3> A `term` query for the term `foxes`
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/term-query.asciidoc
6.2
elasticsearch-6-2
[ -0.06233496591448784, 0.0689084529876709, 0.004592463374137878, 0.06226768717169762, 0.0029419970232993364, -0.0028514014557003975, 0.03910017013549805, 0.012395636178553104, 0.03740645945072174, -0.07127627730369568, -0.04378563165664673, -0.04191678762435913, 0.029441118240356445, -0.0631232038140297, -0.016379492357373238, 0.07095442712306976, -0.03333180770277977, 0.03839733824133873, -0.015132841654121876, -0.07870715111494064, 0.049679841846227646, 0.05790266767144203, 0.0012835219968110323, -0.058204978704452515, 0.016317132860422134, 0.002095036907121539, -0.04257602244615555, -0.034311532974243164, 0.043081365525722504, 0.07364074140787125, -0.034853361546993256, 0.07982899248600006, 0.028953343629837036, 0.07983022183179855, -0.0677579790353775, -0.03214026615023613, -0.06391763687133789, -0.03167545050382614, 0.036726292222738266, 0.015390449203550816, 0.01393277570605278, 0.06507431715726852, -0.07274573296308517, -0.05832746997475624, 0.012553445994853973, -0.09536740183830261, -0.09562025219202042, -0.03274727985262871, 0.006794077809900045, 0.019954562187194824, -0.14571988582611084, 0.003465744899585843, -0.09947741031646729, 0.027171768248081207, 0.032557979226112366, 0.03321800008416176, -0.14040523767471313, 0.00209497450850904, -0.015646278858184814, -0.08239477127790451, 0.045720845460891724, -0.08814233541488647, -0.045215632766485214, -0.03494491055607796, 0.04957444593310356, -0.06512302905321121, 0.01411238219588995, -0.049198463559150696, 0.018088839948177338, 0.01863802596926689, 0.027143346145749092, -0.01652025617659092, -0.019651899114251137, -0.039219990372657776, -0.020429370924830437, 0.02307516522705555, -0.0030818984378129244, -0.0027358552906662226, -0.014101561158895493, 0.04189038649201393, 0.006021216977387667, -0.05512140691280365, -0.029600968584418297, -0.018466606736183167, -0.0029921995010226965, -0.006603924557566643, -0.015710487961769104, -0.15234717726707458, 0.048222340643405914, -0.006190951447933912, -0.015261364169418812, -0.10671312361955643, 0.021264726296067238, -0.028437267988920212, 0.031560443341732025, -0.023739062249660492, 0.03321361169219017, 0.02045455574989319, 0.08962207287549973, 0.05202537029981613, 0.04387008026242256, -0.006877013016492128, -0.03730356693267822, -0.09006126970052719, -0.07391995191574097, 0.03443827107548714, -0.03855453059077263, 0.013811741024255753, 0.03196459263563156, 0.0006435465766116977, -0.027976883575320244, 0.0441005602478981, 0.02612067200243473, -0.03411125764250755, -0.029695598408579826, -0.03274598345160484, 0.09876784682273865, -0.03799089789390564, 0.03481937572360039, 0.10306187719106674, 0.06918614357709885, 0.06369141489267349, 0.008338249288499355, -0.014782464131712914, -0.036536429077386856, -0.0031116853933781385, 0.012531601823866367, 1.3076389258024173e-33, 0.09462601691484451, 0.018927300348877907, 0.054431941360235214, -0.0699000433087349, -0.04654604196548462, 0.07122819125652313, 0.008565281517803669, 0.06093282625079155, -0.0695691630244255, 0.037920404225587845, -0.09224493056535721, 0.10625617951154709, -0.03957805782556534, -0.018788296729326248, -0.04715922847390175, -0.026178233325481415, 0.0005788716371171176, 0.013756255619227886, -0.025219693779945374, 0.011053429916501045, 0.07634620368480682, -0.006245496217161417, -0.01801694743335247, -0.011331452988088131, 0.01832159236073494, -0.07953250408172607, 0.003915587905794382, -0.04108084365725517, -0.09000560641288757, 0.002521292306482792, -0.05707812309265137, -0.014026151038706303, 0.0023199296556413174, -0.023963194340467453, 0.01583736017346382, 0.06864769011735916, -0.012638252228498459, 0.00810416229069233, -0.01861640438437462, 0.004410366993397474, -0.05923119932413101, 0.01510586030781269, -0.016417553648352623, -0.14381234347820282, -0.09779435396194458, -0.002096032490953803, -0.04207342863082886, -0.06561218947172165, 0.026467448100447655, 0.003407855983823538, -0.048386406153440475, 0.007441217545419931, -0.06925521790981293, 0.020064759999513626, 0.06402414292097092, 0.060470100492239, 0.03846411779522896, 0.12466686964035034, 0.0022082289215177298, 0.07078064233064651, -0.023560836911201477, -0.004134041257202625, 0.012334258295595646, 0.008867444470524788, 0.012077676132321358, 0.02438162826001644, 0.005948691163212061, 0.08971662819385529, 0.014772536233067513, 0.10934516787528992, 0.042255498468875885, 0.01618349924683571, 0.08277121186256409, -0.037285782396793365, 0.05224066972732544, -0.042483776807785034, -0.05691053345799446, 0.03417585790157318, -0.052862733602523804, -0.0002045239380095154, -0.10106399655342102, -0.05020824074745178, -0.017671771347522736, 0.020624404773116112, -0.06480246782302856, 0.04817986488342285, 0.014547761529684067, -0.028449438512325287, -0.058612748980522156, -0.019425293430685997, -0.02807137556374073, 0.05383787676692009, -0.09105072915554047, -0.055587444454431534, -0.007406166289001703, -4.189541212199313e-33, 0.03570660203695297, -0.15107643604278564, 0.00817568227648735, -0.04226251691579819, -0.011791566386818886, -0.0676054134964943, 0.00425737677142024, -0.010760103352367878, -0.024151865392923355, -0.0002008134324569255, 0.015557553619146347, 0.012155457399785519, 0.06105400249361992, -0.03103490360081196, 0.05345635116100311, 0.08471483737230301, -0.04201275482773781, 0.032644566148519516, -0.06449836492538452, 0.06988970190286636, -0.0107634412124753, 0.08095668256282806, -0.07510975003242493, 0.07704498618841171, 0.012066598981618881, -0.04598870500922203, 0.04459599405527115, 0.04929104819893837, -0.04845878481864929, 0.02219429425895214, -0.02153419516980648, 0.0008337156032212079, -0.058259688317775726, -0.04167278856039047, -0.06858813762664795, 0.01642659865319729, -0.02774807997047901, 0.0013935626484453678, -0.02805393375456333, 0.08812492340803146, -0.008609874173998833, 0.047340113669633865, 0.021056989207863808, 0.04268931970000267, 0.004870505537837744, -0.03503279387950897, -0.07512619346380234, 0.034115128219127655, 0.06686549633741379, -0.07914453744888306, 0.03374718502163887, -0.007248738314956427, -0.03553183004260063, 0.06935179233551025, -0.013476054184138775, -0.05780263617634773, -0.0766846239566803, -0.06337305158376694, -0.01585346646606922, 0.03787202015519142, -0.02210354059934616, 0.041200824081897736, 0.00565350940451026, -0.023366296663880348, 0.025367233902215958, -0.05497139319777489, -0.0023717607837170362, -0.0012715456541627645, 0.04419168084859848, -0.05559777095913887, 0.027887169271707535, -0.019945630803704262, 0.11503689736127853, 0.030028266832232475, 0.017926396802067757, 0.01919088326394558, 0.02408403903245926, 0.031658101826906204, 0.0380232110619545, -0.018917374312877655, -0.021602436900138855, 0.02581012062728405, 0.030398821458220482, 0.10719966143369675, -0.08049134165048599, 0.06403208523988724, -0.03220061585307121, 0.10371597856283188, -0.04125242680311203, -0.06306035071611404, -0.002396566793322563, -0.05848591774702072, -0.06811724603176117, -0.02993282675743103, 0.043316490948200226, -5.331597563440482e-8, -0.10427940636873245, 0.011337948963046074, -0.1108761578798294, 0.07124461978673935, -0.010989047586917877, 0.06013825163245201, 0.027694853022694588, 0.060677409172058105, -0.03435833752155304, -0.0850619375705719, 0.037865761667490005, 0.03760860487818718, -0.027107514441013336, -0.017357531934976578, 0.013951011002063751, -0.026374662294983864, -0.042799901217222214, 0.05216548964381218, 0.0053192381747066975, 0.008659396320581436, 0.047783367335796356, 0.010501501150429249, 0.07463088631629944, 0.020682208240032196, 0.07205528020858765, 0.03663521260023117, 0.008960689418017864, 0.0616849884390831, 0.07215803861618042, 0.0638311430811882, -0.024253465235233307, 0.017724469304084778, -0.03128144145011902, 0.0001539513177704066, 0.06993472576141357, -0.046658989042043686, 0.017816733568906784, 0.008629953488707542, -0.1142154186964035, 0.06945336610078812, 0.05371321737766266, -0.021064432337880135, -0.021852990612387657, 0.051780812442302704, -0.03844386339187622, -0.032193563878536224, 0.03942621871829033, 0.023393744602799416, 0.12188918143510818, -0.061548057943582535, 0.026143986731767654, -0.08987977355718613, -0.021536629647016525, 0.0378507524728775, -0.008841518312692642, -0.025707803666591644, -0.005606030113995075, 0.061057694256305695, -0.03296161815524101, -0.03473817929625511, 0.10128391534090042, -0.04980447143316269, 0.03729917109012604, 0.09041770547628403 ]
0.065256
// TEST[continued] <1> This query matches because the `exact\_value` field contains the exact term `Quick Foxes!`. <2> This query does not match, because the `full\_text` field only contains the terms `quick` and `foxes`. It does not contain the exact term `Quick Foxes!`. <3> A `term` query for the term `foxes` matches the `full\_text` field. <4> This `match` query on the `full\_text` field first analyzes the query string, then looks for documents containing `quick` or `foxes` or both. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/term-query.asciidoc
6.2
elasticsearch-6-2
[ 0.0162205770611763, 0.08264327049255371, 0.060388416051864624, 0.001416099607013166, 0.016255825757980347, 0.00002607083661132492, 0.03461412712931633, -0.03961031511425972, 0.02363990992307663, 0.005942256655544043, 0.07614246010780334, -0.0760900229215622, 0.007607751991599798, -0.018098272383213043, 0.03604613617062569, 0.0036999662406742573, -0.04155217856168747, -0.03753101825714111, -0.05468882992863655, -0.024599814787507057, -0.030249444767832756, 0.0184397641569376, -0.000010362439752498176, -0.012448747642338276, -0.005768653471022844, 0.014846661128103733, -0.0933091789484024, 0.030628426000475883, 0.0510268397629261, -0.02704889327287674, -0.018706081435084343, 0.11197356879711151, 0.02904362417757511, 0.1304835081100464, 0.015122703276574612, -0.0492318831384182, -0.044778384268283844, -0.039527229964733124, 0.04694759473204613, 0.04442930966615677, -0.043797969818115234, -0.08668433129787445, 0.01860468089580536, 0.06990938633680344, -0.015050176531076431, -0.018065039068460464, -0.06840672343969345, 0.018085284158587456, 0.006899661850184202, -0.030263017863035202, -0.16015522181987762, 0.000036883619031868875, -0.06929661333560944, 0.058083392679691315, 0.08364133536815643, 0.025093678385019302, -0.12178011983633041, 0.02233268879354, -0.028209388256072998, 0.012115376070141792, -0.008079838007688522, -0.036021266132593155, -0.032525211572647095, -0.010950109921395779, -0.035247378051280975, -0.030961668118834496, -0.07098453491926193, -0.059579748660326004, -0.002299840794876218, -0.03398720920085907, -0.06401951611042023, 0.03819683939218521, -0.08512800186872482, 0.07264003902673721, -0.034286417067050934, 0.09291058778762817, -0.04196077957749367, -0.07478953152894974, 0.024490727111697197, -0.018954021856188774, -0.06699790805578232, -0.10388793051242828, -0.05110711604356766, 0.025307821109890938, 0.05870072916150093, -0.03135942295193672, -0.004543603397905827, -0.08549367636442184, -0.0028034131973981857, -0.0004491776926442981, -0.009125609882175922, -0.13194024562835693, 0.07415325194597244, 0.012052960693836212, 0.015472297556698322, 0.06170042231678963, 0.03162937983870506, -0.016082147136330605, 0.02493295446038246, 0.03242665156722069, 0.046900492161512375, -0.044748999178409576, -0.03825798258185387, -0.036975130438804626, -0.09599707275629044, 0.020344693213701248, -0.0002168749488191679, -0.007615275681018829, 0.07046683132648468, -0.06450314074754715, -0.054072171449661255, 0.03420332074165344, 0.007697496563196182, -0.03406954184174538, -0.05184395983815193, -0.043113164603710175, 0.0610683336853981, -0.04245728626847267, -0.02342238463461399, 0.06066734716296196, 0.032102543860673904, 0.09713760763406754, -0.07292406260967255, -0.04322680085897446, -0.023038674145936966, 0.014068832620978355, 0.058518774807453156, 3.450647871133486e-33, 0.016586558893322945, -0.009259757585823536, -0.014026988297700882, -0.04759453609585762, -0.06373323500156403, 0.024840766564011574, -0.03157605230808258, 0.09522631764411926, -0.022904394194483757, 0.05354157090187073, -0.027728412300348282, 0.024737250059843063, -0.02509075403213501, -0.032886654138565063, 0.010000240989029408, -0.07188943773508072, 0.0324992835521698, -0.0044688633643090725, -0.07551306486129761, 0.07644595205783844, 0.026251694187521935, 0.0356537327170372, 0.01200067438185215, -0.013498411513864994, 0.03684791922569275, -0.009693926200270653, 0.004470258019864559, -0.057242874056100845, 0.026178598403930664, 0.02048545703291893, -0.07315568625926971, -0.09199091792106628, -0.008481647819280624, 0.027127766981720924, 0.04657331109046936, 0.039295755326747894, 0.025750430300831795, -0.043059851974248886, -0.04752374812960625, 0.0072852917946875095, -0.13541783392429352, -0.013116910122334957, 0.026115523651242256, -0.06993739306926727, -0.028329605236649513, -0.0703936368227005, -0.08075568079948425, -0.006548928562551737, 0.0011368172708898783, -0.0001281178992940113, -0.020604947581887245, 0.05587637051939964, -0.03232482448220253, -0.008055350743234158, 0.012773850001394749, 0.05921841785311699, 0.018197230994701385, 0.0496835932135582, -0.07645778357982635, 0.08811350911855698, -0.027559198439121246, 0.05003327131271362, 0.0342395082116127, -0.03980158641934395, 0.025111697614192963, -0.00464661093428731, 0.0505579374730587, 0.013817096129059792, 0.039990220218896866, 0.048146381974220276, 0.07382732629776001, 0.026511654257774353, 0.04190359637141228, -0.06111815944314003, 0.039446230977773666, -0.03936639800667763, -0.014006064273416996, 0.022186463698744774, -0.02689523808658123, -0.0352935716509819, -0.01894594356417656, -0.030080797150731087, 0.043413080275058746, 0.05074942857027054, -0.08378159999847412, 0.039540570229291916, 0.0059999437071383, -0.028654301539063454, -0.005136559251695871, -0.04474438354372978, 0.03425806760787964, 0.03897922486066818, -0.05029645562171936, -0.0779644325375557, 0.05922998487949371, -4.677135166894444e-33, 0.09944485872983932, -0.06820738315582275, -0.03347736597061157, -0.02262171171605587, 0.03617355227470398, -0.018121512606739998, 0.03805476054549217, 0.029738174751400948, 0.013553110882639885, 0.05146249383687973, 0.013937558978796005, 0.005527679342776537, -0.05368741229176521, -0.1175006851553917, 0.026928050443530083, -0.004293176811188459, 0.051981713622808456, -0.018586156889796257, 0.012298748828470707, 0.0890224277973175, 0.005485524423420429, 0.07554764300584793, -0.10425934940576553, 0.1019570603966713, 0.010969619266688824, -0.024080071598291397, 0.03276330605149269, -0.028775421902537346, -0.07448188960552216, 0.027717072516679764, -0.011590580455958843, -0.058920968323946, -0.07633625715970993, 0.002233929233625531, -0.0432787649333477, -0.04113536700606346, -0.011088566854596138, 0.03803231939673424, -0.027141137048602104, 0.02301081269979477, 0.06889879703521729, 0.03687862306833267, -0.014306238852441311, 0.07637279480695724, -0.02089306153357029, -0.0544421561062336, -0.02996789664030075, 0.03761743754148483, 0.03730674833059311, 0.024842575192451477, 0.025253204628825188, -0.007699612528085709, 0.028947986662387848, 0.023234732449054718, -0.020563790574669838, -0.061752092093229294, -0.0477866567671299, -0.025625191628932953, -0.07911201566457748, -0.014828539453446865, -0.005069631151854992, 0.1331912726163864, -0.07038464397192001, 0.03668215498328209, 0.07428243011236191, -0.04538644850254059, -0.08678272366523743, 0.01682385243475437, -0.02171025425195694, -0.13728049397468567, 0.02863139472901821, -0.03568968549370766, -0.005229180213063955, 0.023555172607302666, 0.07011453807353973, 0.0868724063038826, -0.00022905545483808964, 0.025013072416186333, 0.0905815064907074, 0.09297249466180801, -0.0005974478553980589, 0.026322124525904655, -0.01603733003139496, 0.107642762362957, -0.05212246999144554, 0.028837112709879875, -0.11394695192575455, 0.07671579718589783, -0.03844610974192619, -0.04692070931196213, 0.06925724446773529, 0.017104193568229675, 0.026032397523522377, -0.004442329052835703, 0.015735164284706116, -4.590016899896909e-8, -0.07090456783771515, -0.02045510523021221, -0.12184038013219833, 0.01670052297413349, 0.02263292483985424, 0.03074515238404274, 0.00802813470363617, 0.06928278505802155, 0.02218376100063324, -0.02938798815011978, 0.021845649927854538, 0.025943243876099586, -0.04398337006568909, -0.04295734316110611, -0.013457086868584156, -0.024505984038114548, -0.033920980989933014, -0.0029997213277965784, -0.01066093984991312, 0.0368950217962265, 0.01609661988914013, 0.006330674048513174, -0.07168949395418167, 0.00024155461869668216, -0.020139608532190323, 0.06473512202501297, -0.0602128840982914, 0.033382512629032135, -0.01659156195819378, 0.07693172246217728, 0.026852382346987724, 0.023974968120455742, -0.07137206196784973, -0.07033701241016388, 0.03750322386622429, 0.049724139273166656, 0.07296363264322281, 0.000016278148905257694, -0.028725720942020416, 0.044933103024959564, 0.08011709898710251, -0.009909587912261486, -0.02871592342853546, -0.003663246752694249, -0.002167929895222187, -0.07953367382287979, 0.040851324796676636, -0.06822165846824646, 0.1357685774564743, -0.09414029121398926, 0.013981220312416553, -0.07113067060709, 0.049587879329919815, -0.01848946139216423, -0.04567548260092735, -0.000013468398719851393, 0.09593923389911652, 0.044591810554265976, -0.03456438332796097, -0.009005148895084858, 0.11040329188108444, 0.01098650973290205, 0.07898402959108353, 0.10398583114147186 ]
-0.005663
[[query-dsl-multi-term-rewrite]] == Multi Term Query Rewrite Multi term queries, like <> and <> are called multi term queries and end up going through a process of rewrite. This also happens on the <>. All of those queries allow to control how they will get rewritten using the `rewrite` parameter: \* `constant\_score` (default): A rewrite method that performs like `constant\_score\_boolean` when there are few matching terms and otherwise visits all matching terms in sequence and marks documents for that term. Matching documents are assigned a constant score equal to the query's boost. \* `scoring\_boolean`: A rewrite method that first translates each term into a should clause in a boolean query, and keeps the scores as computed by the query. Note that typically such scores are meaningless to the user, and require non-trivial CPU to compute, so it's almost always better to use `constant\_score`. This rewrite method will hit too many clauses failure if it exceeds the boolean query limit (defaults to `1024`). \* `constant\_score\_boolean`: Similar to `scoring\_boolean` except scores are not computed. Instead, each matching document receives a constant score equal to the query's boost. This rewrite method will hit too many clauses failure if it exceeds the boolean query limit (defaults to `1024`). \* `top\_terms\_N`: A rewrite method that first translates each term into should clause in boolean query, and keeps the scores as computed by the query. This rewrite method only uses the top scoring terms so it will not overflow boolean max clause count. The `N` controls the size of the top scoring terms to use. \* `top\_terms\_boost\_N`: A rewrite method that first translates each term into should clause in boolean query, but the scores are only computed as the boost. This rewrite method only uses the top scoring terms so it will not overflow the boolean max clause count. The `N` controls the size of the top scoring terms to use. \* `top\_terms\_blended\_freqs\_N`: A rewrite method that first translates each term into should clause in boolean query, but all term queries compute scores as if they had the same frequency. In practice the frequency which is used is the maximum frequency of all matching terms. This rewrite method only uses the top scoring terms so it will not overflow boolean max clause count. The `N` controls the size of the top scoring terms to use.
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/multi-term-rewrite.asciidoc
6.2
elasticsearch-6-2
[ -0.04250313714146614, 0.010357853025197983, -0.0063042002730071545, 0.051758963614702225, -0.05784956365823746, 0.01487540639936924, -0.0245806984603405, -0.004939026199281216, 0.02844260260462761, 0.015022329986095428, -0.06710419803857803, 0.004847089294344187, 0.07646790146827698, -0.040491603314876556, -0.047763705253601074, 0.05905179679393768, -0.05278471112251282, 0.04655122384428978, -0.0696515217423439, -0.003428064752370119, 0.0746951699256897, 0.054375771433115005, -0.05894329398870468, 0.0025699229445308447, -0.014155875891447067, -0.06822305917739868, -0.03498849272727966, -0.011118819937109947, 0.005486163776367903, 0.01775909587740898, -0.006166636478155851, 0.08562824130058289, -0.0008584956522099674, 0.07265539467334747, -0.027521543204784393, -0.00560764828696847, -0.02558143436908722, -0.055184777826070786, -0.044069550931453705, -0.040468744933605194, -0.017784358933568, -0.04134174436330795, -0.05687575414776802, -0.028289712965488434, 0.02652517706155777, -0.019998984411358833, -0.1032007485628128, -0.005421817302703857, -0.03221135959029198, 0.02205323614180088, -0.09988606721162796, 0.014248407445847988, -0.10872983187437057, 0.0023247406352311373, 0.06360314041376114, 0.037632767111063004, -0.12451993674039841, 0.05167950317263603, -0.08360200375318527, -0.10572842508554459, -0.03699130937457085, -0.08153226971626282, -0.022834209725260735, 0.034850459545850754, 0.021098000928759575, -0.07036647945642471, -0.06388523429632187, -0.04303337261080742, 0.052678633481264114, 0.09041725844144821, -0.07336999475955963, 0.018621841445565224, -0.03021683357656002, 0.021639809012413025, 0.05780724808573723, 0.0436679907143116, -0.0014428951544687152, -0.07504820078611374, 0.060451675206422806, -0.015646791085600853, -0.01861046813428402, -0.028229888528585434, -0.026338685303926468, -0.01981237158179283, 0.1672786921262741, -0.05291685089468956, 0.06510328501462936, -0.1449659764766693, 0.1120479628443718, 0.025817492976784706, 0.01589924469590187, -0.047281913459300995, 0.025737065821886063, -0.039804860949516296, 0.02647337317466736, 0.001219020807184279, 0.00042659931932576, 0.007079926319420338, 0.10506514459848404, 0.035927772521972656, 0.04915332421660423, 0.06026328727602959, -0.013585765846073627, -0.07681425660848618, -0.019109683111310005, 0.005263513885438442, 0.04091891273856163, 0.09151308238506317, 0.05873583257198334, -0.1012812927365303, -0.018886808305978775, -0.021681904792785645, 0.08563748002052307, -0.06166320666670799, -0.07597922533750534, -0.030827317386865616, 0.06821268796920776, 0.013615422882139683, 0.044646959751844406, 0.0797644853591919, -0.011529182083904743, -0.004889802075922489, -0.07405523210763931, -0.06397893279790878, 0.010487769730389118, 0.024443652480840683, -0.011443203315138817, 5.538371388599963e-33, 0.09140424430370331, 0.01927737146615982, -0.022874636575579643, -0.06445077806711197, -0.04412936791777611, 0.06663909554481506, 0.008723356761038303, 0.12687887251377106, -0.0865355134010315, 0.05658037215471268, -0.028490711003541946, 0.029131976887583733, -0.00718911224976182, 0.06820365786552429, 0.07683095335960388, -0.02056432142853737, 0.004550141282379627, -0.007761273067444563, 0.017277654260396957, 0.030198629945516586, 0.0931275486946106, 0.00733824260532856, -0.010332707315683365, 0.021620534360408783, 0.04339173808693886, -0.009811300784349442, 0.035755421966314316, -0.011609673500061035, -0.05899154022336006, -0.0009391121566295624, -0.01615593582391739, -0.05611256882548332, -0.014126191847026348, 0.01438568439334631, 0.01865716092288494, 0.0712205171585083, 0.023897357285022736, 0.0015335562638938427, 0.020846765488386154, -0.0007963641546666622, -0.12932217121124268, -0.021511387079954147, -0.019791405647993088, -0.06411666423082352, -0.04158614203333855, -0.016786403954029083, -0.07742761075496674, 0.01973639987409115, 0.008868042379617691, 0.023059159517288208, 0.02102567069232464, 0.03268999233841896, 0.05996213108301163, 0.03011106140911579, -0.05990543216466904, -0.004704243037849665, -0.06555719673633575, 0.025305606424808502, -0.043137192726135254, 0.0797334834933281, -0.07322144508361816, -0.019701773300766945, 0.018869567662477493, -0.041953638195991516, 0.004041962791234255, 0.05543788895010948, 0.05325870215892792, 0.05052561312913895, 0.10853751003742218, -0.008129972033202648, 0.01774592511355877, 0.029430048540234566, -0.054009586572647095, -0.06877194344997406, 0.024021271616220474, -0.0432051382958889, 0.012138988822698593, 0.04183245450258255, 0.00587775744497776, -0.055977825075387955, -0.09180732071399689, 0.022839225828647614, 0.02014278434216976, -0.027732040733098984, -0.002093970775604248, -0.00736629031598568, 0.012662144377827644, -0.049853380769491196, -0.028454909101128578, -0.06097343564033508, 0.04694586247205734, 0.02001562900841236, -0.037345707416534424, 0.0017765152733772993, 0.00771451136097312, -6.1046191396765515e-33, 0.0033409656025469303, -0.08637462556362152, -0.0633775144815445, 0.022765489295125008, -0.03471066802740097, -0.09375667572021484, -0.048007525503635406, -0.04261261969804764, 0.004487278871238232, -0.1204242929816246, -0.004025757312774658, -0.04693066328763962, 0.059021368622779846, -0.042272452265024185, -0.009693669155240059, 0.0023521489929407835, -0.08890019357204437, 0.02136119082570076, -0.13086360692977905, 0.058125823736190796, 0.008012106642127037, 0.10542207956314087, -0.04283794388175011, 0.05216560140252113, -0.0059024496003985405, -0.012756453827023506, -0.020351557061076164, -0.030912276357412338, -0.03127852827310562, 0.04882228374481201, 0.03132656589150429, -0.053894124925136566, -0.03806830942630768, -0.007641798350960016, -0.003890460357069969, -0.05474022775888443, -0.03151298686861992, -0.06784028559923172, -0.009290339425206184, 0.13176070153713226, 0.065822072327137, 0.0689871534705162, 0.04147889465093613, 0.04127823933959007, 0.052129991352558136, 0.03486182168126106, -0.046209242194890976, -0.002246922580525279, 0.02103825844824314, -0.025318779051303864, 0.02767348662018776, -0.0865175798535347, -0.026399660855531693, 0.07634613662958145, -0.025858048349618912, -0.036793045699596405, -0.07297763973474503, -0.012873606756329536, -0.1279374659061432, 0.0123524758964777, 0.016458146274089813, 0.11264213174581528, 0.026787934824824333, 0.011938173323869705, 0.015894515439867973, -0.04437807947397232, 0.0346633717417717, -0.005947993136942387, 0.00632806122303009, -0.00254664639942348, -0.08271828293800354, -0.0001881031785160303, 0.004189333412796259, 0.02617916464805603, 0.00036913208896294236, -0.007699500769376755, 0.030028993263840675, 0.04325803369283676, -0.031359411776065826, 0.09046076983213425, -0.05255531147122383, 0.017272185534238815, 0.03273708373308182, 0.06989694386720657, -0.06501587480306625, 0.004553263075649738, -0.0007215687655843794, 0.09909072518348694, -0.02281753532588482, 0.029972881078720093, 0.0004716234398074448, 0.03412117809057236, -0.0056560589000582695, -0.0028563521336764097, -0.025500988587737083, -5.767997279804149e-8, -0.028722692281007767, 0.05450030416250229, -0.11039051413536072, 0.1110684722661972, -0.014245428144931793, 0.056418996304273605, 0.03430389240384102, 0.05808918923139572, -0.03812561184167862, -0.0349602997303009, 0.08373735100030899, 0.005214345175772905, -0.05408816412091255, -0.08398030698299408, -0.026223042979836464, 0.0007554605253972113, -0.01972331292927265, 0.02954082377254963, -0.03172821179032326, -0.06762313842773438, -0.03325967118144035, 0.0019064754014834762, -0.07243010401725769, 0.0890326201915741, 0.050693586468696594, 0.019078103825449944, 0.026976248249411583, 0.020131483674049377, -0.012447505258023739, 0.011159397661685944, 0.004986528307199478, 0.0386337973177433, 0.028142940253019333, 0.016340743750333786, 0.0703643411397934, 0.049870092421770096, -0.03016325645148754, 0.06433890014886856, -0.03357238322496414, 0.09482160955667496, 0.03918667137622833, 0.06212013587355614, 0.060416292399168015, 0.03905276581645012, -0.02288876101374626, -0.10923171788454056, 0.028833439573645592, 0.05124292150139809, 0.056579023599624634, -0.013497374020516872, 0.052578072994947433, -0.030684614554047585, -0.021496610715985298, -0.021619467064738274, 0.07444218546152115, -0.011682126671075821, 0.033431973308324814, 0.06261533498764038, -0.002478509210050106, 0.01709059067070484, 0.07814353704452515, -0.020788291469216347, 0.03276321291923523, 0.01714324951171875 ]
0.07604
[[regexp-syntax]] ==== Regular expression syntax Regular expression queries are supported by the `regexp` and the `query\_string` queries. The Lucene regular expression engine is not Perl-compatible but supports a smaller range of operators. [NOTE] ===== We will not attempt to explain regular expressions, but just explain the supported operators. ===== ===== Standard operators Anchoring:: + -- Most regular expression engines allow you to match any part of a string. If you want the regexp pattern to start at the beginning of the string or finish at the end of the string, then you have to \_anchor\_ it specifically, using `^` to indicate the beginning or `$` to indicate the end. Lucene's patterns are always anchored. The pattern provided must match the entire string. For string `"abcde"`: ab.\* # match abcd # no match -- Allowed characters:: + -- Any Unicode characters may be used in the pattern, but certain characters are reserved and must be escaped. The standard reserved characters are: .... . ? + \* | { } [ ] ( ) " \ .... If you enable optional features (see below) then these characters may also be reserved: # @ & < > ~ Any reserved character can be escaped with a backslash `"\\*"` including a literal backslash character: `"\\"` Additionally, any characters (except double quotes) are interpreted literally when surrounded by double quotes: john"@smith.com" -- Match any character:: + -- The period `"."` can be used to represent any character. For string `"abcde"`: ab... # match a.c.e # match -- One-or-more:: + -- The plus sign `"+"` can be used to repeat the preceding shortest pattern once or more times. For string `"aaabbb"`: a+b+ # match aa+bb+ # match a+.+ # match aa+bbb+ # match -- Zero-or-more:: + -- The asterisk `"\*"` can be used to match the preceding shortest pattern zero-or-more times. For string `"aaabbb`": a\*b\* # match a\*b\*c\* # match .\*bbb.\* # match aaa\*bbb\* # match -- Zero-or-one:: + -- The question mark `"?"` makes the preceding shortest pattern optional. It matches zero or one times. For string `"aaabbb"`: aaa?bbb? # match aaaa?bbbb? # match .....?.? # match aa?bb? # no match -- Min-to-max:: + -- Curly brackets `"{}"` can be used to specify a minimum and (optionally) a maximum number of times the preceding shortest pattern can repeat. The allowed forms are: {5} # repeat exactly 5 times {2,5} # repeat at least twice and at most 5 times {2,} # repeat at least twice For string `"aaabbb"`: a{3}b{3} # match a{2,4}b{2,4} # match a{2,}b{2,} # match .{3}.{3} # match a{4}b{4} # no match a{4,6}b{4,6} # no match a{4,}b{4,} # no match -- Grouping:: + -- Parentheses `"()"` can be used to form sub-patterns. The quantity operators listed above operate on the shortest previous pattern, which can be a group. For string `"ababab"`: (ab)+ # match ab(ab)+ # match (..)+ # match (...)+ # no match (ab)\* # match abab(ab)? # match ab(ab)? # no match (ab){3} # match (ab){1,2} # no match -- Alternation:: + -- The pipe symbol `"|"` acts as an OR operator. The match will succeed if the pattern on either the left-hand side OR the right-hand side matches. The alternation applies to the \_longest pattern\_, not the shortest. For string `"aabb"`: aabb|bbaa # match aacc|bb # no match aa(cc|bb) # match a+|b+ # no match a+b+|b+a+ # match a+(b|c)+ # match -- Character classes:: + -- Ranges of potential characters may be represented as character classes by enclosing them in square brackets `"[]"`. A leading `^` negates the character class. The allowed forms are: [abc] # 'a' or 'b' or
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/regexp-syntax.asciidoc
6.2
elasticsearch-6-2
[ -0.020159613341093063, 0.007460850290954113, 0.11154449731111526, 0.049089204519987106, -0.08813559263944626, 0.0576745830476284, 0.039691828191280365, -0.03883619233965874, 0.015901288017630577, -0.018378157168626785, -0.04965467378497124, -0.03066999278962612, 0.007971419021487236, 0.016003943979740143, -0.051645491272211075, 0.038137663155794144, -0.06323319673538208, -0.01534206047654152, -0.09787076711654663, 0.07852667570114136, 0.10381186008453369, 0.017116492614150047, -0.07013483345508575, -0.05844617262482643, -0.057544074952602386, -0.00703001581132412, -0.03676344454288483, -0.03257850557565689, 0.08929383009672165, 0.06590604782104492, 0.015505802817642689, -0.01734267547726631, -0.03575430065393448, 0.0722142681479454, 0.012495942413806915, 0.023469803854823112, -0.011547843925654888, -0.010561699979007244, -0.06920389831066132, -0.038740888237953186, -0.005516055505722761, -0.08696626871824265, -0.08311748504638672, 0.040703363716602325, 0.0037699968088418245, 0.006156184244900942, 0.0377131849527359, 0.013518250547349453, 0.0045290738344192505, -0.04770883917808533, -0.053982410579919815, -0.05932075157761574, -0.03492774814367294, 0.022974468767642975, 0.06216060370206833, 0.03362597897648811, -0.01248252671211958, 0.013181292451918125, 0.005302902776747942, -0.06653299182653427, 0.0567820742726326, -0.0743817687034607, -0.022390317171812057, -0.032486218959093094, -0.03677533194422722, -0.07864168286323547, -0.032653968781232834, -0.05219046771526337, 0.06269396841526031, -0.06865881383419037, -0.07099264860153198, -0.019022619351744652, -0.0008520506671629846, 0.059279702603816986, 0.0700620785355568, 0.11277111619710922, 0.037926629185676575, -0.029534675180912018, 0.06792190670967102, 0.03833336383104324, -0.038759831339120865, -0.12030039727687836, 0.05061756446957588, 0.09241349250078201, 0.040065716952085495, -0.038534246385097504, 0.016530146822333336, -0.06808635592460632, 0.07865851372480392, 0.016309477388858795, -0.022553162649273872, -0.058646008372306824, -0.05585585534572601, -0.09226936101913452, 0.07783596962690353, 0.056953996419906616, -0.055737726390361786, -0.003683918621391058, 0.03430526703596115, -0.02652932144701481, 0.023298557847738266, 0.0048485673032701015, -0.005263649858534336, 0.011960173957049847, -0.09722421318292618, 0.004875097889453173, -0.010672230273485184, 0.04440423846244812, 0.0235526654869318, -0.0450541228055954, 0.005127411335706711, 0.0573277622461319, 0.06060943379998207, -0.04641382023692131, -0.0373929962515831, -0.004043570253998041, 0.05290134251117706, -0.023135783150792122, 0.0822981745004654, 0.05801583454012871, -0.00823220331221819, 0.013383165001869202, -0.021284202113747597, -0.05809413269162178, 0.058095335960388184, 0.04147006943821907, 0.03614596277475357, 4.3764892623601974e-33, 0.053072791546583176, 0.05853370949625969, -0.11018453538417816, -0.0791320949792862, -0.13233710825443268, 0.030901802703738213, -0.0631701722741127, 0.10470093041658401, -0.06372766941785812, -0.010678279213607311, -0.0035164058208465576, -0.018594220280647278, -0.06802275031805038, -0.013988354243338108, 0.01664574444293976, -0.00470688845962286, 0.06419040262699127, -0.08696813136339188, -0.03522767871618271, -0.05997736006975174, 0.0043850671499967575, -0.01248138677328825, -0.008032477460801601, 0.012280093505978584, -0.014508284628391266, 0.013619483448565006, -0.02587311342358589, -0.07769252359867096, 0.04760150611400604, 0.001315662288106978, 0.007240593899041414, -0.06526133418083191, -0.009028305299580097, -0.031429413706064224, 0.036197952926158905, 0.0835329219698906, -0.018118951469659805, 0.06849907338619232, 0.006795629858970642, -0.011006258428096771, -0.09008338302373886, 0.014170031063258648, 0.03517238423228264, -0.03796485811471939, 0.051907435059547424, -0.057571835815906525, -0.10918370634317398, 0.08193351328372955, 0.03345254436135292, -0.04036983102560043, 0.05321501940488815, 0.05757782608270645, 0.009207003749907017, -0.004707785323262215, 0.040241215378046036, 0.05968093499541283, 0.020441465079784393, 0.0022957369219511747, -0.10046076029539108, 0.03181362524628639, 0.022630292922258377, -0.03860768675804138, 0.04792623594403267, 0.02904805913567543, 0.030133912339806557, -0.016796588897705078, 0.08589538186788559, 0.10907737165689468, -0.028164314106106758, 0.057238586246967316, -0.002759408438578248, 0.0340176485478878, 0.01983158476650715, 0.00001944385439855978, -0.006641849875450134, -0.08083885163068771, 0.037185829132795334, 0.047236960381269455, 0.032868314534425735, 0.01258055679500103, -0.0417812317609787, -0.05729703977704048, 0.027994804084300995, -0.0024909526109695435, -0.06179327517747879, 0.0020442414097487926, -0.010536818765103817, -0.028857527300715446, -0.01875152252614498, -0.11587371677160263, 0.13630619645118713, 0.05187283828854561, -0.06398696452379227, 0.06141828000545502, -0.0583183616399765, -5.110532219860944e-33, 0.0038513042964041233, -0.0631854385137558, -0.007499432656913996, -0.062532439827919, -0.0018050989601761103, -0.039920926094055176, 0.02085212804377079, -0.03547515720129013, 0.018861446529626846, -0.008512886241078377, -0.008978131227195263, -0.02991444431245327, 0.008209428749978542, -0.047055456787347794, -0.10723268985748291, 0.023744843900203705, -0.005993474740535021, -0.008363092318177223, 0.020544961094856262, 0.09333102405071259, -0.025452690199017525, 0.027140967547893524, -0.09713582694530487, 0.053361326456069946, 0.01920309104025364, -0.03296061232686043, 0.06839275360107422, 0.028243180364370346, -0.05509531497955322, 0.08619236946105957, 0.08684887737035751, -0.0400531068444252, 0.04036781191825867, -0.040847502648830414, -0.1182544156908989, -0.019178785383701324, -0.03690263256430626, -0.00875104684382677, 0.036672648042440414, -0.011343264952301979, 0.05811154097318649, 0.01915609836578369, 0.020374899730086327, 0.03602945804595947, 0.061390724033117294, -0.039003293961286545, -0.07472202926874161, 0.04339510574936867, -0.014186890795826912, -0.08492553979158401, 0.009512837044894695, -0.03553134575486183, 0.04438063129782677, 0.006858430337160826, -0.05006449669599533, -0.006539713591337204, -0.041312262415885925, 0.0635119080543518, -0.06697715073823929, 0.0008266267250292003, -0.07431266456842422, 0.05970674753189087, 0.09178731590509415, 0.02396853081882, -0.014792281202971935, 0.054409418255090714, -0.03510105237364769, 0.024441612884402275, -0.02483152411878109, -0.13740040361881256, 0.006554388906806707, -0.07380971312522888, -0.06660494953393936, 0.04369058087468147, -0.013804011978209019, 0.06303715705871582, 0.0364457368850708, 0.051999568939208984, 0.026563046500086784, 0.08068530261516571, -0.0009359529940411448, 0.02265375852584839, -0.00879991427063942, 0.04350549355149269, -0.06376709789037704, -0.0005424936534836888, 0.0005275935982353985, 0.09313173592090607, -0.07408486306667328, -0.01418224722146988, 0.048536818474531174, 0.05246789753437042, 0.0015632655704393983, -0.0017704794881865382, 0.0850418210029602, -5.027353466857676e-8, -0.024301474913954735, 0.031430069357156754, -0.04605961963534355, 0.025282226502895355, -0.028616424649953842, 0.02020917646586895, 0.02880726009607315, -0.05466543883085251, -0.05984247103333473, 0.006544091738760471, -0.002844378584995866, 0.06987695395946503, -0.08312937617301941, -0.0697685033082962, -0.02705860137939453, 0.000865947047714144, -0.010922480374574661, -0.041220057755708694, -0.014378908090293407, 0.04525350034236908, -0.06885020434856415, 0.010836463421583176, -0.03255515918135643, -0.0209687277674675, 0.0017983588622882962, 0.05186864361166954, -0.018369348719716072, 0.001203275634907186, -0.02757026068866253, 0.02833688072860241, 0.025641879066824913, 0.05120724067091942, 0.041809454560279846, -0.0668836459517479, -0.08579593151807785, 0.11953601986169815, 0.050808001309633255, -0.04928138479590416, -0.017935210838913918, 0.0862380638718605, 0.15090137720108032, 0.008161152713000774, 0.05625206232070923, -0.026611262932419777, -0.04741161689162254, 0.00752806244418025, 0.03618748113512993, -0.02224544808268547, 0.06954655796289444, -0.018900517374277115, 0.0943562313914299, -0.08557303994894028, 0.00892118364572525, -0.019343044608831406, -0.01268145814538002, 0.014343015849590302, 0.007954052649438381, 0.04066840186715126, 0.010497902520000935, 0.025593839585781097, 0.04512824863195419, 0.03620613366365433, 0.04469479247927666, 0.01754710078239441 ]
0.0573
match a+|b+ # no match a+b+|b+a+ # match a+(b|c)+ # match -- Character classes:: + -- Ranges of potential characters may be represented as character classes by enclosing them in square brackets `"[]"`. A leading `^` negates the character class. The allowed forms are: [abc] # 'a' or 'b' or 'c' [a-c] # 'a' or 'b' or 'c' [-abc] # '-' or 'a' or 'b' or 'c' [abc\-] # '-' or 'a' or 'b' or 'c' [^abc] # any character except 'a' or 'b' or 'c' [^a-c] # any character except 'a' or 'b' or 'c' [^-abc] # any character except '-' or 'a' or 'b' or 'c' [^abc\-] # any character except '-' or 'a' or 'b' or 'c' Note that the dash `"-"` indicates a range of characters, unless it is the first character or if it is escaped with a backslash. For string `"abcd"`: ab[cd]+ # match [a-d]+ # match [^a-d]+ # no match -- ===== Optional operators These operators are available by default as the `flags` parameter defaults to `ALL`. Different flag combinations (concatenated with `"|"`) can be used to enable/disable specific operators: { "regexp": { "username": { "value": "john~athon<1-5>", "flags": "COMPLEMENT|INTERVAL" } } } Complement:: + -- The complement is probably the most useful option. The shortest pattern that follows a tilde `"~"` is negated. For instance, `"ab~cd" means: \* Starts with `a` \* Followed by `b` \* Followed by a string of any length that it anything but `c` \* Ends with `d` For the string `"abcdef"`: ab~df # match ab~cf # match ab~cdef # no match a~(cb)def # match a~(bc)def # no match Enabled with the `COMPLEMENT` or `ALL` flags. -- Interval:: + -- The interval option enables the use of numeric ranges, enclosed by angle brackets `"<>"`. For string: `"foo80"`: foo<1-100> # match foo<01-100> # match foo<001-100> # no match Enabled with the `INTERVAL` or `ALL` flags. -- Intersection:: + -- The ampersand `"&"` joins two patterns in a way that both of them have to match. For string `"aaabbb"`: aaa.+&.+bbb # match aaa&bbb # no match Using this feature usually means that you should rewrite your regular expression. Enabled with the `INTERSECTION` or `ALL` flags. -- Any string:: + -- The at sign `"@"` matches any string in its entirety. This could be combined with the intersection and complement above to express ``everything except''. For instance: @&~(foo.+) # anything except string beginning with "foo" Enabled with the `ANYSTRING` or `ALL` flags. --
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/regexp-syntax.asciidoc
6.2
elasticsearch-6-2
[ -0.07058947533369064, 0.050125714391469955, 0.06484545022249222, -0.005651767831295729, -0.05305786803364754, 0.07112348079681396, 0.039506737142801285, -0.06414356082677841, -0.02920885570347309, -0.015704447403550148, 0.014533456414937973, -0.009742407128214836, 0.09310334175825119, 0.05803469195961952, 0.019460998475551605, 0.050042107701301575, -0.0535932220518589, -0.03107181377708912, -0.07505453377962112, -0.017262253910303116, 0.051681242883205414, -0.021675484254956245, -0.10452812165021896, -0.02973661944270134, 0.005513673182576895, 0.030916787683963776, -0.046593692153692245, 0.04933540150523186, 0.03964792564511299, -0.001851556240580976, -0.03156226500868797, 0.01066625490784645, 0.05057089775800705, 0.08171894401311874, 0.059626393020153046, -0.03899547830224037, -0.05429179593920708, 0.06231197714805603, 0.05790357664227486, 0.03297874331474304, -0.04232729598879814, -0.09598015248775482, 0.03155172988772392, 0.0947452187538147, 0.004339653067290783, 0.03215133398771286, -0.0414072684943676, -0.005172002594918013, -0.05457118898630142, -0.052368488162755966, -0.009292886592447758, 0.0721036046743393, -0.08864583820104599, 0.06057007610797882, -0.021901091560721397, 0.0012703199172392488, 0.013475458137691021, -0.009867208078503609, 0.022884465754032135, -0.05340171977877617, -0.0636010393500328, -0.019747698679566383, 0.0070285676047205925, -0.046603765338659286, -0.05150886997580528, -0.0036162780597805977, -0.09269309043884277, 0.0360824353992939, 0.06383856385946274, 0.11642175167798996, -0.03976128622889519, -0.0489242821931839, -0.07010763883590698, 0.03780033811926842, 0.03365828096866608, 0.1284174919128418, 0.06848490238189697, -0.06831210851669312, 0.07757622003555298, 0.026936642825603485, -0.06943122297525406, -0.061257973313331604, -0.006896998267620802, 0.13471455872058868, 0.003461926942691207, -0.023570265620946884, -0.08681090921163559, -0.03668779879808426, -0.03445993736386299, 0.07339468598365784, -0.023713301867246628, -0.08077406883239746, 0.10842017829418182, -0.01693796180188656, 0.022675596177577972, 0.011776337400078773, 0.03215344250202179, -0.022608567029237747, -0.04361797496676445, 0.03443508222699165, -0.03861485794186592, -0.00700376695021987, 0.0039744069799780846, -0.06946916878223419, -0.018260475248098373, -0.0028234273195266724, 0.017973681911826134, -0.059887513518333435, 0.06469070166349411, -0.0010260174749419093, 0.012716639786958694, -0.028920404613018036, -0.0012462153099477291, -0.07458757609128952, -0.060970619320869446, 0.049895744770765305, 0.03668386489152908, 0.01690925471484661, 0.006765069905668497, 0.02942226082086563, 0.05412844195961952, -0.003603619057685137, -0.041970741003751755, -0.0015741260722279549, 0.04256667569279671, -0.012437330558896065, -0.05296079069375992, 8.449527596791498e-33, -0.01176549680531025, 0.07055623084306717, -0.025323089212179184, -0.024139869958162308, 0.01844947226345539, 0.06271044909954071, -0.0837642177939415, 0.0654406026005745, -0.07879802584648132, 0.05288245156407356, -0.00211744150146842, 0.019013943150639534, -0.007892864756286144, 0.02561059594154358, -0.008681584149599075, 0.05665332451462746, 0.07923620194196701, -0.1342092901468277, -0.09601465612649918, -0.008650630712509155, 0.046546924859285355, -0.02725004218518734, 0.014501530677080154, 0.038527559489011765, -0.0016417182050645351, -0.0041234977543354034, 0.010891794227063656, -0.06092897057533264, 0.07947638630867004, 0.015337951481342316, -0.027645237743854523, -0.03525305539369583, -0.05797405168414116, -0.06885356456041336, 0.1299113780260086, 0.01718609407544136, -0.03025507926940918, 0.0074244276620447636, 0.006276559084653854, 0.0019194672349840403, -0.10939896106719971, 0.03745383396744728, -0.029896819964051247, -0.026105819270014763, 0.0307509396225214, -0.021267469972372055, 0.05259925127029419, -0.012289398349821568, -0.02352352999150753, 0.05112936720252037, 0.05335301533341408, -0.0009005569736473262, -0.03701889514923096, -0.020922347903251648, 0.014172744005918503, -0.000680315715726465, 0.05723000317811966, 0.083708755671978, -0.06518976390361786, 0.0026372852735221386, 0.08320540934801102, -0.003281498560681939, 0.030891435220837593, -0.004538487643003464, -0.014089885167777538, -0.05911107733845711, -0.06818649172782898, 0.005779825150966644, 0.003918129950761795, -0.026213062927126884, -0.03824833407998085, -0.009676692076027393, 0.03419476002454758, -0.001296952017582953, -0.0664641261100769, -0.03424049913883209, 0.004841609392315149, 0.02079140767455101, 0.01778298057615757, -0.07896284759044647, -0.012499514035880566, -0.043886009603738785, -0.012575852684676647, -0.004475411958992481, -0.025997811928391457, 0.011023154482245445, -0.038239169865846634, -0.06497329473495483, -0.020813068374991417, -0.14625434577465057, 0.041041530668735504, -0.036911170929670334, -0.05088390037417412, -0.06142086535692215, -0.049098946154117584, -8.625116330761608e-33, -0.016149654984474182, -0.04545816779136658, -0.02629074826836586, -0.06204864755272865, -0.015992525964975357, -0.08072330802679062, 0.08609156310558319, -0.0502864234149456, 0.07867351919412613, -0.022390875965356827, 0.029995381832122803, 0.050487443804740906, 0.011511430144309998, -0.07767396420240402, -0.013862299732863903, 0.02754829078912735, -0.07892096042633057, 0.08031003922224045, 0.026632649824023247, 0.06087520346045494, 0.025532247498631477, -0.008376011624932289, -0.0592939555644989, 0.08117973804473877, 0.0007441524066962302, 0.031235583126544952, 0.012909069657325745, 0.05010449141263962, 0.07327646017074585, 0.07696568220853806, -0.01787971705198288, 0.07293474674224854, -0.006482536904513836, -0.04735536873340607, -0.10209778696298599, -0.04590177908539772, -0.053897567093372345, 0.0565984807908535, -0.0029847982805222273, 0.02039102092385292, 0.0031420611776411533, 0.00002946853965113405, 0.10608436912298203, 0.13105154037475586, -0.004393278621137142, 0.030341051518917084, 0.03319491818547249, 0.03456816449761391, -0.033487848937511444, -0.03459728881716728, -0.0025096097961068153, -0.06890016794204712, -0.04334454983472824, 0.017322435975074768, 0.018497994169592857, 0.013804670423269272, 0.007663547992706299, -0.00469053303822875, -0.05429694429039955, 0.013115400448441505, -0.025875795632600784, 0.01889263279736042, 0.04716162383556366, 0.0053389472886919975, -0.010741355828940868, 0.05742838233709335, -0.08500563353300095, 0.01995718479156494, 0.011530602350831032, -0.12168845534324646, 0.06527514010667801, -0.022753005847334862, -0.08418731391429901, -0.008537331596016884, -0.058900002390146255, -0.0009007397457025945, -0.0002557324187364429, 0.04082788527011871, -0.028898654505610466, 0.09208746999502182, -0.11599212884902954, -0.026777110993862152, -0.03419576585292816, 0.1604727953672409, 0.020776858553290367, 0.04377969726920128, -0.05017479509115219, 0.10633271932601929, 0.006178987678140402, 0.06237069144845009, -0.0042414613999426365, 0.07777449488639832, 0.06922777742147446, 0.029806900769472122, 0.04163438454270363, -4.5037118923119124e-8, -0.07293631881475449, -0.005073797423392534, -0.05329018831253052, -0.06509128212928772, 0.024533379822969437, 0.0014999728882685304, -0.009934530593454838, -0.10046541690826416, 0.018705561757087708, 0.01698111928999424, 0.05393318086862564, 0.06402988731861115, -0.08547960966825485, -0.04218700900673866, 0.0194716639816761, 0.10246536135673523, 0.03082551434636116, 0.05034378170967102, -0.02377292327582836, 0.06980922818183899, -0.014334825798869133, -0.05429789051413536, -0.024710796773433685, -0.0026671786326915026, -0.0649554580450058, 0.010919137857854366, -0.02811427414417267, -0.01108324434608221, 0.0011142961448058486, 0.046244021505117416, 0.02976471371948719, 0.04056401923298836, 0.016454758122563362, -0.10548144578933716, -0.0627264529466629, 0.058922648429870605, 0.004760656505823135, -0.027154644951224327, 0.0033141712192445993, 0.013383490964770317, 0.09017585963010788, -0.046099450439214706, -0.07856673002243042, 0.050390224903821945, -0.035106658935546875, -0.05271609127521515, -0.005956876091659069, -0.05072007328271866, 0.0016306918114423752, -0.0196091216057539, 0.023610712960362434, -0.05373278260231018, -0.031091811135411263, 0.019974099472165108, -0.04440015181899071, 0.04737268015742302, 0.0010664364090189338, 0.01728670299053192, 0.04973774403333664, -0.04196510463953018, 0.08972058445215225, 0.005299437791109085, 0.07559223473072052, -0.027788594365119934 ]
0.057322
[[query-dsl-fuzzy-query]] === Fuzzy Query The fuzzy query uses similarity based on Levenshtein edit distance. ==== String fields The `fuzzy` query generates matching terms that are within the maximum edit distance specified in `fuzziness` and then checks the term dictionary to find out which of those generated terms actually exist in the index. The final query uses up to `max\_expansions` matching terms. Here is a simple example: [source,js] -------------------------------------------------- GET /\_search { "query": { "fuzzy" : { "user" : "ki" } } } -------------------------------------------------- // CONSOLE Or with more advanced settings: [source,js] -------------------------------------------------- GET /\_search { "query": { "fuzzy" : { "user" : { "value": "ki", "boost": 1.0, "fuzziness": 2, "prefix\_length": 0, "max\_expansions": 100 } } } } -------------------------------------------------- // CONSOLE [float] ===== Parameters [horizontal] `fuzziness`:: The maximum edit distance. Defaults to `AUTO`. See <>. `prefix\_length`:: The number of initial characters which will not be ``fuzzified''. This helps to reduce the number of terms which must be examined. Defaults to `0`. `max\_expansions`:: The maximum number of terms that the `fuzzy` query will expand to. Defaults to `50`. `transpositions`:: Whether fuzzy transpositions (`ab` -> `ba`) are supported. Default is `false`. WARNING: This query can be very heavy if `prefix\_length` is set to `0` and if `max\_expansions` is set to a high number. It could result in every term in the index being examined!
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/fuzzy-query.asciidoc
6.2
elasticsearch-6-2
[ -0.040139731019735336, 0.036724988371133804, 0.019664784893393517, 0.02444393001496792, -0.04589301720261574, -0.020378325134515762, 0.06303879618644714, -0.018510805442929268, 0.06330171227455139, -0.08792508393526077, 0.011282095685601234, -0.026108184829354286, 0.052426815032958984, -0.08896202594041824, -0.052312202751636505, 0.07888375222682953, 0.00035019125789403915, -0.031166749075055122, -0.13160023093223572, -0.08588849008083344, 0.0904817283153534, 0.016756756231188774, -0.014033722691237926, -0.012728441506624222, 0.007559393998235464, 0.017492903396487236, -0.02870902046561241, -0.011205781251192093, 0.027599750086665154, 0.05834205076098442, -0.023080799728631973, 0.04221145808696747, 0.0037998317275196314, 0.050477832555770874, 0.003689457895234227, 0.0035619677510112524, -0.11239398270845413, 0.008606846444308758, 0.047717638313770294, -0.02723456732928753, -0.0670638307929039, -0.0026534225326031446, -0.07282955944538116, -0.020902974531054497, 0.01406515296548605, -0.07322890311479568, -0.11819103360176086, -0.04065007343888283, -0.0007898585754446685, 0.026668064296245575, -0.17394715547561646, 0.006824898533523083, -0.023274926468729973, -0.02372141368687153, 0.03862207755446434, 0.030038945376873016, -0.11556481570005417, 0.0210732351988554, 0.0020412548910826445, -0.05099761113524437, 0.006401224061846733, -0.0635792687535286, 0.022128308191895485, -0.00010276725515723228, -0.042126309126615524, -0.05975794419646263, 0.010833212174475193, -0.03780238330364227, 0.04166565462946892, -0.04555308073759079, 0.024089224636554718, 0.022290846332907677, -0.06823901832103729, 0.01362042035907507, 0.02118937112390995, 0.05684659630060196, 0.0019477445166558027, -0.010994384996592999, 0.019156306982040405, 0.03150998055934906, -0.05356810614466667, -0.058555711060762405, 0.0153130441904068, 0.008259669877588749, 0.0171734020113945, 0.00005027140650781803, 0.016410846263170242, -0.12093392759561539, 0.0778246521949768, -0.04106016084551811, -0.01171911507844925, -0.11196451634168625, -0.0026413165032863617, 0.0016496388707309961, 0.04903676360845566, 0.014194190502166748, 0.006182032637298107, 0.04459596797823906, 0.041442062705755234, 0.06900147348642349, -0.004683486185967922, -0.050147540867328644, -0.05434907600283623, -0.06262371689081192, -0.034974291920661926, 0.02653489075601101, 0.0030803706031292677, -0.023176860064268112, 0.077275350689888, -0.06312239915132523, -0.03872620686888695, 0.03201454505324364, 0.030741587281227112, 0.02523551695048809, -0.03855251520872116, -0.04496520385146141, 0.10717817395925522, -0.02435894124209881, 0.030462196096777916, 0.06632915884256363, 0.08752351999282837, 0.0370384156703949, -0.044332295656204224, 0.016859665513038635, -0.03334813192486763, -0.016822781413793564, 0.032141536474227905, 2.674653035537578e-34, 0.07292533665895462, 0.007541265804320574, 0.03230985626578331, -0.05657857283949852, -0.01946629025042057, 0.00997550506144762, -0.0165542159229517, 0.06539574265480042, -0.07558983564376831, 0.025917433202266693, -0.06911701709032059, 0.12423615902662277, -0.018903415650129318, -0.06732690334320068, -0.034631043672561646, -0.034589312970638275, 0.06631356477737427, 0.04619547352194786, -0.015147713012993336, 0.015726085752248764, 0.04670877382159233, -0.05960487946867943, 0.008403196930885315, 0.02018321305513382, -0.01696408912539482, -0.05398989096283913, -0.01320164930075407, -0.002814212581142783, -0.04157087951898575, 0.0072672017849981785, -0.03502127528190613, -0.029110834002494812, 0.010437197051942348, -0.00447396794334054, 0.042269594967365265, 0.03712289407849312, 0.01984930783510208, 0.012503478676080704, -0.024808358401060104, -0.024416785687208176, -0.02661336585879326, 0.011070174165070057, 0.02637292630970478, -0.09363185614347458, -0.07444918155670166, 0.05696963146328926, -0.04014412686228752, -0.0046276370994746685, -0.04139408469200134, 0.011535173282027245, -0.008890691213309765, 0.036982495337724686, -0.04639727249741554, 0.048308949917554855, 0.039364252239465714, 0.00009245858382200822, -0.0031990089919418097, 0.045992493629455566, 0.03369348868727684, 0.1337183117866516, -0.02192901074886322, 0.0063630035147070885, 0.012920684181153774, -0.002471213461831212, 0.07297281920909882, -0.009459602646529675, 0.013627756386995316, 0.047273166477680206, 0.07102000713348389, 0.045816659927368164, 0.06782884150743484, 0.052144382148981094, 0.04802250862121582, -0.009502962231636047, 0.02527252584695816, -0.10057559609413147, -0.021270079538226128, 0.019937675446271896, -0.0554625503718853, -0.03414887189865112, -0.09636664390563965, 0.009820058010518551, -0.07081279158592224, -0.012063335627317429, -0.0894901379942894, 0.0181462112814188, -0.020057331770658493, -0.059756793081760406, -0.08099163323640823, -0.031023088842630386, -0.02043740637600422, 0.013974306173622608, -0.07668742537498474, -0.08752512186765671, 0.013848350383341312, -2.561346170789108e-33, 0.04242635518312454, -0.10667332261800766, 0.02624470740556717, -0.014142867177724838, 0.004394313786178827, -0.10322734713554382, 0.03949807956814766, 0.07215428352355957, 0.04828125238418579, -0.024685177952051163, 0.025674866512417793, -0.007642287295311689, 0.013440648093819618, -0.06532439589500427, -0.014964020811021328, 0.10619400441646576, -0.01732395403087139, -0.06265974789857864, 0.0011724603828042746, 0.0771571546792984, 0.043348636478185654, 0.05317550525069237, -0.08196435868740082, 0.09624141454696655, -0.011185054667294025, -0.003454384161159396, 0.003498783800750971, -0.0057203322649002075, -0.06821706146001816, 0.00027655178564600646, -0.06087807938456535, -0.018974456936120987, -0.06490542739629745, -0.0030619162134826183, -0.10029114037752151, -0.050371699035167694, 0.00875160563737154, 0.01629035361111164, -0.019489051774144173, 0.06875748187303543, -0.022632485255599022, 0.06494308263063431, 0.04413007199764252, 0.015520257875323296, 0.032124169170856476, 0.001989343436434865, -0.05569624528288841, 0.007469751872122288, 0.05246737226843834, -0.07313854992389679, 0.10735290497541428, -0.02691810391843319, -0.05266523361206055, 0.07770587503910065, 0.014307514764368534, -0.08034520596265793, -0.06680456548929214, -0.026902589946985245, -0.0897156149148941, -0.03060763329267502, -0.024588897824287415, 0.008345871232450008, 0.011493708938360214, 0.02880394272506237, 0.03654567524790764, 0.00877450406551361, -0.06286143511533737, 0.08007318526506424, 0.06356067955493927, -0.09780825674533844, 0.026214221492409706, -0.056979820132255554, 0.09357524663209915, 0.039487794041633606, 0.018176469951868057, -0.0278945229947567, 0.029266618192195892, -0.016795877367258072, 0.09620685130357742, 0.03626929596066475, -0.049020327627658844, 0.0501798614859581, 0.06124396249651909, 0.0915493443608284, -0.08922114968299866, 0.017323676496744156, -0.011184182949364185, 0.05378597602248192, -0.01515764370560646, 0.014820217154920101, -0.01307905837893486, -0.06842559576034546, -0.01022941991686821, -0.018997060135006905, 0.02765977755188942, -5.064342900595875e-8, -0.08143828064203262, 0.0432707816362381, -0.12187234312295914, 0.0312809944152832, 0.0764968991279602, 0.005103359930217266, 0.054934822022914886, 0.10512787848711014, -0.040203992277383804, -0.05492813512682915, 0.03892137482762337, 0.10105064511299133, -0.028146667405962944, 0.013238271698355675, -0.013953372836112976, -0.0247954111546278, -0.055052679032087326, 0.055972158908843994, 0.011043117381632328, -0.005605621263384819, 0.01578197255730629, 0.04456556960940361, -0.0068727657198905945, 0.051807500422000885, 0.1122957244515419, -0.022306127473711967, -0.06838523596525192, -0.013945143669843674, 0.05362948030233383, 0.08306335657835007, -0.041212305426597595, 0.0000888077265699394, 0.004324411042034626, -0.038546979427337646, 0.04281800985336304, -0.040365077555179596, -0.0952904224395752, -0.00136413739528507, -0.07375598698854446, 0.09553272277116776, 0.036160554736852646, 0.004576942417770624, 0.0060512046329677105, 0.010858426801860332, 0.0018563182093203068, -0.06521353870630264, 0.08328817784786224, -0.018619736656546593, 0.0815177634358406, -0.07318214327096939, 0.0658169761300087, -0.03691616654396057, -0.03648776933550835, -0.008655739948153496, -0.04722026735544205, -0.08542074263095856, -0.009309095330536366, 0.0690426155924797, -0.02649197354912758, -0.05479111894965172, 0.03977202996611595, 0.010237316600978374, 0.0548836886882782, 0.09357568621635437 ]
0.029246
[[term-level-queries]] == Term level queries While the <> will analyze the query string before executing, the \_term-level queries\_ operate on the exact terms that are stored in the inverted index, and will normalize terms before executing only for <> fields with <> property. These queries are usually used for structured data like numbers, dates, and enums, rather than full text fields. Alternatively, they allow you to craft low-level queries, foregoing the analysis process. The queries in this group are: <>:: Find documents which contain the exact term specified in the field specified. <>:: Find documents which contain any of the exact terms specified in the field specified. <>:: Find documents which match with one or more of the specified terms. The number of terms that must match depend on the specified minimum should match field or script. <>:: Find documents where the field specified contains values (dates, numbers, or strings) in the range specified. <>:: Find documents where the field specified contains any non-null value. <>:: Find documents where the field specified contains terms which begin with the exact prefix specified. <>:: Find documents where the field specified contains terms which match the pattern specified, where the pattern supports single character wildcards (`?`) and multi-character wildcards (`\*`) <>:: Find documents where the field specified contains terms which match the <> specified. <>:: Find documents where the field specified contains terms which are fuzzily similar to the specified term. Fuzziness is measured as a http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein\_distance[Levenshtein edit distance] of 1 or 2. <>:: Find documents of the specified type. <>:: Find documents with the specified type and IDs. include::term-query.asciidoc[] include::terms-query.asciidoc[] include::terms-set-query.asciidoc[] include::range-query.asciidoc[] include::exists-query.asciidoc[] include::prefix-query.asciidoc[] include::wildcard-query.asciidoc[] include::regexp-query.asciidoc[] include::fuzzy-query.asciidoc[] include::type-query.asciidoc[] include::ids-query.asciidoc[]
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/term-level-queries.asciidoc
6.2
elasticsearch-6-2
[ 0.021086063235998154, 0.08453323692083359, 0.006036426406353712, 0.05244062468409538, 0.014708387665450573, -0.015402466990053654, 0.018551651388406754, 0.016576196998357773, 0.026715973392128944, 0.03186226263642311, 0.03280716389417648, -0.05352314934134483, 0.039409007877111435, -0.07896467298269272, 0.022257253527641296, 0.08335845172405243, -0.06230134516954422, -0.038002319633960724, -0.017015662044286728, -0.01690456084907055, 0.047652147710323334, 0.05066978186368942, -0.03981179744005203, -0.01598915457725525, -0.007989644072949886, 0.0129746925085783, -0.05009566992521286, 0.007063342723995447, 0.04394451901316643, 0.07456616312265396, -0.04391885921359062, 0.12748919427394867, 0.06817787140607834, 0.10523692518472672, 0.014311933889985085, -0.014820356853306293, -0.030955662950873375, -0.03614925593137741, -0.012548688799142838, -0.017830975353717804, -0.08492758125066757, -0.07206703722476959, -0.03226744011044502, -0.005141690373420715, 0.006167719606310129, -0.04288056120276451, -0.055027663707733154, -0.017506936565041542, -0.04703357815742493, -0.018235692754387856, -0.1214110478758812, 0.05399448424577713, -0.07652223110198975, 0.049996424466371536, 0.0197468101978302, 0.021946337074041367, -0.12370846420526505, -0.06203004717826843, -0.04988029971718788, -0.07135423272848129, -0.028803737834095955, -0.06246141716837883, -0.06641528755426407, -0.02518438547849655, -0.03251045197248459, -0.03143341466784477, 0.011866044253110886, -0.004218156449496746, 0.09696358442306519, 0.0017234418774023652, -0.02415604330599308, 0.029119011014699936, -0.07076550275087357, 0.04169733077287674, -0.011258299462497234, 0.06713483482599258, 0.041012704372406006, -0.042066652327775955, -0.002241291804239154, -0.060160551220178604, -0.05982614681124687, 0.0003935999411623925, -0.001559754367917776, 0.008516871370375156, 0.023315487429499626, -0.03313085064291954, 0.03609614446759224, -0.06816206872463226, 0.05537974834442139, 0.07231685519218445, 0.033295031636953354, -0.126190185546875, 0.017123617231845856, 0.000012276594134164043, 0.05050218105316162, -0.03360328450798988, 0.05240894854068756, -0.0013002771884202957, 0.13239222764968872, 0.040907468646764755, 0.06247386336326599, 0.02596977725625038, -0.019614631310105324, -0.09049784392118454, -0.13745462894439697, 0.02541928179562092, 0.004013492725789547, -0.056330930441617966, 0.0436164028942585, -0.03254040330648422, -0.06663192063570023, -0.05306941270828247, 0.021894821897149086, -0.08122104406356812, -0.020466268062591553, -0.04501023143529892, 0.07605551183223724, -0.03264231979846954, 0.023193253204226494, 0.07555205374956131, 0.07462546229362488, 0.050198689103126526, 0.018689123913645744, -0.02779499813914299, 0.0001043500960804522, 0.023538585752248764, -0.012023855932056904, 7.996855742549374e-33, 0.06366783380508423, -0.04041394591331482, 0.0023834442254155874, -0.002834166632965207, -0.11016993969678879, 0.11117645353078842, -0.01335400715470314, 0.10265322029590607, -0.05233602225780487, 0.14035235345363617, 0.020084304735064507, 0.0855768620967865, -0.046452395617961884, -0.004361544735729694, 0.07528964430093765, -0.03657149150967598, 0.020125554874539375, 0.009708503261208534, 0.027770422399044037, 0.016602201387286186, 0.02990025095641613, -0.07332362979650497, 0.00203215260989964, 0.04183025658130646, 0.0639660432934761, 0.0005588797503151, 0.0029423919040709734, -0.04016172140836716, -0.04030553251504898, -0.004934397991746664, -0.04687222093343735, -0.02689714916050434, 0.005851704627275467, -0.05303847789764404, 0.08564883470535278, 0.10894762724637985, 0.02524607628583908, 0.0033949152566492558, 0.02342323586344719, -0.0030002398416399956, -0.09157050400972366, -0.04052235186100006, 0.06341388076543808, -0.07928740233182907, -0.03410566225647926, -0.027238456532359123, -0.05038435012102127, 0.03749847784638405, 0.03418133407831192, 0.030768444761633873, -0.022669609636068344, 0.01961536332964897, -0.002905259607359767, 0.04335730895400047, 0.08133900165557861, 0.047970011830329895, -0.023171771317720413, 0.0350831113755703, -0.06770620495080948, 0.005019051488488913, 0.007056046277284622, -0.052851662039756775, -0.002213183091953397, -0.043128035962581635, -0.01790117472410202, 0.02638108655810356, 0.009577104821801186, 0.05471444129943848, 0.08747251331806183, 0.0913035199046135, -0.01737205870449543, 0.04544096812605858, 0.037749532610177994, 0.008751776069402695, 0.09760414808988571, -0.03504781052470207, 0.08246487379074097, -0.009751630015671253, -0.030358735471963882, 0.01143522746860981, -0.06696043908596039, 0.03687644377350807, 0.017252737656235695, 0.04181884229183197, -0.06717906147241592, 0.007662439718842506, 0.052773527801036835, 0.011424054391682148, -0.019813138991594315, -0.13445386290550232, -0.0026141374837607145, -0.0024358248338103294, -0.1067565530538559, -0.016988517716526985, 0.056182075291872025, -9.587421556750827e-33, 0.054911673069000244, -0.1063702180981636, -0.060970745980739594, -0.034337837249040604, -0.018242180347442627, -0.07441388070583344, 0.007742746267467737, -0.015626350417733192, 0.08595017343759537, -0.03932258114218712, 0.020998042076826096, 0.008812260814011097, -0.003974242601543665, -0.05227973684668541, 0.0403263233602047, 0.03480558842420578, -0.06553897261619568, -0.0721643790602684, -0.006615733727812767, 0.13412557542324066, -0.03652046248316765, 0.06520045548677444, -0.06555113196372986, 0.04970961809158325, 0.05047311633825302, -0.060647740960121155, -0.013600925914943218, 0.014470279216766357, -0.02019950933754444, 0.00999596156179905, -0.01855023019015789, -0.0606401152908802, -0.00987169612199068, -0.01168732438236475, -0.06542471051216125, -0.05223632976412773, 0.012215095572173595, -0.03442788124084473, -0.008974102325737476, 0.0035058478824794292, 0.03655926510691643, 0.08159900456666946, 0.049864865839481354, -0.017106564715504646, 0.009959034621715546, -0.020108027383685112, -0.08008353412151337, 0.01729019358754158, 0.03186770901083946, -0.047237250953912735, 0.007147631142288446, -0.07408805936574936, -0.03247467428445816, 0.037653401494026184, 0.017358927056193352, -0.008880150504410267, -0.05497833713889122, -0.02433931641280651, -0.08596079796552658, -0.012605126947164536, -0.05119365453720093, 0.11216039210557938, -0.014149664901196957, -0.003377197775989771, -0.021673398092389107, -0.022716090083122253, -0.040558259934186935, -0.02738015353679657, -0.054346613585948944, -0.09288711845874786, -0.004598502069711685, -0.05605049431324005, 0.005108680576086044, 0.009408658370375633, -0.050135426223278046, 0.00904020294547081, -0.023475928232073784, -0.0034151102881878614, 0.012262912467122078, 0.01966395229101181, 0.031298644840717316, 0.05097479000687599, 0.025722211226820946, 0.09767049551010132, -0.08058206737041473, 0.05154861509799957, -0.08184363692998886, 0.048334091901779175, -0.020470507442951202, -0.041274067014455795, -0.0028137434273958206, -0.09088048338890076, -0.03398240730166435, 0.012407318688929081, 0.001041228650137782, -6.339104174912791e-8, -0.07489240169525146, -0.03084578365087509, -0.044416602700948715, -0.028197020292282104, 0.05671481043100357, 0.05605422705411911, 0.002009741496294737, 0.040834568440914154, -0.029604671522974968, -0.06824597716331482, 0.11135656386613846, -0.008028830401599407, -0.08407294005155563, -0.05509389191865921, 0.035248465836048126, 0.06268700957298279, -0.03133172541856766, -0.04402569308876991, -0.02370068058371544, -0.015592032112181187, -0.0042040059342980385, 0.017393959686160088, -0.031163496896624565, 0.031702931970357895, 0.03553064540028572, 0.014223840087652206, -0.0056986319832503796, 0.11814840883016586, 0.03450771048665047, -0.009472949430346489, 0.07029203325510025, 0.01660504937171936, 0.023835165426135063, -0.021326448768377304, 0.021902820095419884, 0.06280455738306046, 0.042864859104156494, 0.024249324575066566, -0.11231732368469238, 0.035408101975917816, 0.07016851752996445, 0.0037711153272539377, -0.04715521261096001, -0.009759754873812199, -0.017740398645401, -0.057935841381549835, -0.029852017760276794, 0.030603863298892975, 0.10798867046833038, -0.08743700385093689, -0.008789985440671444, 0.018808940425515175, -0.02836347557604313, 0.06482746452093124, -0.06578806787729263, 0.041017111390829086, 0.04257093742489815, 0.09195932745933533, -0.012428976595401764, -0.05727475881576538, 0.05224812775850296, -0.011985029093921185, 0.03404952213168144, 0.03319905325770378 ]
0.141821
[[query-dsl-span-multi-term-query]] === Span Multi Term Query The `span\_multi` query allows you to wrap a `multi term query` (one of wildcard, fuzzy, prefix, range or regexp query) as a `span query`, so it can be nested. Example: [source,js] -------------------------------------------------- GET /\_search { "query": { "span\_multi":{ "match":{ "prefix" : { "user" : { "value" : "ki" } } } } } } -------------------------------------------------- // CONSOLE A boost can also be associated with the query: [source,js] -------------------------------------------------- GET /\_search { "query": { "span\_multi":{ "match":{ "prefix" : { "user" : { "value" : "ki", "boost" : 1.08 } } } } } } -------------------------------------------------- // CONSOLE
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/span-multi-term-query.asciidoc
6.2
elasticsearch-6-2
[ -0.08496280014514923, 0.04618024080991745, 0.03168148174881935, 0.0659194216132164, -0.02025485970079899, 0.027840467169880867, 0.027767153456807137, -0.013606606982648373, 0.035531461238861084, -0.09181055426597595, -0.0327472947537899, -0.058924511075019836, 0.025139426812529564, -0.024209804832935333, 0.05135360360145569, 0.050408367067575455, -0.09447398036718369, 0.054294291883707047, -0.034065037965774536, -0.08157727122306824, 0.09958536922931671, 0.019945768639445305, -0.015456062741577625, -0.0805659294128418, 0.019671503454446793, 0.012606550939381123, -0.04249473661184311, -0.07624780386686325, 0.04767121747136116, 0.09267164021730423, 0.01070871576666832, 0.022581132128834724, -0.02323038876056671, 0.05131834000349045, -0.02455657720565796, -0.020966777577996254, -0.03151949867606163, 0.020585274323821068, 0.0011257757432758808, 0.016771653667092323, 0.006491492968052626, 0.05678381398320198, -0.03859274089336395, -0.09173077344894409, -0.010398594662547112, -0.12279149144887924, -0.10976437479257584, -0.03505054488778114, -0.011484966613352299, 0.006215342320501804, -0.0900028869509697, -0.06011984124779701, -0.022863775491714478, 0.046961262822151184, 0.0886063501238823, -0.00019383002654649317, -0.11120188236236572, -0.011027330532670021, 0.011380085721611977, -0.05280875414609909, -0.005755065940320492, -0.10163763910531998, -0.020287666469812393, -0.006442475598305464, 0.04836072027683258, -0.03713148459792137, -0.035850778222084045, 0.021685130894184113, 0.028561046347022057, -0.0027083568274974823, -0.007992279715836048, -0.03839460760354996, -0.008623993024230003, -0.026820305734872818, 0.03539448603987694, 0.0440983884036541, -0.02490457147359848, -0.010404592379927635, 0.06568504124879837, 0.03389384597539902, -0.02368532121181488, -0.05931324139237404, -0.08079840987920761, 0.0031002331525087357, 0.04722429811954498, 0.006769028026610613, -0.02604397013783455, -0.17964836955070496, 0.01929450035095215, -0.04123628884553909, -0.03429710492491722, -0.04973646253347397, 0.04791950061917305, 0.031366974115371704, -0.02155730500817299, -0.002597568556666374, 0.02057560347020626, -0.009493973106145859, 0.060505010187625885, 0.03145977482199669, 0.02682477980852127, -0.03196927160024643, 0.017275016754865646, -0.058030515909194946, -0.07313302159309387, 0.014666491188108921, -0.0526495985686779, 0.03352510184049606, 0.006209667306393385, 0.0009296520729549229, -0.05439678207039833, 0.06834519654512405, -0.0018583419732749462, 0.010665669105947018, -0.03351234644651413, -0.034905992448329926, 0.05130669102072716, -0.09146878123283386, 0.10764949768781662, 0.08395040780305862, 0.06159815564751625, 0.04464568570256233, -0.04862760752439499, -0.005465046036988497, 0.040521327406167984, -0.02110724337399006, -0.0033573429100215435, -1.4075620986005544e-33, 0.10850642621517181, 0.0005843203980475664, 0.013754751533269882, -0.0321279838681221, 0.0055639734491705894, 0.06684251129627228, 0.007081953343003988, 0.096747487783432, -0.08262517303228378, 0.0375085286796093, -0.03972940519452095, 0.10383406281471252, -0.03311493620276451, -0.01914149895310402, -0.024559320881962776, 0.005406868644058704, 0.05213732644915581, -0.023955050855875015, 0.009141570888459682, 0.037306129932403564, -0.006869892589747906, 0.006367964670062065, -0.012803558260202408, 0.038359250873327255, 0.04680776596069336, -0.05866975709795952, -0.003359661903232336, -0.03625268489122391, -0.049050379544496536, 0.010411487892270088, -0.07333581894636154, -0.00898362323641777, 0.004289835691452026, 0.015508506447076797, 0.01527728047221899, 0.053928524255752563, 0.025209685787558556, 0.020569780841469765, -0.06053856760263443, 0.018230484798550606, -0.04225834086537361, -0.036711685359478, 0.035559188574552536, -0.10220286250114441, -0.08557844161987305, -0.02340504713356495, -0.05095260217785835, -0.07614123821258545, -0.06306056678295135, 0.003935102839022875, -0.04154384136199951, 0.06378252059221268, -0.039345137774944305, -0.042726319283246994, 0.05122027546167374, 0.014343169517815113, -0.01128561981022358, 0.11911071091890335, 0.024629462510347366, 0.06441452354192734, -0.049242470413446426, 0.005219245795160532, 0.0474051795899868, -0.013118313625454903, 0.01986663043498993, 0.013840679079294205, 0.005205092951655388, 0.04467344656586647, 0.04631384462118149, 0.09008700400590897, 0.0201549269258976, 0.046223100274801254, 0.041860464960336685, -0.0393870584666729, 0.03532255068421364, -0.06225798651576042, -0.029648825526237488, 0.05222339183092117, -0.0463324673473835, 0.023224463686347008, -0.07879935204982758, -0.047158386558294296, -0.05442074313759804, 0.11395645141601562, -0.05118928477168083, 0.039495330303907394, -0.0095504280179739, -0.05787263810634613, -0.06512290984392166, -0.007272142451256514, -0.056500453501939774, -0.001752782496623695, -0.043453920632600784, -0.07005360722541809, 0.009318088181316853, -1.2273789265931563e-33, 0.11498649418354034, -0.07242592424154282, 0.019359316676855087, -0.05613028258085251, 0.037872314453125, -0.09296329319477081, 0.02784205973148346, -0.02967230975627899, -0.02521309070289135, 0.00877912063151598, 0.015777667984366417, 0.021756036207079887, 0.07788478583097458, -0.06332835555076599, 0.01805080659687519, 0.1060834750533104, -0.0316864550113678, -0.03911985084414482, 0.003671439364552498, 0.02115056850016117, 0.0357586070895195, 0.0716097429394722, -0.08517776429653168, 0.07851190865039825, 0.01841328665614128, -0.07100272923707962, 0.03377531096339226, 0.01499346923083067, -0.05983586236834526, 0.04090563580393791, -0.007738274987787008, -0.07910160720348358, -0.01237794291228056, -0.011561170220375061, -0.12093164771795273, -0.014621156267821789, -0.017918936908245087, 0.02371092326939106, 0.021475745365023613, 0.028923507779836655, -0.0002542903530411422, 0.029666362330317497, 0.041823599487543106, 0.041957512497901917, 0.0016819204902276397, -0.007445116993039846, 0.025455739349126816, 0.02510347031056881, -0.020208753645420074, -0.05704646557569504, 0.05106176808476448, -0.025846440345048904, -0.09163203835487366, 0.05879158154129982, -0.009949328377842903, -0.07748265564441681, -0.003387640928849578, -0.02184068225324154, -0.04324246942996979, -0.0064621795900166035, -0.055045437067747116, 0.030404558405280113, 0.03131096810102463, -0.0318925604224205, 0.06514645367860794, -0.08733980357646942, -0.027816439047455788, -0.027682125568389893, 0.0099710151553154, -0.10308757424354553, 0.016957785934209824, -0.048905402421951294, 0.10626675188541412, 0.09200721979141235, -0.0035427070688456297, -0.029165564104914665, 0.015478803776204586, -0.03910539671778679, 0.05987035110592842, 0.011337117291986942, -0.0726543739438057, -0.046664759516716, 0.062041427940130234, 0.11885730922222137, -0.04781395569443703, 0.017094912007451057, -0.007049998734146357, 0.16270434856414795, 0.020529769361019135, -0.04187848046422005, 0.026966948062181473, -0.015700973570346832, -0.06352386623620987, 0.0076910946518182755, 0.049028463661670685, -5.276072201354509e-8, -0.0888296514749527, 0.0827430710196495, -0.10831225663423538, 0.06459426879882812, 0.028753681108355522, 0.025535549968481064, 0.1001698225736618, 0.05945263430476189, -0.031475991010665894, -0.003907837439328432, 0.03632057085633278, 0.06924107670783997, -0.016545208171010017, -0.033878009766340256, -0.014439196325838566, -0.03985898941755295, -0.06393220275640488, 0.06875745207071304, 0.008092320524156094, 0.027199702337384224, 0.03406836465001106, 0.022291747853159904, 0.006934355944395065, 0.06914765387773514, 0.07861115038394928, 0.015203314833343029, -0.022804738953709602, -0.02159937657415867, 0.07608279585838318, 0.037547651678323746, -0.07342849671840668, 0.04080844298005104, -0.026285581290721893, -0.014400167390704155, 0.02098630741238594, -0.04478365182876587, -0.03386945649981499, 0.023689057677984238, -0.03948621079325676, 0.04238882288336754, 0.08724738657474518, 0.0025254811625927687, -0.032325390726327896, 0.05573226138949394, -0.05041913688182831, -0.027270644903182983, 0.01974443346261978, -0.016240743920207024, 0.12328413128852844, 0.005783109925687313, 0.07420575618743896, -0.07329454272985458, 0.006557449232786894, -0.010464521124958992, -0.01535337045788765, -0.06808605790138245, -0.00037526662345044315, 0.03524358198046684, 0.02119452692568302, -0.026156466454267502, 0.09655556827783585, -0.06153746321797371, 0.00004610583346220665, 0.06015576422214508 ]
0.006179
[[query-dsl-query-string-query]] === Query String Query A query that uses a query parser in order to parse its content. Here is an example: [source,js] -------------------------------------------------- GET /\_search { "query": { "query\_string" : { "default\_field" : "content", "query" : "this AND that OR thus" } } } -------------------------------------------------- // CONSOLE The `query\_string` query parses the input and splits text around operators. Each textual part is analyzed independently of each other. For instance the following query: [source,js] -------------------------------------------------- GET /\_search { "query": { "query\_string" : { "default\_field" : "content", "query" : "(new york city) OR (big apple)" } } } -------------------------------------------------- // CONSOLE ... will be split into `new york city` and `big apple` and each part is then analyzed independently by the analyzer configured for the field. WARNING: Whitespaces are not considered operators, this means that `new york city` will be passed "as is" to the analyzer configured for the field. If the field is a `keyword` field the analyzer will create a single term `new york city` and the query builder will use this term in the query. If you want to query each term separately you need to add explicit operators around the terms (e.g. `new AND york AND city`). When multiple fields are provided it is also possible to modify how the different field queries are combined inside each textual part using the `type` parameter. The possible modes are described <> and the default is `best\_fields`. The `query\_string` top level parameters include: [cols="<,<",options="header",] |======================================================================= |Parameter |Description |`query` |The actual query to be parsed. See <>. |`default\_field` |The default field for query terms if no prefix field is specified. Defaults to the `index.query.default\_field` index settings, which in turn defaults to `\*`. `\*` extracts all fields in the mapping that are eligible to term queries and filters the metadata fields. All extracted fields are then combined to build a query when no prefix field is provided. |`default\_operator` |The default operator used if no explicit operator is specified. For example, with a default operator of `OR`, the query `capital of Hungary` is translated to `capital OR of OR Hungary`, and with default operator of `AND`, the same query is translated to `capital AND of AND Hungary`. The default value is `OR`. |`analyzer` |The analyzer name used to analyze the query string. |`quote\_analyzer` |The name of the analyzer that is used to analyze quoted phrases in the query string. For those parts, it overrides other analyzers that are set using the `analyzer` parameter or the <> setting. |`allow\_leading\_wildcard` |When set, `\*` or `?` are allowed as the first character. Defaults to `true`. |`enable\_position\_increments` |Set to `true` to enable position increments in result queries. Defaults to `true`. |`fuzzy\_max\_expansions` |Controls the number of terms fuzzy queries will expand to. Defaults to `50` |`fuzziness` |Set the fuzziness for fuzzy queries. Defaults to `AUTO`. See <> for allowed settings. |`fuzzy\_prefix\_length` |Set the prefix length for fuzzy queries. Default is `0`. |`fuzzy\_transpositions` |Set to `false` to disable fuzzy transpositions (`ab` -> `ba`). Default is `true`. |`phrase\_slop` |Sets the default slop for phrases. If zero, then exact phrase matches are required. Default value is `0`. |`boost` |Sets the boost value of the query. Defaults to `1.0`. |`auto\_generate\_phrase\_queries` |Defaults to `false`. |`analyze\_wildcard` |By default, wildcards terms in a query string are not analyzed. By setting this value to `true`, a best effort will be made to analyze those as well. |`max\_determinized\_states` |Limit on how many automaton states regexp queries are allowed to create. This protects against too-difficult (e.g. exponentially hard) regexps. Defaults to 10000. |`minimum\_should\_match` |A value controlling how many "should" clauses in the resulting boolean query should match. It
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/query-string-query.asciidoc
6.2
elasticsearch-6-2
[ -0.05282368138432503, 0.08805615454912186, 0.03295513242483139, 0.07027649879455566, -0.03826076164841652, 0.010574353858828545, 0.06356418132781982, 0.037894077599048615, 0.06604307889938354, -0.08952023088932037, -0.0683312863111496, -0.017828620970249176, -0.013849536888301373, -0.04739288613200188, 0.06095708906650543, 0.05335177108645439, -0.0281742662191391, 0.0522889718413353, -0.09625951945781708, -0.08841840922832489, 0.05818377807736397, 0.08129636198282242, -0.055642154067754745, -0.03332536667585373, 0.03675881773233414, 0.06988018751144409, -0.001541605219244957, -0.025383861735463142, 0.06614802032709122, 0.09031283855438232, -0.029970966279506683, -0.040264129638671875, -0.005339703056961298, 0.09105471521615982, -0.024123167619109154, 0.02962287701666355, -0.0371076762676239, -0.00723176309838891, 0.03268691152334213, -0.027440309524536133, 0.010878140106797218, 0.031745366752147675, -0.0762920081615448, -0.07208190113306046, 0.03522426262497902, -0.08611785620450974, -0.09706424176692963, -0.005946843884885311, -0.05998968705534935, -0.03532572463154793, -0.11699148267507553, -0.0029478883370757103, -0.07695402204990387, -0.010125240311026573, 0.04093829169869423, 0.03774838149547577, -0.12061332911252975, -0.014849799685180187, 0.02836352400481701, -0.010925911366939545, 0.008409151807427406, -0.0806586742401123, -0.0038464937824755907, 0.030853386968374252, 0.01784813217818737, -0.08560170978307724, 0.020374583080410957, 0.04565642401576042, 0.029105691239237785, -0.0060315500013530254, -0.0796334370970726, -0.001564080361276865, -0.04363778606057167, -0.0019356085686013103, -0.03464699536561966, 0.06917278468608856, -0.04036090523004532, -0.0075209797360002995, 0.00574490474537015, 0.03227408975362778, 0.025362227112054825, -0.09161805361509323, -0.01963188126683235, 0.07191368192434311, -0.015415560454130173, -0.007355554960668087, -0.041284676641225815, -0.03756501153111458, 0.08792517334222794, -0.014125117100775242, -0.08696018159389496, -0.10784698277711868, -0.010982474312186241, 0.008642511442303658, 0.03400012478232384, 0.08137650042772293, -0.02209407277405262, -0.05932622775435448, 0.07722889631986618, 0.0218568854033947, 0.032429881393909454, 0.009009821340441704, 0.051713258028030396, -0.0735471248626709, -0.09814012050628662, -0.0013065445236861706, -0.005542532540857792, 0.009809862822294235, 0.005506516434252262, -0.01992597058415413, 0.0051603117026388645, 0.09814777970314026, -0.02700488083064556, -0.0316384993493557, -0.03745130077004433, -0.012492338195443153, 0.06240668147802353, -0.07781638950109482, 0.06564541161060333, 0.10223837196826935, 0.06465483456850052, 0.04151700809597969, -0.08108121901750565, -0.015089524909853935, 0.034510377794504166, -0.030425990000367165, 0.03892024606466293, 5.026672820215267e-34, 0.0866909921169281, 0.0010634586215019226, 0.02424572966992855, -0.05997977778315544, -0.023673560470342636, 0.07560072839260101, -0.0100718904286623, 0.08331825584173203, -0.05390937253832817, 0.05830160155892372, -0.01666303724050522, 0.012916005216538906, -0.0366719514131546, -0.06936147809028625, -0.021939894184470177, 0.0029408689588308334, 0.01580505445599556, -0.01818101480603218, -0.00137696776073426, 0.04343780502676964, -0.0025394316762685776, 0.03298712149262428, -0.0034977346658706665, 0.07020485401153564, 0.027998071163892746, -0.017752310261130333, -0.013752371072769165, -0.015497596934437752, -0.11598237603902817, -0.008590351790189743, -0.04195693880319595, -0.06004570424556732, 0.008248940110206604, -0.004830386023968458, 0.08933939784765244, 0.03533748537302017, 0.016130516305565834, 0.04232889041304588, -0.03441964089870453, -0.01929190196096897, -0.04256412759423256, -0.03277823328971863, 0.04272820055484772, -0.08082900196313858, -0.0800594687461853, -0.04224441573023796, -0.14594656229019165, -0.009944179095327854, -0.028672849759459496, -0.030924107879400253, -0.041998956352472305, 0.07391296327114105, 0.02484636940062046, -0.016718070954084396, 0.12064560502767563, -0.007636911701411009, 0.013604608364403248, 0.11493019014596939, -0.004949307534843683, 0.09369687736034393, -0.05073394626379013, 0.03572947531938553, 0.02247695066034794, -0.03680609539151192, 0.05874733254313469, 0.07470806688070297, -0.01215856522321701, 0.025994662195444107, 0.002979100216180086, 0.040467750281095505, -0.0050564296543598175, 0.04972127452492714, 0.01618647389113903, -0.01636686734855175, 0.030916837975382805, -0.060310423374176025, -0.08021967858076096, 0.01751868426799774, 0.017527002841234207, 0.01511827576905489, -0.07741132378578186, -0.069626085460186, -0.018797054886817932, 0.0985293909907341, -0.08019386976957321, 0.0566616915166378, -0.027219802141189575, -0.03472509607672691, -0.011772452853620052, -0.0618911050260067, -0.0032607887405902147, 0.012398181483149529, -0.10892060399055481, -0.09041829407215118, 0.040501125156879425, -4.487363358897694e-33, 0.026579435914754868, -0.02824532613158226, -0.02371409349143505, 0.035825636237859726, 0.02205144613981247, -0.07164157927036285, -0.0016839965246617794, -0.02351165935397148, 0.04587896168231964, 0.03766460716724396, -0.015588263049721718, 0.048768140375614166, 0.007324418053030968, -0.07697546482086182, -0.003503066021949053, 0.10006638616323471, -0.06596086919307709, -0.05966833606362343, 0.03816884756088257, 0.028466099873185158, 0.006056223530322313, 0.07492642104625702, -0.016644153743982315, 0.04152578115463257, 0.004296388477087021, -0.03847429156303406, 0.027761364355683327, 0.023583006113767624, -0.05019455403089523, 0.061054084450006485, -0.021184934303164482, -0.05692225694656372, 0.015165417455136776, -0.024379156529903412, -0.13141030073165894, -0.012664721347391605, 0.008822214789688587, 0.05172192305326462, 0.023715250194072723, 0.012638780288398266, -0.025977429002523422, -0.014882189221680164, 0.010966185480356216, 0.053120046854019165, 0.01361700240522623, -0.024749312549829483, -0.040920693427324295, 0.05385565757751465, -0.01087419968098402, -0.05133373290300369, 0.019124463200569153, -0.008206281810998917, -0.09946725517511368, 0.02864065207540989, -0.02885858714580536, -0.08880966901779175, -0.051427047699689865, -0.027850691229104996, -0.0930333212018013, 0.0009012328227981925, -0.05936110392212868, 0.004429931752383709, 0.013765709474682808, -0.01083314698189497, 0.05508657172322273, -0.05054348334670067, -0.018845967948436737, -0.004658197984099388, 0.006490839179605246, -0.10155225545167923, 0.03227388858795166, -0.09242025762796402, 0.08834101259708405, 0.062325287610292435, 0.05374709516763687, -0.013100448995828629, 0.0018868416082113981, 0.028405383229255676, 0.06278885155916214, 0.06951349973678589, 0.0020853637252002954, -0.012171710841357708, 0.04209489747881889, 0.10820233076810837, -0.0225972943007946, -0.01924675516784191, -0.08052976429462433, 0.08592518419027328, -0.04688523709774017, -0.044771287590265274, 0.008692183531820774, -0.0070725250989198685, -0.05925567448139191, 0.010009527206420898, 0.02437940053641796, -5.342270270602967e-8, -0.10146923363208771, -0.03430028259754181, -0.1369151473045349, 0.02333514578640461, 0.023942533880472183, 0.050176411867141724, 0.026871919631958008, 0.0806422308087349, -0.046351756900548935, -0.02726101316511631, 0.02136695384979248, 0.059843145310878754, -0.0005391030572354794, -0.047720372676849365, -0.03943559154868126, 0.006832747254520655, -0.026403851807117462, 0.0010640821419656277, -0.02121550217270851, -0.06971455365419388, 0.05462804436683655, 0.004117754753679037, -0.02372235618531704, -0.013896685093641281, 0.10537667572498322, 0.02325524017214775, -0.04013315960764885, 0.012913990765810013, 0.051992882043123245, 0.07119245082139969, -0.02694758214056492, 0.01699794828891754, -0.029101256281137466, -0.0003196068573743105, -0.008538493886590004, -0.0485304556787014, 0.02210129424929619, -0.06549288332462311, -0.03724795579910278, 0.03397289291024208, 0.06710334122180939, 0.01904904842376709, -0.05609890818595886, 0.0709492489695549, -0.04689256101846695, -0.0260118767619133, 0.060859836637973785, -0.010585992597043514, 0.11459410190582275, -0.038760218769311905, 0.049818869680166245, -0.08156556636095047, -0.03085058368742466, -0.05695599690079689, -0.07979609072208405, -0.04060748219490051, 0.037898700684309006, 0.021557532250881195, -0.01679147593677044, -0.023792866617441177, 0.03499395400285721, 0.02060709334909916, 0.04249522089958191, 0.024089964106678963 ]
0.049081
best effort will be made to analyze those as well. |`max\_determinized\_states` |Limit on how many automaton states regexp queries are allowed to create. This protects against too-difficult (e.g. exponentially hard) regexps. Defaults to 10000. |`minimum\_should\_match` |A value controlling how many "should" clauses in the resulting boolean query should match. It can be an absolute value (`2`), a percentage (`30%`) or a <>. |`lenient` |If set to `true` will cause format based failures (like providing text to a numeric field) to be ignored. |`time\_zone` | Time Zone to be applied to any range query related to dates. See also http://www.joda.org/joda-time/apidocs/org/joda/time/DateTimeZone.html[JODA timezone]. |`quote\_field\_suffix` | A suffix to append to fields for quoted parts of the query string. This allows to use a field that has a different analysis chain for exact matching. Look <> for a comprehensive example. |`auto\_generate\_synonyms\_phrase\_query` |Whether phrase queries should be automatically generated for multi terms synonyms. Defaults to `true`. |`all\_fields` | deprecated[6.0.0, set `default\_field` to `\*` instead] Perform the query on all fields detected in the mapping that can be queried. Will be used by default when the `\_all` field is disabled and no `default\_field` is specified (either in the index settings or in the request body) and no `fields` are specified. |======================================================================= When a multi term query is being generated, one can control how it gets rewritten using the <> parameter. [float] ==== Default Field When not explicitly specifying the field to search on in the query string syntax, the `index.query.default\_field` will be used to derive which field to search on. If the `index.query.default\_field` is not specified, the `query\_string` will automatically attempt to determine the existing fields in the index's mapping that are queryable, and perform the search on those fields. Note that this will not include nested documents, use a nested query to search those documents. [float] ==== Multi Field The `query\_string` query can also run against multiple fields. Fields can be provided via the `"fields"` parameter (example below). The idea of running the `query\_string` query against multiple fields is to expand each query term to an OR clause like this: field1:query\_term OR field2:query\_term | ... For example, the following query [source,js] -------------------------------------------------- GET /\_search { "query": { "query\_string" : { "fields" : ["content", "name"], "query" : "this AND that" } } } -------------------------------------------------- // CONSOLE matches the same words as [source,js] -------------------------------------------------- GET /\_search { "query": { "query\_string": { "query": "(content:this OR name:this) AND (content:that OR name:that)" } } } -------------------------------------------------- // CONSOLE Since several queries are generated from the individual search terms, combining them is automatically done using a `dis\_max` query with a tie\_breaker. For example (the `name` is boosted by 5 using `^5` notation): [source,js] -------------------------------------------------- GET /\_search { "query": { "query\_string" : { "fields" : ["content", "name^5"], "query" : "this AND that OR thus", "tie\_breaker" : 0 } } } -------------------------------------------------- // CONSOLE Simple wildcard can also be used to search "within" specific inner elements of the document. For example, if we have a `city` object with several fields (or inner object with fields) in it, we can automatically search on all "city" fields: [source,js] -------------------------------------------------- GET /\_search { "query": { "query\_string" : { "fields" : ["city.\*"], "query" : "this AND that OR thus" } } } -------------------------------------------------- // CONSOLE Another option is to provide the wildcard fields search in the query string itself (properly escaping the `\*` sign), for example: `city.\\*:something`: [source,js] -------------------------------------------------- GET /\_search { "query": { "query\_string" : { "query" : "city.\\\*:(this AND that OR thus)" } } } -------------------------------------------------- // CONSOLE NOTE: Since `\` (backslash) is a special character in json strings, it needs to be escaped, hence
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/query-dsl/query-string-query.asciidoc
6.2
elasticsearch-6-2
[ -0.013320173136889935, 0.054531607776880264, -0.00047288008499890566, 0.0068161762319505215, 0.02568729780614376, 0.023140616714954376, -0.022379666566848755, 0.03768691420555115, -0.030938290059566498, -0.026198305189609528, -0.024117738008499146, -0.07384421676397324, -0.027728328481316566, 0.03344627469778061, 0.04164068028330803, 0.044732388108968735, 0.005855902563780546, -0.0418047159910202, -0.10196508467197418, -0.05839500203728676, 0.08503768593072891, 0.041821546852588654, -0.023168891668319702, -0.04753071814775467, 0.0002841802197508514, -0.030407462269067764, 0.01143527589738369, -0.019429616630077362, 0.018798545002937317, 0.08179990202188492, -0.09290551394224167, 0.06755077838897705, 0.006395179312676191, 0.02194066345691681, 0.06419306248426437, -0.0704650953412056, 0.03143904730677605, -0.015624700114130974, -0.020815186202526093, -0.025967538356781006, 0.062244441360235214, -0.019091147929430008, 0.005484757944941521, -0.033954035490751266, -0.014000466093420982, -0.02666773833334446, 0.0026217831764370203, 0.04897032678127289, -0.04391288757324219, 0.05621114745736122, -0.09196013957262039, -0.006971107330173254, -0.005209363531321287, -0.02307884208858013, 0.0020004946272820234, 0.0028989457059651613, -0.04085497185587883, 0.05531557276844978, 0.019439570605754852, -0.02527918666601181, -0.008364216424524784, -0.01900329254567623, -0.049801137298345566, -0.025526953861117363, 0.011496933177113533, -0.10116412490606308, -0.00663186376914382, -0.0248293187469244, 0.03715314716100693, 0.026261134073138237, -0.060410209000110626, -0.004316528327763081, -0.08695191890001297, 0.04052933678030968, 0.019547361880540848, 0.07479184865951538, -0.01821734383702278, -0.08470632880926132, 0.0800597220659256, -0.027578363195061684, -0.08831582218408585, -0.10283426940441132, 0.010316360741853714, 0.021269796416163445, 0.058229971677064896, -0.07436259835958481, 0.004073409829288721, 0.04523182660341263, 0.11397353559732437, -0.047472935169935226, 0.0006841549184173346, -0.10662411898374557, 0.006467211525887251, 0.01001396868377924, 0.05722225829958916, 0.048858776688575745, -0.011189088225364685, 0.012541578151285648, 0.07969609647989273, 0.038560230284929276, 0.020512575283646584, 0.01604236103594303, -0.001263512298464775, 0.007112907245755196, -0.013738404028117657, 0.025000065565109253, 0.008943846449255943, 0.0353507474064827, -0.06430717557668686, 0.005885114427655935, 0.01282050646841526, 0.019729044288396835, 0.08591212332248688, -0.0991772711277008, 0.022246364504098892, 0.02275191992521286, 0.022140508517622948, 0.00006928354559931904, -0.008453711867332458, 0.028254367411136627, 0.03723439946770668, -0.005765898153185844, 0.0425572544336319, -0.020769162103533745, 0.06774555891752243, 0.08632071316242218, -0.005524744279682636, 5.2749647777577814e-33, 0.07193426787853241, -0.012342985719442368, 0.0068530854769051075, -0.06885726004838943, -0.07565788179636002, 0.005303798243403435, -0.024505790323019028, 0.09539617598056793, 0.05814187228679657, 0.03632976859807968, -0.06393519043922424, 0.04586414620280266, 0.021004561334848404, -0.05987843498587608, 0.02796880155801773, 0.014237568713724613, 0.05534469336271286, -0.06465135514736176, 0.037286609411239624, 0.09400461614131927, 0.06968220323324203, -0.05223381891846657, -0.011706549674272537, 0.002503913128748536, 0.025430826470255852, -0.040747303515672684, -0.013895400799810886, -0.0005017562070861459, -0.04592745378613472, 0.021959742531180382, -0.05835197865962982, -0.08330731838941574, -0.027743646875023842, 0.049152929335832596, 0.10866683721542358, 0.09384710341691971, -0.02501438371837139, -0.010496857576072216, -0.04718669131398201, -0.09704135358333588, -0.07337240874767303, 0.004341375082731247, 0.01467902958393097, -0.044928811490535736, 0.05145850405097008, -0.009194722399115562, -0.02045109122991562, -0.00589860649779439, -0.02590421959757805, 0.06297942250967026, -0.011556093581020832, 0.03417569398880005, 0.05113258585333824, -0.06837420165538788, 0.04831366240978241, -0.04872535541653633, 0.06659435480833054, 0.04286084324121475, 0.04518158733844757, 0.12148572504520416, -0.043833013623952866, -0.054807379841804504, 0.04946363344788551, -0.005786383990198374, 0.004257578402757645, 0.04206475242972374, 0.013418960385024548, 0.012733355164527893, 0.024075353518128395, 0.05024613440036774, 0.06174039468169212, 0.041257571429014206, 0.0025016549043357372, -0.02343418076634407, 0.05041712149977684, -0.11487913131713867, 0.21173733472824097, 0.010320774279534817, -0.027131980285048485, -0.07114523649215698, 0.026142241433262825, -0.06704481691122055, -0.03219073265790939, -0.0062972307205200195, -0.03806132823228836, -0.07251916080713272, -0.009111844003200531, 0.002993809524923563, -0.10402139276266098, -0.07535263895988464, 0.054547734558582306, -0.028824836015701294, -0.030499199405312538, 0.03343254700303078, -0.012116484344005585, -5.605205956625887e-33, 0.046985555440187454, -0.02256734110414982, 0.014098678715527058, 0.022969473153352737, 0.025085626170039177, -0.08547629415988922, 0.020990949124097824, 0.08983346074819565, 0.05745578557252884, -0.07980601489543915, -0.002336956327781081, -0.06121951341629028, 0.09756460040807724, -0.07263288646936417, -0.06906972825527191, 0.016517722979187965, -0.011532772332429886, -0.07447532564401627, 0.026584355160593987, 0.08104939013719559, -0.053763486444950104, 0.07244662940502167, -0.08577349781990051, 0.05678075551986694, 0.00982431136071682, -0.02852567471563816, -0.03660708665847778, -0.06491605937480927, -0.13463017344474792, 0.043111734092235565, -0.007142603863030672, -0.10919582843780518, -0.07790975272655487, 0.023913510143756866, -0.058831389993429184, -0.06513854116201401, 0.02366335690021515, 0.01102218497544527, 0.03484395891427994, 0.04066164046525955, 0.07252509146928787, 0.02844933606684208, -0.05844348669052124, 0.06450703740119934, -0.04863853380084038, 0.05940146744251251, -0.056964319199323654, 0.024244587868452072, -0.02426668256521225, -0.062342043966054916, -0.015126870945096016, -0.05316603183746338, 0.0006632157019339502, 0.06906554102897644, 0.020258957520127296, 0.017689911648631096, -0.004353363532572985, 0.04927394911646843, -0.09973461180925369, 0.0392325259745121, -0.09207116067409515, 0.0367739163339138, 0.03824584558606148, 0.04745437949895859, 0.023803802207112312, -0.03647583723068237, 0.002750287065282464, 0.01919976994395256, 0.002693394897505641, -0.05566161125898361, 0.07134751975536346, 0.008300825022161007, -0.05829416587948799, 0.06657037138938904, -0.08911657333374023, -0.03302378207445145, 0.014980466105043888, 0.018856223672628403, -0.013048406690359116, 0.09157279878854752, -0.037549939006567, -0.019749652594327927, 0.032871734350919724, 0.10005789250135422, -0.07371769100427628, 0.10126009583473206, -0.06128093600273132, 0.046123258769512177, 0.010678643360733986, 0.01711862161755562, 0.0004347656504251063, 0.028192885220050812, -0.08239471167325974, 0.04433666914701462, -0.019169669598340988, -5.204995190410955e-8, -0.023188089951872826, -0.011389468796551228, -0.0405932255089283, -0.015274620614945889, -0.01516699232161045, -0.009933247230947018, 0.008929477073252201, 0.049600210040807724, 0.03456065058708191, 0.08519930392503738, 0.15521015226840973, 0.05071140453219414, -0.12105698138475418, -0.09759964048862457, -0.021105049178004265, 0.019490322098135948, -0.027697445824742317, 0.024475514888763428, -0.05788831785321236, 0.012469932436943054, 0.0342533215880394, 0.024061668664216995, -0.00923885591328144, 0.007326172664761543, 0.027326108887791634, -0.01688442751765251, -0.061887599527835846, 0.09485023468732834, 0.0661911740899086, 0.03443079814314842, 0.011253382079303265, -0.030646197497844696, 0.03371991962194443, -0.06269363313913345, -0.1191287562251091, -0.03462650626897812, -0.0011312497081235051, -0.03156823664903641, -0.06172290816903114, 0.03145185858011246, 0.05676406994462013, 0.02541857399046421, -0.10608814656734467, -0.015759091824293137, -0.010295347310602665, -0.0464431568980217, 0.03959525004029274, -0.029439162462949753, 0.025557255372405052, -0.04426425322890282, 0.00011931818880839273, -0.028868146240711212, 0.016886258497834206, 0.043125808238983154, -0.000022302414436126128, -0.03020508587360382, -0.02094493992626667, 0.018452389165759087, 0.047631293535232544, 0.0054558957926929, 0.01907876320183277, 0.021761195734143257, -0.0016856358852237463, 0.02143051102757454 ]
0.09552