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
|
|---|---|---|---|---|---|
[[modules-transport]] == Transport The transport module is used for internal communication between nodes within the cluster. Each call that goes from one node to the other uses the transport module (for example, when an HTTP GET request is processed by one node, and should actually be processed by another node that holds the data). The transport mechanism is completely asynchronous in nature, meaning that there is no blocking thread waiting for a response. The benefit of using asynchronous communication is first solving the http://en.wikipedia.org/wiki/C10k\_problem[C10k problem], as well as being the ideal solution for scatter (broadcast) / gather operations such as search in Elasticsearch. [float] === TCP Transport The TCP transport is an implementation of the transport module using TCP. It allows for the following settings: [cols="<,<",options="header",] |======================================================================= |Setting |Description |`transport.tcp.port` |A bind port range. Defaults to `9300-9400`. |`transport.publish\_port` |The port that other nodes in the cluster should use when communicating with this node. Useful when a cluster node is behind a proxy or firewall and the `transport.tcp.port` is not directly addressable from the outside. Defaults to the actual port assigned via `transport.tcp.port`. |`transport.bind\_host` |The host address to bind the transport service to. Defaults to `transport.host` (if set) or `network.bind\_host`. |`transport.publish\_host` |The host address to publish for nodes in the cluster to connect to. Defaults to `transport.host` (if set) or `network.publish\_host`. |`transport.host` |Used to set the `transport.bind\_host` and the `transport.publish\_host` Defaults to `transport.host` or `network.host`. |`transport.tcp.connect\_timeout` |The socket connect timeout setting (in time setting format). Defaults to `30s`. |`transport.tcp.compress` |Set to `true` to enable compression (`DEFLATE`) between all nodes. Defaults to `false`. |`transport.ping\_schedule` | Schedule a regular application-level ping message to ensure that transport connections between nodes are kept alive. Defaults to `5s` in the transport client and `-1` (disabled) elsewhere. It is preferable to correctly configure TCP keep-alives instead of using this feature, because TCP keep-alives apply to all kinds of long-lived connection and not just to transport connections. |======================================================================= It also uses the common <>. [float] ==== TCP Transport Profiles Elasticsearch allows you to bind to multiple ports on different interfaces by the use of transport profiles. See this example configuration [source,yaml] -------------- transport.profiles.default.port: 9300-9400 transport.profiles.default.bind\_host: 10.0.0.1 transport.profiles.client.port: 9500-9600 transport.profiles.client.bind\_host: 192.168.0.1 transport.profiles.dmz.port: 9700-9800 transport.profiles.dmz.bind\_host: 172.16.1.2 -------------- The `default` profile is special. It is used as a fallback for any other profiles, if those do not have a specific configuration setting set, and is how this node connects to other nodes in the cluster. The following parameters can be configured on each transport profile, as in the example above: \* `port`: The port to bind to \* `bind\_host`: The host to bind \* `publish\_host`: The host which is published in informational APIs \* `tcp\_no\_delay`: Configures the `TCP\_NO\_DELAY` option for this socket \* `tcp\_keep\_alive`: Configures the `SO\_KEEPALIVE` option for this socket \* `reuse\_address`: Configures the `SO\_REUSEADDR` option for this socket \* `tcp\_send\_buffer\_size`: Configures the send buffer size of the socket \* `tcp\_receive\_buffer\_size`: Configures the receive buffer size of the socket [float] ==== Long-lived idle connections Elasticsearch opens a number of long-lived TCP connections between each pair of nodes in the cluster, and some of these connections may be idle for an extended period of time. Nonetheless, Elasticsearch requires these connections to remain open, and it can disrupt the operation of the cluster if any inter-node connections are closed by an external influence such as a firewall. It is important to configure your network to preserve long-lived idle connections between Elasticsearch nodes, for instance by leaving `tcp\_keep\_alive` enabled and ensuring that the keepalive interval is shorter than any timeout that might cause idle connections to be closed, or by setting `transport.ping\_schedule` if
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/transport.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.05251280218362808,
0.048360805958509445,
-0.0500483438372612,
0.05620797723531723,
-0.012604775838553905,
-0.08039204031229019,
0.030042054131627083,
-0.011038214899599552,
0.044681139290332794,
-0.019075293093919754,
-0.06718271970748901,
-0.03569506108760834,
0.0362323559820652,
-0.049967776983976364,
-0.06357688456773758,
-0.0471399687230587,
0.13104331493377686,
-0.037123892456293106,
-0.06588274985551834,
-0.05378684028983116,
-0.07268569618463516,
0.014064113609492779,
-0.027421757578849792,
0.020175404846668243,
-0.0822087898850441,
-0.0038595767691731453,
-0.07599896192550659,
-0.0797109380364418,
0.04584945738315582,
0.04499085247516632,
-0.04781492054462433,
-0.026098454371094704,
-0.05135645717382431,
0.11805733293294907,
-0.1095351129770279,
0.12003898620605469,
-0.014655311591923237,
-0.07351185381412506,
-0.09514649212360382,
0.006099533289670944,
0.03255391865968704,
0.003946367185562849,
-0.05496452376246452,
0.00885999295860529,
-0.03800395876169205,
-0.08142375946044922,
-0.018884412944316864,
0.05927100032567978,
-0.031550563871860504,
-0.0884496346116066,
-0.05383538454771042,
0.005163748748600483,
-0.09366355836391449,
0.11038895696401596,
0.004597371444106102,
0.0592549592256546,
-0.035710081458091736,
-0.01109114196151495,
0.00374760408885777,
0.013628399930894375,
0.018171392381191254,
-0.08623232692480087,
0.02112681046128273,
0.015135668218135834,
0.10738555341959,
-0.045105550438165665,
0.044208504259586334,
0.03788422793149948,
0.07551703602075577,
-0.01778256706893444,
0.0017451192252337933,
-0.004211938474327326,
-0.048626694828271866,
0.048232898116111755,
0.04731167107820511,
-0.008088981732726097,
0.010882033966481686,
0.04964488744735718,
0.017085552215576172,
0.0176889356225729,
-0.01531246304512024,
-0.039889365434646606,
-0.04247494041919708,
0.018991271033883095,
-0.023201338946819305,
-0.05459796264767647,
-0.0063079772517085075,
-0.008360300213098526,
-0.016280541196465492,
-0.07377483695745468,
-0.012039379216730595,
0.038118910044431686,
-0.04703303426504135,
0.013096875511109829,
-0.009080060757696629,
0.06619669497013092,
0.04535830765962601,
0.08927641063928604,
0.016444705426692963,
0.014780901372432709,
0.06946656107902527,
-0.002177606336772442,
0.033506400883197784,
-0.005707014352083206,
-0.05521512031555176,
-0.06024233624339104,
0.018112098798155785,
0.06390996277332306,
-0.029978526756167412,
-0.02272689901292324,
-0.01903277263045311,
0.026195751503109932,
-0.01876196451485157,
-0.01058458723127842,
-0.1069183498620987,
0.0699673444032669,
0.025604382157325745,
-0.039396580308675766,
0.020853446796536446,
0.09592747688293457,
0.025350231677293777,
-0.08573811501264572,
0.019870270043611526,
-0.07718096673488617,
0.04979504272341728,
-0.001717977924272418,
-0.03974273055791855,
9.734803569088987e-33,
-0.08492358028888702,
-0.040801506489515305,
0.014634225517511368,
-0.04630468785762787,
-0.0551358237862587,
-0.007633809465914965,
0.009548112750053406,
-0.009570912458002567,
-0.03957756236195564,
-0.09245963394641876,
-0.08162976801395416,
0.061212554574012756,
0.009577327407896519,
-0.009399632923305035,
0.0053485999815166,
-0.08499117195606232,
0.02752869948744774,
0.043235715478658676,
0.04016093909740448,
0.0010466508101671934,
0.10287579894065857,
-0.05092616379261017,
0.024669267237186432,
0.017961489036679268,
0.055215612053871155,
-0.044775038957595825,
-0.07947998493909836,
-0.05764886364340782,
-0.00048403130494989455,
0.06062929704785347,
-0.0205353032797575,
0.11156041920185089,
-0.04138670861721039,
0.0354909785091877,
-0.0022221452090889215,
0.009893897920846939,
0.005727492272853851,
-0.059283941984176636,
0.007591563742607832,
-0.01662452518939972,
-0.07765943557024002,
0.02309499680995941,
-0.05328919366002083,
-0.00507144071161747,
-0.07310593873262405,
-0.04811161383986473,
-0.06451679021120071,
-0.0035852852743119,
0.03558223694562912,
0.0013881317572668195,
0.022679653018712997,
0.004465004429221153,
0.040923696011304855,
-0.026972930878400803,
0.10250581800937653,
0.0331512913107872,
0.09287970513105392,
0.006483754608780146,
-0.05052097141742706,
0.12739375233650208,
0.008435302414000034,
-0.026907961815595627,
-0.014516950584948063,
0.018840383738279343,
0.06925518065690994,
0.06494784355163574,
-0.04548606649041176,
0.04797590896487236,
0.04449494183063507,
-0.013234348967671394,
0.01434975303709507,
0.048661086708307266,
0.03361242264509201,
0.03790683299303055,
0.03086021915078163,
-0.005806386936455965,
-0.06224309280514717,
-0.043703582137823105,
-0.029962146654725075,
-0.024195069447159767,
-0.03292782977223396,
-0.006394308526068926,
-0.038816627115011215,
0.00454467348754406,
-0.045217592269182205,
-0.030100304633378983,
-0.03456209599971771,
0.059864938259124756,
-0.04204714298248291,
-0.03234308212995529,
-0.02163054049015045,
0.07745250314474106,
0.035982877016067505,
-0.018748147413134575,
-0.05593809857964516,
-9.476576847572101e-33,
-0.008862277492880821,
-0.00018660629575606436,
-0.028690088540315628,
0.079599529504776,
0.04553310200572014,
0.03963540121912956,
0.017975082620978355,
-0.06467461585998535,
0.06613169610500336,
0.07684661448001862,
-0.014044467359781265,
-0.018247906118631363,
-0.0287749245762825,
0.05893591418862343,
-0.02858402393758297,
0.000266876129899174,
0.06269418448209763,
-0.023409435525536537,
-0.029627710580825806,
-0.02073599584400654,
-0.06515539437532425,
-0.0014543236466124654,
-0.08107234537601471,
-0.03324905410408974,
-0.06709117442369461,
-0.007068370468914509,
-0.08582337200641632,
-0.03921210765838623,
-0.03870280832052231,
0.008530690334737301,
-0.05056826397776604,
-0.025744955986738205,
0.020066658034920692,
-0.022223155945539474,
-0.0017917512450367212,
0.06583501398563385,
0.04898543283343315,
0.05747783184051514,
0.024093318730592728,
-0.047957126051187515,
0.0789700448513031,
0.040869489312171936,
-0.005370060447603464,
0.009612666442990303,
0.023292964324355125,
-0.01296890340745449,
-0.09091558307409286,
0.03162913769483566,
-0.030914844945073128,
-0.023036986589431763,
0.03894667699933052,
0.0060101761482656,
0.024866973981261253,
0.03745579347014427,
0.006646983791142702,
0.09559453278779984,
0.0056643374264240265,
0.05564330890774727,
0.0014955045189708471,
-0.014262199401855469,
0.0471145398914814,
-0.06591299921274185,
-0.05078906565904617,
0.05074361711740494,
0.061548855155706406,
-0.01213765237480402,
-0.019007185474038124,
-0.1074686050415039,
-0.04999978095293045,
0.03591619431972504,
-0.003084458177909255,
0.04236062988638878,
0.021467287093400955,
0.014755728654563427,
0.019208034500479698,
0.0008904405985958874,
-0.005135916639119387,
0.025231583043932915,
-0.019812067970633507,
0.08352452516555786,
-0.0837365984916687,
0.10796595364809036,
0.01588352583348751,
0.06184622645378113,
0.05029815435409546,
-0.0039458912797272205,
0.021975236013531685,
-0.030332030728459358,
-0.005453160963952541,
-0.039581649005413055,
0.0006484421319328249,
-0.058847274631261826,
-0.08150497078895569,
0.04699716717004776,
-0.012142419815063477,
-6.828631882171976e-8,
-0.017512783408164978,
-0.04286187142133713,
-0.0681036114692688,
-0.014419053681194782,
0.05834374576807022,
0.08314108103513718,
-0.03263632580637932,
0.006053327117115259,
0.03826866298913956,
0.06129227578639984,
0.004848203621804714,
0.010022446513175964,
0.008938009850680828,
0.003419024869799614,
0.012577270157635212,
0.01599827967584133,
0.008169876411557198,
-0.08062079548835754,
-0.03834640607237816,
-0.10321737825870514,
0.005178626626729965,
-0.02812107466161251,
-0.022598901763558388,
0.12829269468784332,
0.05852919816970825,
-0.02005070634186268,
0.09076941013336182,
0.07673455029726028,
0.01114366389811039,
-0.10547223687171936,
-0.1499953269958496,
-0.048153433948755264,
-0.00078631064388901,
0.07478012144565582,
0.023385830223560333,
0.08223343640565872,
-0.05986710265278816,
0.08460695296525955,
-0.0363968126475811,
0.09969314187765121,
0.06315379589796066,
0.012896283529698849,
0.00932623352855444,
0.02262444607913494,
0.133240208029747,
0.09894272685050964,
-0.04461318626999855,
0.08956557512283325,
-0.07695447653532028,
-0.009538937360048294,
0.0031636476051062346,
-0.06104004383087158,
-0.046504996716976166,
0.05392086133360863,
0.04896870627999306,
-0.027043767273426056,
-0.04134507477283478,
-0.09095199406147003,
0.06816404312849045,
0.05879845470190048,
-0.015331919305026531,
0.06396663188934326,
-0.049385715276002884,
-0.010139900259673595
] | 0.256934
|
influence such as a firewall. It is important to configure your network to preserve long-lived idle connections between Elasticsearch nodes, for instance by leaving `tcp\_keep\_alive` enabled and ensuring that the keepalive interval is shorter than any timeout that might cause idle connections to be closed, or by setting `transport.ping\_schedule` if keepalives cannot be configured. [float] === Transport Tracer The transport module has a dedicated tracer logger which, when activated, logs incoming and out going requests. The log can be dynamically activated by settings the level of the `org.elasticsearch.transport.TransportService.tracer` logger to `TRACE`: [source,js] -------------------------------------------------- PUT \_cluster/settings { "transient" : { "logger.org.elasticsearch.transport.TransportService.tracer" : "TRACE" } } -------------------------------------------------- // CONSOLE You can also control which actions will be traced, using a set of include and exclude wildcard patterns. By default every request will be traced except for fault detection pings: [source,js] -------------------------------------------------- PUT \_cluster/settings { "transient" : { "transport.tracer.include" : "\*", "transport.tracer.exclude" : "internal:discovery/zen/fd\*" } } -------------------------------------------------- // CONSOLE
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/transport.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.05378888547420502,
0.04933815449476242,
0.030902216210961342,
0.10139237344264984,
0.07939878851175308,
-0.06211592257022858,
-0.04402271285653114,
-0.020351499319076538,
0.07524374127388,
0.02269684337079525,
-0.09424251317977905,
0.031431831419467926,
-0.04618842154741287,
0.0008852616883814335,
-0.04439050331711769,
-0.051301710307598114,
-0.03344570845365524,
-0.0673796534538269,
-0.05694882571697235,
-0.0077176643535494804,
0.04109300300478935,
0.028678329661488533,
-0.0314217247068882,
-0.006039322819560766,
-0.11160784214735031,
-0.021579263731837273,
-0.04914231598377228,
-0.06123139709234238,
0.03709704056382179,
0.04944615066051483,
-0.0980696901679039,
-0.07575242966413498,
-0.045467667281627655,
0.05887216702103615,
-0.06564609706401825,
0.04907211661338806,
0.037485845386981964,
0.0135860126465559,
-0.1254926472902298,
0.05173705518245697,
0.08714891970157623,
-0.009908325970172882,
-0.007262734230607748,
-0.09758628159761429,
-0.06746344268321991,
-0.1280701756477356,
0.015494108200073242,
-0.08504641801118851,
-0.0676354467868805,
0.06874249875545502,
-0.0036928090266883373,
-0.01094663143157959,
-0.004100463353097439,
0.01870177499949932,
-0.013168958947062492,
0.0853324607014656,
0.02600715495646,
-0.029886653646826744,
-0.050967734307050705,
-0.040647249668836594,
0.020953869447112083,
-0.03705897554755211,
-0.010191204957664013,
-0.04512502998113632,
0.009097623638808727,
0.009156121872365475,
0.10299214720726013,
0.026810791343450546,
0.08475280553102493,
0.05636623129248619,
0.03290564566850662,
-0.012774680741131306,
-0.0682966485619545,
-0.023368006572127342,
0.0984022319316864,
0.037396542727947235,
0.04448145627975464,
-0.015486786141991615,
0.06979555636644363,
0.010912677273154259,
-0.013249269686639309,
-0.09336583316326141,
-0.046639032661914825,
0.017214082181453705,
-0.07564301043748856,
-0.04453643411397934,
0.07725295424461365,
-0.08274897187948227,
0.09395749866962433,
-0.04242068529129028,
0.0009506536298431456,
-0.023263053968548775,
-0.04928584769368172,
-0.024375764653086662,
0.040712691843509674,
0.035627685487270355,
-0.038530122488737106,
0.09786630421876907,
0.022060707211494446,
-0.040530864149332047,
0.06140748783946037,
0.0038610331248492002,
-0.006372587755322456,
0.04098529741168022,
-0.007924637757241726,
-0.021349400281906128,
-0.01500274334102869,
0.0359368622303009,
0.02899002470076084,
0.042496636509895325,
0.08569777756929398,
0.036239102482795715,
0.07348310947418213,
0.07599150389432907,
0.004813552368432283,
0.13059882819652557,
-0.0026965741999447346,
-0.05488687381148338,
0.007462938781827688,
0.10812210291624069,
0.08712585270404816,
0.005969079211354256,
0.054749906063079834,
-0.08541804552078247,
0.06216368451714516,
0.08398275822401047,
-0.0034807429183274508,
1.5299214177940579e-33,
0.0008780302596278489,
-0.025796275585889816,
-0.06731905788183212,
-0.0132396025583148,
0.009656934067606926,
0.05814528092741966,
-0.020683852955698967,
0.05213429033756256,
-0.004130172077566385,
-0.03933567926287651,
-0.12951965630054474,
0.05793893709778786,
0.025047285482287407,
-0.019951771944761276,
0.03216533735394478,
0.014536470174789429,
0.10324422270059586,
-0.012788742780685425,
0.06054425612092018,
0.02549031935632229,
0.06078473851084709,
-0.10089758783578873,
-0.03701230138540268,
-0.01299144234508276,
-0.0005346718244254589,
0.01368220429867506,
-0.025952989235520363,
-0.042116280645132065,
-0.05697847530245781,
0.010954289697110653,
-0.006026234477758408,
0.011713972315192223,
-0.024887677282094955,
0.011812450364232063,
0.022808289155364037,
0.02931835874915123,
-0.05858062207698822,
0.07581814378499985,
0.02960115857422352,
-0.016191398724913597,
-0.01969708874821663,
-0.023044537752866745,
-0.05716380476951599,
0.003186448710039258,
-0.02032451517879963,
-0.06735438108444214,
-0.03159034624695778,
0.0001392289123032242,
0.038039740175008774,
0.009533786214888096,
-0.024895938113331795,
-0.029234090819954872,
0.020568635314702988,
-0.03522612899541855,
0.07031131535768509,
0.060951512306928635,
0.0254872664809227,
-0.04599452763795853,
-0.07364337146282196,
0.007276944350451231,
0.035423796623945236,
-0.05525750294327736,
0.10057199746370316,
0.018225781619548798,
0.10813980549573898,
0.06809034198522568,
0.05385128781199455,
0.0026793633587658405,
-0.06652214378118515,
0.005653849802911282,
0.016641488298773766,
0.009131831116974354,
0.06368311494588852,
-0.0006666165427304804,
-0.016707658767700195,
-0.06290236860513687,
-0.04279594123363495,
-0.008391357026994228,
-0.048422425985336304,
0.02901017665863037,
0.039257220923900604,
-0.06076715886592865,
0.0074893212877213955,
0.03856250271201134,
-0.03522002696990967,
-0.03281828761100769,
-0.013065746985375881,
0.020024897530674934,
-0.056968990713357925,
-0.021915296092629433,
-0.018339604139328003,
0.03427599370479584,
-0.016365911811590195,
-0.035445697605609894,
-0.06039360538125038,
-3.8420026339588576e-33,
-0.008823195472359657,
-0.012541829608380795,
-0.060379721224308014,
0.03888378664851189,
-0.019166897982358932,
0.026887597516179085,
0.0050266217440366745,
0.029422642663121223,
-0.055577635765075684,
-0.0043900809250772,
-0.009946106933057308,
-0.03778393566608429,
-0.03609677776694298,
-0.03793426230549812,
-0.0898365005850792,
0.015461990609765053,
0.03159145265817642,
-0.047342658042907715,
0.0058810231275856495,
-0.061811257153749466,
-0.013162575662136078,
-0.07057774066925049,
-0.08560879528522491,
0.02451711893081665,
-0.05583355203270912,
-0.05796698108315468,
-0.01761489361524582,
-0.04054287075996399,
-0.14393357932567596,
-0.0459911972284317,
-0.025042153894901276,
0.008189688436686993,
0.02766812965273857,
-0.01120731420814991,
0.004417205695062876,
0.08622807264328003,
-0.010912060737609863,
0.002647364977747202,
0.05449933186173439,
0.002971956040710211,
0.06393319368362427,
0.10415025055408478,
0.003945767413824797,
0.0019729016348719597,
0.002828823635354638,
0.043107982724905014,
-0.06169566884636879,
0.012320293113589287,
-0.0629032626748085,
0.010815208777785301,
-0.013743065297603607,
-0.039146967232227325,
0.06191234663128853,
0.08259471505880356,
-0.0495728999376297,
0.07844795286655426,
-0.03747447207570076,
0.04056341201066971,
-0.09055479615926743,
0.06452091038227081,
0.03457612544298172,
-0.024290993809700012,
-0.050151027739048004,
0.02488657273352146,
-0.005724044982343912,
-0.031787291169166565,
-0.006735559087246656,
-0.016206800937652588,
-0.046511679887771606,
0.00383960222825408,
0.03998015075922012,
0.010498430579900742,
0.00995747372508049,
0.0950060561299324,
-0.006667140871286392,
0.04490779712796211,
0.01052024308592081,
-0.058863475918769836,
-0.04178665205836296,
-0.014484947547316551,
-0.045740630477666855,
0.033324483782052994,
-0.04747142270207405,
-0.01582719385623932,
0.005562994629144669,
0.07580829411745071,
-0.027291586622595787,
0.07523827254772186,
0.0024056825786828995,
0.056599050760269165,
0.03163962811231613,
-0.07501110434532166,
-0.16506513953208923,
-0.045798659324645996,
-0.028633413836359978,
-5.686162296569819e-8,
0.02481568418443203,
0.03567426651716232,
-0.031549613922834396,
0.023586884140968323,
0.020839016884565353,
0.05323689803481102,
0.07422630488872528,
0.06965963542461395,
-0.05390416085720062,
0.04385291785001755,
-0.01076817512512207,
-0.01568697765469551,
-0.056630171835422516,
0.027635326609015465,
0.06937368959188461,
0.0030293473973870277,
0.023298073559999466,
-0.018565408885478973,
-0.05709080398082733,
-0.10304832458496094,
-0.04434417188167572,
-0.028819415718317032,
-0.06950633972883224,
0.08293335139751434,
0.00736569007858634,
-0.027784191071987152,
0.08504790812730789,
0.028693899512290955,
0.012651578523218632,
-0.03929884731769562,
-0.06454937905073166,
-0.004171226639300585,
-0.022872978821396828,
0.033901289105415344,
-0.08778377622365952,
0.09960997849702835,
-0.03582935407757759,
-0.031333863735198975,
-0.07444988936185837,
0.12611547112464905,
0.02644994854927063,
0.03299718350172043,
-0.030833793804049492,
-0.027392372488975525,
0.05849173665046692,
-0.003101921174675226,
-0.03701396286487579,
0.057161834090948105,
0.02494133450090885,
0.0014926230069249868,
-0.013986856676638126,
-0.06792133301496506,
0.00453335652127862,
0.05422396585345268,
0.050855014473199844,
-0.07936280220746994,
0.006250627804547548,
-0.05976445600390434,
0.06775255501270294,
0.08283711224794388,
0.017968682572245598,
-0.03783247619867325,
-0.07691532373428345,
-0.03741396591067314
] | 0.137348
|
[[modules-memcached]] == memcached The memcached module allows to expose \*Elasticsearch\* APIs over the memcached protocol (as closely as possible). It is provided as a plugin called `transport-memcached` and installing is explained https://github.com/elastic/elasticsearch-transport-memcached[here] . Another option is to download the memcached plugin and placing it under the `plugins` directory. The memcached protocol supports both the binary and the text protocol, automatically detecting the correct one to use. [float] === Mapping REST to Memcached Protocol Memcached commands are mapped to REST and handled by the same generic REST layer in Elasticsearch. Here is a list of the memcached commands supported: [float] ==== GET The memcached `GET` command maps to a REST `GET`. The key used is the URI (with parameters). The main downside is the fact that the memcached `GET` does not allow body in the request (and `SET` does not allow to return a result...). For this reason, most REST APIs (like search) allow to accept the "source" as a URI parameter as well. [float] ==== SET The memcached `SET` command maps to a REST `POST`. The key used is the URI (with parameters), and the body maps to the REST body. [float] ==== DELETE The memcached `DELETE` command maps to a REST `DELETE`. The key used is the URI (with parameters). [float] ==== QUIT The memcached `QUIT` command is supported and disconnects the client. [float] === Settings The following are the settings the can be configured for memcached: [cols="<,<",options="header",] |=============================================================== |Setting |Description |`memcached.port` |A bind port range. Defaults to `11211-11311`. |=============================================================== It also uses the common <>. [float] === Disable memcached The memcached module can be completely disabled and not started using by setting `memcached.enabled` to `false`. By default it is enabled once it is detected as a plugin.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/memcached.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.0011144669260829687,
0.09561727941036224,
-0.02754267118871212,
0.010799109004437923,
-0.03850243240594864,
-0.07010180503129959,
-0.04429607093334198,
0.03457343950867653,
0.05229142680764198,
0.0256905946880579,
-0.07729378342628479,
-0.026643047109246254,
0.008209054358303547,
0.021830402314662933,
-0.0032213882077485323,
-0.01730474829673767,
0.023259224370121956,
0.057688720524311066,
-0.021777275949716568,
0.01854512467980385,
0.0770968422293663,
0.10149570554494858,
-0.007532086223363876,
-0.042517032474279404,
-0.1353503316640854,
0.01828177459537983,
-0.03832526132464409,
0.010236036963760853,
0.021300150081515312,
0.022043248638510704,
-0.006479257717728615,
-0.09447076171636581,
0.0008178818970918655,
0.0600786954164505,
-0.035581257194280624,
0.09125999361276627,
0.010551721788942814,
-0.09878663718700409,
-0.09316608309745789,
0.011886104010045528,
0.028515789657831192,
-0.01052511390298605,
-0.0454130582511425,
-0.018198158591985703,
-0.014564367942512035,
-0.11464924365282059,
-0.014673923142254353,
0.0019254774088039994,
-0.062155041843652725,
0.043671492487192154,
-0.00369723211042583,
-0.06716648489236832,
-0.043719470500946045,
0.05827494338154793,
-0.014332303777337074,
0.023465313017368317,
-0.10777374356985092,
0.020715145394206047,
-0.0072177257388830185,
-0.062418196350336075,
0.08776602894067764,
-0.02624857798218727,
0.11478573083877563,
-0.010233715176582336,
-0.07974223047494888,
0.03869237005710602,
0.06159434840083122,
-0.016465555876493454,
0.09967285394668579,
-0.07232318073511124,
0.013311101123690605,
-0.08761566132307053,
-0.07086492329835892,
-0.011453350074589252,
0.09832537919282913,
0.060023628175258636,
0.04013719782233238,
-0.059206437319517136,
0.020404212176799774,
0.022955523803830147,
-0.03185325488448143,
-0.13638333976268768,
-0.016858605667948723,
0.03997232764959335,
-0.01010659709572792,
-0.029356107115745544,
0.05413796380162239,
-0.048821330070495605,
0.0519605316221714,
-0.016470473259687424,
-0.04487021267414093,
-0.11245177686214447,
-0.06631850451231003,
-0.09664740413427353,
0.0342070497572422,
0.0060571953654289246,
-0.05315452814102173,
0.12403513491153717,
-0.020705554634332657,
-0.04252820089459419,
0.008156578056514263,
-0.03468324989080429,
-0.06719952821731567,
-0.03869009390473366,
-0.017299825325608253,
-0.05901845917105675,
0.05696728825569153,
0.02395392768085003,
0.010013766586780548,
-0.01312339585274458,
-0.0255501177161932,
0.009150926023721695,
-0.009163151495158672,
-0.014216708950698376,
-0.01359517127275467,
0.12471950054168701,
0.005435793194919825,
-0.025129085406661034,
0.02250317856669426,
0.1470714658498764,
0.028301391750574112,
-0.0716337338089943,
0.04079648107290268,
-0.06937358528375626,
0.03927434980869293,
0.07199162244796753,
-0.021329740062355995,
4.980442831449334e-33,
0.0069771744310855865,
0.016003908589482307,
-0.005383813753724098,
-0.009305189363658428,
-0.049721524119377136,
0.03839011490345001,
0.006669194437563419,
0.03568639978766441,
-0.03503383696079254,
-0.08125881105661392,
-0.05438641086220741,
0.10696776956319809,
-0.006923881359398365,
0.022163541987538338,
-0.02177465707063675,
-0.010392001830041409,
0.027539150789380074,
-0.06976514309644699,
0.10135442018508911,
-0.0040019238367676735,
0.034773390740156174,
0.054612576961517334,
0.01676306501030922,
-0.07432782649993896,
0.021562853828072548,
0.00031341222347691655,
-0.0039628599770367146,
-0.03372623771429062,
-0.004149383399635553,
0.025347746908664703,
-0.031211208552122116,
0.02361886203289032,
-0.024368906393647194,
-0.016769906505942345,
0.00638493662700057,
0.01879977434873581,
-0.02991366758942604,
0.07696588337421417,
-0.06076294556260109,
-0.0020076099317520857,
0.014898783527314663,
0.002375977812334895,
-0.06534366309642792,
-0.08056885004043579,
-0.05926715210080147,
-0.05032375082373619,
-0.06955055892467499,
0.020862111821770668,
0.09970135241746902,
-0.06366060674190521,
0.021492987871170044,
0.0037796255201101303,
0.08083279430866241,
-0.06313116103410721,
0.06661763787269592,
-0.034045979380607605,
-0.0022548201959580183,
0.01328330673277378,
-0.016441524028778076,
0.053286656737327576,
0.017159517854452133,
-0.026705561205744743,
0.11607597023248672,
0.06311257183551788,
0.04682772979140282,
0.040175508707761765,
0.0201241634786129,
0.06667256355285645,
0.013928668573498726,
0.022011402994394302,
0.026157882064580917,
-0.01343882828950882,
0.025921694934368134,
0.033885981887578964,
-0.04768767207860947,
-0.024847645312547684,
0.03659394010901451,
-0.02194642275571823,
0.013992716558277607,
0.033970125019550323,
0.07392682135105133,
-0.027514951303601265,
0.010037416592240334,
0.028668753802776337,
-0.008775024674832821,
0.005226335022598505,
-0.03766283020377159,
-0.003851014655083418,
0.07897723466157913,
-0.021428193897008896,
-0.02772490680217743,
-0.002469592494890094,
0.006643394473940134,
-0.023313170298933983,
-0.05232353135943413,
-7.105985308259626e-33,
-0.004648942966014147,
-0.016893727704882622,
-0.0664171651005745,
0.08772208541631699,
-0.01782437227666378,
0.007998964749276638,
0.07982480525970459,
0.0070497384294867516,
0.0110911400988698,
-0.015376975759863853,
-0.011503440327942371,
-0.03979198634624481,
-0.0416937917470932,
-0.0440041720867157,
-0.06396589428186417,
0.031752925366163254,
-0.09087690711021423,
-0.1110275387763977,
0.024127453565597534,
-0.013393573462963104,
-0.1203695610165596,
-0.04775321111083031,
-0.04175470769405365,
0.029281575232744217,
-0.06796136498451233,
0.006645259913057089,
0.05626799538731575,
-0.03817002847790718,
-0.051856741309165955,
-0.06795559078454971,
-0.03198467940092087,
0.006956454832106829,
0.02097315341234207,
-0.029798250645399094,
-0.07672145217657089,
0.04546770825982094,
0.04052509367465973,
0.06999250501394272,
0.023288052529096603,
-0.036391451954841614,
0.08496378362178802,
0.02139578014612198,
-0.01949337311089039,
0.013360916636884212,
0.012833933345973492,
0.0027416804805397987,
-0.048077598214149475,
0.002788684330880642,
-0.0314803384244442,
-0.016401799395680428,
-0.03342650830745697,
-0.045044898986816406,
-0.06484656780958176,
0.030932964757084846,
-0.00589674012735486,
0.042446430772542953,
-0.02424764819443226,
0.057995375245809555,
-0.015654947608709335,
0.039033979177474976,
-0.021588310599327087,
-0.0517159104347229,
0.005640888586640358,
0.015443487092852592,
-0.013215004466474056,
-0.008684137836098671,
-0.03206244856119156,
-0.15131819248199463,
-0.14276868104934692,
0.01264745369553566,
-0.008863817900419235,
-0.058283500373363495,
0.06814592331647873,
0.056288428604602814,
0.11433293670415878,
-0.002379121957346797,
0.0017173455562442541,
-0.030637361109256744,
0.012898504734039307,
-0.013762307353317738,
-0.01742495223879814,
0.04085957631468773,
-0.04473543167114258,
0.05221882089972496,
-0.025865180417895317,
0.039694588631391525,
-0.020711755380034447,
0.054944366216659546,
-0.014541578479111195,
-0.01076088659465313,
0.040010303258895874,
0.014374407939612865,
-0.13475872576236725,
-0.04008297622203827,
0.02633630484342575,
-5.641424039026788e-8,
0.06367984414100647,
-0.07457636296749115,
0.04177933558821678,
0.09610851854085922,
0.014997216872870922,
0.0999545231461525,
0.031045399606227875,
0.04908636212348938,
0.015982063487172127,
0.031753383576869965,
0.02009332925081253,
-0.018159840255975723,
-0.03804172948002815,
-0.030530637130141258,
-0.0037981723435223103,
0.03128577768802643,
0.04042176157236099,
0.02368859574198723,
-0.0211201012134552,
-0.06420397758483887,
-0.1181882694363594,
0.013681598007678986,
0.04220416396856308,
0.021708671003580093,
0.11435374617576599,
-0.004216436296701431,
-0.018935956060886383,
0.06659848242998123,
-0.019115330651402473,
-0.04705323651432991,
-0.04748687520623207,
-0.04647830128669739,
0.028577087447047234,
-0.028389250859618187,
-0.0650625005364418,
0.03834068030118942,
-0.04794031381607056,
0.04882993549108505,
-0.060707587748765945,
0.05833292752504349,
0.039443489164114,
0.042841311544179916,
-0.03709280490875244,
-0.0033472946379333735,
0.04460024833679199,
0.03883422538638115,
0.004512185696512461,
0.08617157489061356,
-0.04768045246601105,
0.06421253085136414,
0.03979482501745224,
-0.10247170925140381,
0.03693283721804619,
0.07482817023992538,
-0.011356103233993053,
0.029138866811990738,
-0.003969190642237663,
-0.05584883689880371,
0.0855313315987587,
0.0942608118057251,
0.05412352457642555,
-0.029689455404877663,
-0.004720163531601429,
-0.04100552573800087
] | 0.160759
|
[[modules-indices]] == Indices The indices module controls index-related settings that are globally managed for all indices, rather than being configurable at a per-index level. Available settings include: <>:: Circuit breakers set limits on memory usage to avoid out of memory exceptions. <>:: Set limits on the amount of heap used by the in-memory fielddata cache. <>:: Configure the amount heap used to cache queries results. <>:: Control the size of the buffer allocated to the indexing process. <>:: Control the behaviour of the shard-level request cache. <>:: Control the resource limits on the shard recovery process. include::indices/circuit\_breaker.asciidoc[] include::indices/fielddata.asciidoc[] include::indices/query\_cache.asciidoc[] include::indices/indexing\_buffer.asciidoc[] include::indices/request\_cache.asciidoc[] include::indices/recovery.asciidoc[]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/indices.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.06204254925251007,
0.03170212730765343,
-0.06279420107603073,
0.060432612895965576,
-0.024569997563958168,
-0.03939396142959595,
0.014309997670352459,
-0.0012717214412987232,
0.01759997196495533,
-0.028526462614536285,
-0.004604071378707886,
0.02787162736058235,
-0.01749318651854992,
-0.014800040982663631,
-0.04940197616815567,
-0.005244798492640257,
0.014533814042806625,
0.004409485030919313,
-0.06949273496866226,
0.014818603172898293,
0.0787964016199112,
0.042563967406749725,
0.03339725360274315,
-0.008288893848657608,
-0.08047893643379211,
0.0006529010715894401,
-0.03689973056316376,
-0.0015098139410838485,
-0.004550571087747812,
-0.054414696991443634,
0.005960094276815653,
0.010769465006887913,
-0.033580414950847626,
0.013105088844895363,
0.01731395535171032,
0.10070624202489853,
-0.07689310610294342,
-0.047916896641254425,
-0.02941802516579628,
-0.04339207336306572,
-0.017954491078853607,
0.06934620440006256,
-0.07149168848991394,
0.013524508103728294,
-0.012009858153760433,
-0.008014076389372349,
-0.017291370779275894,
-0.038204990327358246,
-0.003679841523990035,
-0.0436893105506897,
-0.03954414650797844,
0.022441433742642403,
0.0172385573387146,
0.0070739625953137875,
0.02038421295583248,
0.0028954483568668365,
-0.113913893699646,
-0.020573092624545097,
0.0016112392768263817,
0.009753795340657234,
-0.007622451987117529,
-0.018814966082572937,
-0.006198244169354439,
-0.07420878112316132,
-0.030231928452849388,
-0.025433681905269623,
0.12914438545703888,
-0.07778920978307724,
0.03793582320213318,
-0.014651014469563961,
-0.05858122557401657,
0.04755653068423271,
-0.1090092733502388,
0.04539760574698448,
0.029945112764835358,
0.10255678743124008,
-0.041530441492795944,
-0.01100908312946558,
0.025318516418337822,
-0.1252455711364746,
-0.061357248574495316,
-0.05750681832432747,
0.12021557241678238,
-0.020418211817741394,
-0.00037933108978904784,
-0.02515251375734806,
0.039496514946222305,
-0.01703946851193905,
0.07478976249694824,
-0.02436685375869274,
0.08034633100032806,
0.0005622520693577826,
0.020513363182544708,
-0.004917205777019262,
0.08239054679870605,
0.005067907273769379,
0.03784776106476784,
0.11943540722131729,
-0.028668703511357307,
0.019572187215089798,
0.05506431311368942,
0.005167210940271616,
-0.02589314430952072,
0.09417936205863953,
0.009380576200783253,
-0.01256937813013792,
0.05457740277051926,
0.04583312198519707,
-0.06729378551244736,
-0.016200758516788483,
0.06215891242027283,
0.05301954597234726,
0.017609627917408943,
-0.035031210631132126,
0.0658092200756073,
0.08590711653232574,
0.003338889917358756,
-0.025893116369843483,
-0.023193588480353355,
0.0873689278960228,
0.012784949503839016,
-0.01764509081840515,
-0.0014730184338986874,
-0.004508394282311201,
-0.03766609728336334,
0.0512503907084465,
-0.0953775942325592,
7.132759396151511e-33,
0.049730025231838226,
0.03218311071395874,
-0.03721430152654648,
-0.032101280987262726,
-0.019665684551000595,
0.021910138428211212,
0.003357577370479703,
0.03846890851855278,
-0.03383882716298103,
-0.008890697732567787,
-0.04563452675938606,
0.017895512282848358,
-0.0069854240864515305,
-0.01710076630115509,
0.04920125752687454,
-0.0652414858341217,
0.06682614982128143,
0.02110961452126503,
0.05132940039038658,
-0.039909277111291885,
0.04781099036335945,
0.020858386531472206,
0.03357619047164917,
0.03362790495157242,
-0.032268207520246506,
0.061976946890354156,
-0.008778628893196583,
-0.04732559248805046,
-0.02632504142820835,
0.010841989889740944,
0.026035163551568985,
0.004275932442396879,
0.011632301844656467,
-0.014737720601260662,
0.06012843921780586,
0.026797784492373466,
-0.0034702098928391933,
0.030114872381091118,
-0.03873059153556824,
-0.07108615338802338,
0.008164368569850922,
0.03654700145125389,
0.01884763315320015,
-0.06426128000020981,
-0.15162409842014313,
-0.050643518567085266,
-0.050728004425764084,
0.014069952070713043,
-0.006850230507552624,
0.01668546162545681,
-0.03948788717389107,
0.03917437419295311,
0.028946179896593094,
0.0448627844452858,
0.06267967075109482,
-0.015894996002316475,
0.03630220144987106,
-0.015671515837311745,
0.01428303960710764,
0.1349315196275711,
-0.006238819099962711,
-0.024431562051177025,
0.026645641773939133,
0.08540623635053635,
-0.0311878751963377,
0.039805471897125244,
-0.015675319358706474,
0.07096889615058899,
0.02431579865515232,
0.06344680488109589,
-0.06480145454406738,
0.04119773209095001,
0.03394148126244545,
-0.011983096599578857,
-0.08007539808750153,
-0.04828251898288727,
-0.049000851809978485,
-0.09437774121761322,
-0.10644032806158066,
-0.04851623252034187,
-0.04629804566502571,
-0.0205719955265522,
0.00323572289198637,
-0.06525237113237381,
-0.021847940981388092,
-0.048023298382759094,
0.0267180148512125,
-0.013561230152845383,
-0.048937488347291946,
-0.06974712014198303,
-0.05095367878675461,
0.005202035885304213,
0.04892928525805473,
-0.07992193102836609,
-0.09086459875106812,
-7.423510576987711e-33,
0.0703439712524414,
-0.12727683782577515,
-0.037334781140089035,
0.04641370102763176,
-0.008893833495676517,
-0.011351845227181911,
0.06777730584144592,
-0.013413454405963421,
-0.035608209669589996,
-0.07515442371368408,
0.010222340933978558,
0.018541140481829643,
0.08022711426019669,
-0.024682778865098953,
-0.04417581483721733,
0.08269020169973373,
-0.08771590143442154,
-0.081122487783432,
0.04106126353144646,
0.045029908418655396,
-0.11426807940006256,
0.07663945853710175,
0.044244054704904556,
0.0668380856513977,
-0.09227848052978516,
0.007600873243063688,
-0.025211289525032043,
-0.024143196642398834,
0.02180374041199684,
-0.03151113539934158,
0.02406509965658188,
-0.00451976153999567,
-0.0435321182012558,
-0.036298349499702454,
-0.03929218649864197,
-0.013348966836929321,
0.028803911060094833,
-0.021052083000540733,
-0.025161780416965485,
0.10413873195648193,
0.1013684794306755,
0.03355612978339195,
-0.04402868077158928,
0.05787217244505882,
0.02305835299193859,
-0.01128854788839817,
-0.042173221707344055,
0.03983427956700325,
-0.010450691916048527,
-0.05385182797908783,
0.027670446783304214,
-0.10717073827981949,
0.08632932603359222,
0.06630078703165054,
0.03478248417377472,
0.046026844531297684,
0.037285782396793365,
0.042117420583963394,
-0.08417553454637527,
0.019364867359399796,
0.01213961374014616,
-0.06792489439249039,
-0.062390584498643875,
-0.06924911588430405,
0.04146374389529228,
0.024337979033589363,
-0.055579718202352524,
-0.07330603897571564,
0.055637214332818985,
-0.01420426182448864,
-0.042668793350458145,
-0.013220580294728279,
-0.013321342878043652,
0.026204705238342285,
0.0020954252686351538,
-0.020532723516225815,
-0.033776070922613144,
0.02473449520766735,
0.06553959101438522,
0.054056327790021896,
-0.05544561892747879,
0.07863540202379227,
-0.016631148755550385,
-0.040946491062641144,
0.046977557241916656,
-0.09938797354698181,
-0.037967029958963394,
0.10017792135477066,
-0.06491125375032425,
0.012557530775666237,
-0.03499138355255127,
-0.05196284502744675,
-0.015685612335801125,
0.023873988538980484,
-0.00524430675432086,
-5.316436357816201e-8,
0.036142364144325256,
0.013602732680737972,
-0.03344913572072983,
0.08722064644098282,
0.12668152153491974,
-0.07918247580528259,
0.025642283260822296,
0.019806718453764915,
-0.029914211481809616,
0.026748226955533028,
0.08526484668254852,
0.029337381944060326,
-0.056797660887241364,
0.006074585486203432,
0.022318318486213684,
-0.015117861330509186,
-0.010090415365993977,
0.05828090012073517,
-0.02057129703462124,
-0.11104601621627808,
-0.06870615482330322,
-0.011835112236440182,
-0.01591903157532215,
0.028370751067996025,
0.07953746616840363,
-0.0380452498793602,
0.11505919694900513,
0.03397214785218239,
-0.0126860486343503,
0.0049318308010697365,
-0.023966843262314796,
-0.0571933351457119,
0.08557607978582382,
-0.09109102189540863,
0.029644828289747238,
0.07338558882474899,
-0.062453050166368484,
0.005370217841118574,
0.0683867409825325,
0.06328003108501434,
-0.0436541922390461,
0.0003517009608913213,
0.009427488781511784,
0.01215669047087431,
-0.012028415687382221,
0.0035092986654490232,
-0.1120295524597168,
0.0971459299325943,
0.028857342898845673,
0.024919668212532997,
-0.031987644731998444,
0.011114588007330894,
0.026888588443398476,
0.09197523444890976,
0.002903940388932824,
0.017027603462338448,
0.002811097539961338,
-0.0052852691151201725,
0.05213814973831177,
0.030479835346341133,
0.1239023506641388,
-0.05338640138506889,
-0.04853975027799606,
-0.11812224984169006
] | 0.135473
|
[[modules-tribe]] == Tribe node deprecated[5.4.0,The `tribe` node is deprecated in favour of <> and will be removed in Elasticsearch 7.0.] The \_tribes\_ feature allows a \_tribe node\_ to act as a federated client across multiple clusters. The tribe node works by retrieving the cluster state from all connected clusters and merging them into a global cluster state. With this information at hand, it is able to perform read and write operations against the nodes in all clusters as if they were local. Note that a tribe node needs to be able to connect to each single node in every configured cluster. The `elasticsearch.yml` config file for a tribe node just needs to list the clusters that should be joined, for instance: [source,yaml] -------------------------------- tribe: t1: <1> cluster.name: cluster\_one t2: <1> cluster.name: cluster\_two -------------------------------- <1> `t1` and `t2` are arbitrary names representing the connection to each cluster. The example above configures connections to two clusters, name `t1` and `t2` respectively. The tribe node will create a <> to connect each cluster using <> by default. Any other settings for the connection can be configured under `tribe.{name}`, just like the `cluster.name` in the example. The merged global cluster state means that almost all operations work in the same way as a single cluster: distributed search, suggest, percolation, indexing, etc. However, there are a few exceptions: \* The merged view cannot handle indices with the same name in multiple clusters. By default it will pick one of them, see later for on\_conflict options. \* Master level read operations (eg <>, <>) will automatically execute with a local flag set to true since there is no master. \* Master level write operations (eg <>) are not allowed. These should be performed on a single cluster. The tribe node can be configured to block all write operations and all metadata operations with: [source,yaml] -------------------------------- tribe: blocks: write: true metadata: true -------------------------------- The tribe node can also configure blocks on selected indices: [source,yaml] -------------------------------- tribe: blocks: write.indices: hk\*,ldn\* metadata.indices: hk\*,ldn\* -------------------------------- When there is a conflict and multiple clusters hold the same index, by default the tribe node will pick one of them. This can be configured using the `tribe.on\_conflict` setting. It defaults to `any`, but can be set to `drop` (drop indices that have a conflict), or `prefer\_[tribeName]` to prefer the index from a specific tribe. [float] === Tribe node settings The tribe node starts a node client for each listed cluster. The following configuration options are passed down from the tribe node to each node client: \* `node.name` (used to derive the `node.name` for each node client) \* `network.host` \* `network.bind\_host` \* `network.publish\_host` \* `transport.host` \* `transport.bind\_host` \* `transport.publish\_host` \* `path.home` \* `path.logs` \* `shield.\*` Almost any setting (except for `path.\*`) may be configured at the node client level itself, in which case it will override any passed through setting from the tribe node. Settings you may want to set at the node client level include: \* `network.host` \* `network.bind\_host` \* `network.publish\_host` \* `transport.host` \* `transport.bind\_host` \* `transport.publish\_host` \* `cluster.name` \* `discovery.zen.ping.unicast.hosts` [source,yaml] ------------------------ network.host: 192.168.1.5 <1> tribe: t1: cluster.name: cluster\_one t2: cluster.name: cluster\_two network.host: 10.1.2.3 <2> ------------------------ <1> The `network.host` setting is inherited by `t1`. <2> The `t3` node client overrides the inherited from the tribe node.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/tribe.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.0618567131459713,
0.019552472978830338,
-0.014096627943217754,
0.07715357095003128,
0.018390221521258354,
-0.04775884747505188,
-0.06484830379486084,
-0.07843023538589478,
-0.031322892755270004,
0.02879474312067032,
-0.034942321479320526,
-0.08836903423070908,
0.021720023825764656,
-0.0032310106325894594,
-0.01053495891392231,
0.014926738105714321,
-0.06638094782829285,
0.0005466973525471985,
0.022980408743023872,
-0.031183814629912376,
0.024967726320028305,
0.07785554230213165,
0.015862073749303818,
0.011795108206570148,
-0.053516991436481476,
-0.02883273921906948,
-0.09061875194311142,
-0.032160982489585876,
0.05186920985579491,
0.02772199548780918,
-0.035449374467134476,
0.024232182651758194,
0.016642127186059952,
0.11200770735740662,
-0.04241444170475006,
0.12387518584728241,
-0.0009214297169819474,
-0.02968611940741539,
-0.11099623888731003,
-0.03446772322058678,
0.14450594782829285,
0.03196999058127403,
-0.029091408476233482,
-0.10757282376289368,
-0.046807970851659775,
-0.06870859861373901,
-0.0533921904861927,
0.005036692135035992,
-0.0795731246471405,
0.06315577775239944,
0.0058524212799966335,
-0.10488520562648773,
-0.01073902752250433,
0.03137163072824478,
0.015323000960052013,
0.01703333854675293,
-0.057882726192474365,
-0.03980514034628868,
-0.004173668101429939,
-0.05706372857093811,
0.09796730428934097,
-0.022459544241428375,
0.00894167274236679,
-0.053322479128837585,
0.00019786659686360508,
0.0509413480758667,
0.013546916656196117,
-0.006791085936129093,
0.05138600617647171,
-0.05737672373652458,
0.09931539744138718,
-0.020784299820661545,
0.002782809780910611,
-0.009870093315839767,
0.026386573910713196,
0.06834883242845535,
0.03689059242606163,
0.04542935639619827,
-0.012577962130308151,
-0.019310522824525833,
-0.0492669939994812,
-0.03827231749892235,
0.03671650215983391,
-0.05065242201089859,
-0.052608758211135864,
-0.02521415613591671,
0.018162889406085014,
-0.12228383123874664,
0.04568285867571831,
-0.027920793741941452,
-0.015221047215163708,
-0.060893259942531586,
-0.011129867285490036,
-0.08062445372343063,
0.032376475632190704,
-0.00592033052816987,
0.006574671715497971,
0.11017709225416183,
0.04460014030337334,
0.004584203939884901,
0.01761462353169918,
-0.03184368461370468,
-0.035886116325855255,
-0.033863309770822525,
-0.060686178505420685,
-0.03237871825695038,
-0.045086540281772614,
-0.008147455751895905,
0.020605720579624176,
0.03461947664618492,
0.019929340109229088,
0.09319563210010529,
0.0048294407315552235,
0.04230506718158722,
-0.043267104774713516,
0.025610852986574173,
0.028452331200242043,
0.006386330351233482,
0.02536294423043728,
0.1304202675819397,
-0.002091190544888377,
-0.02614840678870678,
-0.002505420008674264,
-0.04985041543841362,
0.05640653148293495,
-0.01052939798682928,
-0.07495799660682678,
4.836156042673683e-33,
0.051668353378772736,
-0.04944777116179466,
-0.05785243958234787,
-0.021793510764837265,
0.033333536237478256,
0.028485825285315514,
0.033481091260910034,
-0.027109269052743912,
-0.12167861312627792,
-0.07796099781990051,
-0.08525270223617554,
0.0931994616985321,
0.07496829330921173,
-0.024513335898518562,
-0.01758120022714138,
-0.014278687536716461,
0.03931012004613876,
-0.06181147322058678,
0.09879478067159653,
0.05579739436507225,
0.08116371929645538,
0.013655225746333599,
-0.05384557694196701,
0.014131749048829079,
-0.10591036081314087,
-0.004181671887636185,
-0.007355470675975084,
-0.08855045586824417,
0.009694398380815983,
0.044400691986083984,
-0.09709406644105911,
0.022924691438674927,
-0.0036821288522332907,
0.05288763344287872,
-0.014882167801260948,
0.018074586987495422,
0.013654319569468498,
0.022907663136720657,
-0.05877014249563217,
-0.00479693990200758,
0.0162366796284914,
-0.003972816746681929,
-0.010689971968531609,
-0.059708163142204285,
-0.022329386323690414,
-0.005953332409262657,
-0.04358772560954094,
0.055256523191928864,
0.1021166741847992,
-0.018490653485059738,
-0.06966283172369003,
-0.03941968455910683,
0.04567618668079376,
-0.053326815366744995,
0.07244399189949036,
0.03556567057967186,
0.017856430262327194,
0.05211985483765602,
-0.022729676216840744,
-0.0019462479976937175,
-0.006557480897754431,
-0.025151370093226433,
0.04049297794699669,
0.04537675529718399,
0.02147500403225422,
0.053176555782556534,
0.05392003804445267,
0.05195700004696846,
0.028333185240626335,
-0.029949158430099487,
0.0032582953572273254,
0.07166159152984619,
0.0036944961175322533,
0.066557876765728,
-0.02284659631550312,
-0.04841279610991478,
0.06007092446088791,
-0.04134092479944229,
-0.014695333316922188,
0.03871452435851097,
-0.03461351618170738,
-0.03198593482375145,
-0.08429193496704102,
0.08507982641458511,
-0.03483496233820915,
-0.058235663920640945,
-0.03430154174566269,
0.014370588585734367,
-0.03869444131851196,
-0.05509050190448761,
0.04399046301841736,
0.0045883008278906345,
0.01909380778670311,
-0.06762394309043884,
-0.0034374853130429983,
-5.7072091115765065e-33,
0.0193628016859293,
-0.022003188729286194,
0.017049381509423256,
-0.0019399168668314815,
-0.027580229565501213,
-0.06699232012033463,
-0.007145098876208067,
-0.02570737712085247,
-0.04501179978251457,
0.03673099726438522,
-0.0022332658991217613,
-0.05429654195904732,
0.033076994121074677,
-0.02426563948392868,
-0.11911582946777344,
0.062073417007923126,
0.020084362477064133,
-0.0703013688325882,
0.060686495155096054,
-0.025070665404200554,
-0.045798759907484055,
0.0023901795502752066,
-0.05476757884025574,
0.07712354511022568,
0.03106781281530857,
-0.033132728189229965,
-0.04890431463718414,
0.003267274470999837,
-0.07766637951135635,
-0.06881386041641235,
-0.03038853034377098,
-0.04394529014825821,
0.02528301067650318,
-0.008990663103759289,
-0.07011091709136963,
0.028678366914391518,
-0.013457652181386948,
-0.02211303822696209,
0.049478936940431595,
-0.045653440058231354,
0.03683613985776901,
0.08640750497579575,
-0.08399013429880142,
-0.005969138815999031,
0.023782506585121155,
0.04419334605336189,
0.015375797636806965,
0.05657701939344406,
-0.08267000317573547,
0.012453950010240078,
0.00168598722666502,
0.005395169835537672,
0.01620047353208065,
0.02116817608475685,
-0.05643278732895851,
0.006734801921993494,
0.061804696917533875,
0.06629345566034317,
-0.06258378177881241,
0.017188141122460365,
0.05127521604299545,
-0.08004667609930038,
0.003053863998502493,
0.07832717895507812,
0.01470026932656765,
-0.07022937387228012,
0.019410990178585052,
-0.027598794549703598,
-0.029626140370965004,
0.031739454716444016,
-0.06721871346235275,
0.01092507317662239,
0.00852709636092186,
0.03627180680632591,
0.07526296377182007,
0.044709257781505585,
-0.016262097284197807,
-0.019986381754279137,
-0.016186947003006935,
-0.006089240778237581,
-0.07483195513486862,
0.034105513244867325,
-0.006525277625769377,
0.03495747968554497,
0.08489476889371872,
0.06755252927541733,
0.042880792170763016,
0.18968595564365387,
0.008754471316933632,
0.11080673336982727,
0.02248816378414631,
-0.041389502584934235,
-0.09185377508401871,
-0.016074370592832565,
-0.012768168933689594,
-5.6239386481138354e-8,
-0.027247389778494835,
0.04693404585123062,
-0.13610857725143433,
0.024599717929959297,
0.02112516015768051,
0.07887308299541473,
0.048055827617645264,
0.06913241744041443,
-0.04125814512372017,
0.052271768450737,
-0.015042744576931,
0.010619447566568851,
-0.05904235318303108,
-0.00568587938323617,
0.04817960411310196,
-0.03610238432884216,
0.10527248680591583,
0.02457200177013874,
-0.05083084478974342,
-0.04002015292644501,
-0.0007450688863173127,
-0.05524985492229462,
-0.003607620019465685,
0.07761205732822418,
0.024153439328074455,
-0.029779087752103806,
-0.03166825324296951,
0.017411835491657257,
-0.004699438810348511,
-0.08364374935626984,
-0.10234415531158447,
-0.029667584225535393,
-0.035547733306884766,
0.03169070929288864,
-0.057104744017124176,
0.046266406774520874,
-0.03128824383020401,
0.08872468024492264,
-0.015726860612630844,
0.11804228276014328,
0.07022228837013245,
0.012528127990663052,
-0.07385850697755814,
0.036226049065589905,
0.006623213179409504,
-0.016667772084474564,
0.0023598703555762768,
0.05309750884771347,
0.07062382996082306,
-0.01108638197183609,
0.014791229739785194,
-0.02115699090063572,
-0.02496502175927162,
0.08697912842035294,
0.02769402787089348,
-0.04627493768930435,
-0.08305615186691284,
0.018717272207140923,
0.10056520998477936,
-0.002318807877600193,
0.02032170630991459,
-0.006126900669187307,
-0.027889246121048927,
-0.07111608982086182
] | 0.15127
|
[[modules-node]] == Node Any time that you start an instance of Elasticsearch, you are starting a \_node\_. A collection of connected nodes is called a <>. If you are running a single node of Elasticsearch, then you have a cluster of one node. Every node in the cluster can handle <> and <> traffic by default. The transport layer is used exclusively for communication between nodes and the {javaclient}/transport-client.html[Java `TransportClient`]; the HTTP layer is used only by external REST clients. All nodes know about all the other nodes in the cluster and can forward client requests to the appropriate node. Besides that, each node serves one or more purpose: <>:: A node that has `node.master` set to `true` (default), which makes it eligible to be <>, which controls the cluster. <>:: A node that has `node.data` set to `true` (default). Data nodes hold data and perform data related operations such as CRUD, search, and aggregations. <>:: A node that has `node.ingest` set to `true` (default). Ingest nodes are able to apply an <> to a document in order to transform and enrich the document before indexing. With a heavy ingest load, it makes sense to use dedicated ingest nodes and to mark the master and data nodes as `node.ingest: false`. <>:: A tribe node, configured via the `tribe.\*` settings, is a special type of coordinating only node that can connect to multiple clusters and perform search and other operations across all connected clusters. By default a node is a master-eligible node and a data node, plus it can pre-process documents through ingest pipelines. This is very convenient for small clusters but, as the cluster grows, it becomes important to consider separating dedicated master-eligible nodes from dedicated data nodes. [NOTE] [[coordinating-node]] .Coordinating node =============================================== Requests like search requests or bulk-indexing requests may involve data held on different data nodes. A search request, for example, is executed in two phases which are coordinated by the node which receives the client request -- the \_coordinating node\_. In the \_scatter\_ phase, the coordinating node forwards the request to the data nodes which hold the data. Each data node executes the request locally and returns its results to the coordinating node. In the \_gather\_ phase, the coordinating node reduces each data node's results into a single global resultset. Every node is implicitly a coordinating node. This means that a node that has all three `node.master`, `node.data` and `node.ingest` set to `false` will only act as a coordinating node, which cannot be disabled. As a result, such a node needs to have enough memory and CPU in order to deal with the gather phase. =============================================== [float] [[master-node]] === Master Eligible Node The master node is responsible for lightweight cluster-wide actions such as creating or deleting an index, tracking which nodes are part of the cluster, and deciding which shards to allocate to which nodes. It is important for cluster health to have a stable master node. Any master-eligible node (all nodes by default) may be elected to become the master node by the <>. IMPORTANT: Master nodes must have access to the `data/` directory (just like `data` nodes) as this is where the cluster state is persisted between node restarts. Indexing and searching your data is CPU-, memory-, and I/O-intensive work which can put pressure on a node's resources. To ensure that your master node is stable and not under pressure, it is a good idea in a bigger cluster to split the roles between dedicated master-eligible nodes and dedicated data nodes. While master nodes can also behave as <> and route search and indexing requests
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/node.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.016525164246559143,
0.01949455961585045,
-0.02165931835770607,
0.040807198733091354,
0.043555255979299545,
0.02325848862528801,
-0.013890459202229977,
-0.0059892525896430016,
0.06386160850524902,
-0.009123764000833035,
-0.04615513235330582,
-0.007128966972231865,
0.042445313185453415,
-0.03020583838224411,
-0.0013390303356572986,
-0.07917110621929169,
0.056789059191942215,
0.03593358397483826,
0.021199746057391167,
-0.03703540191054344,
0.03147793561220169,
0.04061853885650635,
0.017595643177628517,
-0.07638956606388092,
-0.08533717691898346,
0.04039623960852623,
-0.07813769578933716,
-0.006889046635478735,
0.06643691658973694,
0.004111369140446186,
-0.02011910267174244,
-0.01530478335916996,
-0.004785127472132444,
0.12226739525794983,
-0.18987993896007538,
0.12133658677339554,
0.027196042239665985,
-0.055914346128702164,
-0.1263275444507599,
0.054643310606479645,
0.042757585644721985,
-0.00493463734164834,
-0.07011788338422775,
-0.059940069913864136,
-0.047138143330812454,
-0.07880423963069916,
-0.07729682326316833,
-0.0051363687962293625,
-0.07731766998767853,
0.004702200647443533,
0.015984637662768364,
-0.04554617032408714,
-0.05519904941320419,
0.04929947853088379,
-0.021598361432552338,
0.0657079741358757,
-0.054252512753009796,
-0.017150361090898514,
-0.020153578370809555,
0.004216499626636505,
0.0545494370162487,
-0.042934663593769073,
0.04341401532292366,
0.0022056549787521362,
0.02042856253683567,
-0.05073736608028412,
0.02669575624167919,
0.0005711734993383288,
0.11557750403881073,
-0.055894020944833755,
0.04268242418766022,
-0.006891559809446335,
-0.04375605285167694,
-0.00769510492682457,
0.04242980107665062,
-0.03420982509851456,
0.04537874832749367,
0.05867554247379303,
0.016720810905098915,
0.031135015189647675,
-0.01482232753187418,
-0.005796336103230715,
-0.04902609810233116,
0.03758956119418144,
-0.09226541966199875,
-0.001316224574111402,
0.0005051635089330375,
-0.07283858209848404,
0.0062841433100402355,
0.0423634871840477,
-0.01286352425813675,
-0.06537080556154251,
-0.04554121196269989,
-0.021753694862127304,
0.01912379078567028,
0.04700931906700134,
-0.06783191114664078,
0.050611529499292374,
0.03332812711596489,
-0.022256942465901375,
0.0632597804069519,
-0.024434849619865417,
0.01884409971535206,
-0.04420572891831398,
-0.04233987256884575,
-0.05111687257885933,
-0.07920468598604202,
0.07847632467746735,
0.03850919008255005,
0.009668312966823578,
0.002818899927660823,
0.024910319596529007,
-0.0009407545439898968,
-0.02327565848827362,
-0.057674847543239594,
0.03334342688322067,
0.015486800111830235,
-0.0227335374802351,
0.02265411801636219,
0.12940287590026855,
-0.006126278545707464,
-0.0019110030261799693,
0.07226032018661499,
-0.08418062329292297,
0.0341079942882061,
-0.004397931974381208,
-0.06523740291595459,
2.7036404966401153e-33,
0.04518616572022438,
-0.05751786008477211,
-0.03469133377075195,
0.011201911605894566,
-0.0422709584236145,
0.0675341859459877,
0.005257321987301111,
-0.0014023735420778394,
-0.02184418775141239,
-0.08203595876693726,
-0.07335769385099411,
0.08599033951759338,
0.013081151060760021,
0.06756782531738281,
0.0281294584274292,
-0.015490618534386158,
0.039855875074863434,
-0.033420395106077194,
0.0989394262433052,
-0.008716358803212643,
0.07236658781766891,
-0.0244365856051445,
0.01386130228638649,
0.02451559714972973,
-0.029119564220309258,
-0.009223000146448612,
-0.02462485246360302,
-0.05945105105638504,
-0.013209642842411995,
0.032935936003923416,
-0.0014225388877093792,
0.04052365943789482,
-0.0735616609454155,
0.02987346425652504,
0.044361505657434464,
0.08841606974601746,
-0.016940921545028687,
0.02456655539572239,
-0.045575108379125595,
-0.06404419988393784,
-0.07726272195577621,
0.010509382002055645,
-0.04697279632091522,
-0.02207302488386631,
-0.021136583760380745,
-0.06282243877649307,
-0.05588962510228157,
-0.026810256764292717,
0.0765753835439682,
-0.005079990718513727,
-0.036155376583337784,
-0.05129540339112282,
0.14377589523792267,
-0.03151581808924675,
0.04927034303545952,
0.08276195824146271,
0.029416721314191818,
0.06601609289646149,
-0.08444337546825409,
0.029756050556898117,
0.03512166813015938,
-0.032577626407146454,
0.04418816417455673,
0.05507410690188408,
0.07906807959079742,
0.1029844656586647,
-0.01013855542987585,
-0.0035090656019747257,
0.03547505661845207,
0.04169465973973274,
0.024179473519325256,
0.11183325201272964,
0.0400594100356102,
0.04628807678818703,
-0.043196920305490494,
-0.042628537863492966,
-0.034792590886354446,
-0.054103873670101166,
-0.018449194729328156,
0.02758677676320076,
-0.0407559908926487,
0.016798675060272217,
-0.003514487762004137,
0.05652068555355072,
-0.04811837896704674,
-0.013303864747285843,
0.00003159879634040408,
0.04437803477048874,
0.03498845547437668,
-0.051252227276563644,
0.08769813179969788,
0.04243455082178116,
0.008014985360205173,
-0.05209459736943245,
-0.03660038858652115,
-5.132052950030608e-33,
0.015706440433859825,
0.04230709746479988,
-0.02584739960730076,
0.034917715936899185,
-0.00029274378903210163,
-0.02525305189192295,
-0.043227121233940125,
-0.002707474632188678,
-0.057032402604818344,
0.09370598942041397,
0.0008800820214673877,
-0.02578808180987835,
0.029244745150208473,
-0.06927446275949478,
-0.06262511759996414,
0.007841070182621479,
-0.015356795862317085,
-0.11399102956056595,
0.00835148710757494,
-0.05051780119538307,
-0.11393535137176514,
-0.03484612703323364,
0.002479393733665347,
0.024545734748244286,
-0.03908968344330788,
-0.08276631683111191,
-0.06129330024123192,
-0.014754173345863819,
-0.09488876163959503,
-0.06403786689043045,
0.04208047688007355,
-0.03391353785991669,
0.030006347224116325,
-0.016074348241090775,
-0.029476525261998177,
0.041111499071121216,
0.02280420996248722,
0.05959269404411316,
0.05807726830244064,
-0.05160274729132652,
0.005912065040320158,
-0.0025501768104732037,
-0.004883624613285065,
0.012257464230060577,
0.035846199840307236,
-0.008273454383015633,
-0.06479908525943756,
0.049912527203559875,
-0.06227200850844383,
-0.08159717917442322,
-0.03407270833849907,
-0.016394786536693573,
0.008963641710579395,
0.002649910282343626,
-0.0058664800599217415,
0.08257115632295609,
-0.015525632537901402,
0.11585081368684769,
0.02400047890841961,
0.028961647301912308,
0.05853458121418953,
-0.06683066487312317,
-0.08181807398796082,
0.07030095905065536,
-0.047839418053627014,
-0.049375031143426895,
-0.002750102197751403,
-0.08409802615642548,
-0.08792798966169357,
0.006025711074471474,
-0.03566154092550278,
0.03438693284988403,
0.020345943048596382,
0.011862616054713726,
0.06979116797447205,
-0.05636173486709595,
0.022656695917248726,
0.016691839322447777,
-0.02516740933060646,
0.01483723521232605,
-0.052770353853702545,
0.06259571760892868,
-0.056120872497558594,
0.01690620556473732,
0.08722958713769913,
0.013725836761295795,
0.010503352619707584,
0.052655179053545,
-0.07645927369594574,
0.0434378981590271,
0.005384315736591816,
0.0027496872935444117,
-0.12098195403814316,
-0.018216555938124657,
-0.031208425760269165,
-5.479706999267364e-8,
-0.001958521082997322,
-0.019045496359467506,
-0.07127993553876877,
-0.02052975818514824,
0.016171352937817574,
0.045614127069711685,
0.08017255365848541,
0.09032098203897476,
-0.006401040591299534,
0.08381466567516327,
0.005374055355787277,
0.040785808116197586,
-0.0658174529671669,
-0.0015642273938283324,
0.06612071394920349,
0.035398293286561966,
0.04278959706425667,
-0.013129462487995625,
-0.03235549107193947,
-0.06284160166978836,
-0.020777249708771706,
-0.05114411190152168,
-0.05639570578932762,
0.10315573960542679,
0.08280127495527267,
-0.00415193522349,
0.05684477463364601,
0.0689709410071373,
-0.0220892746001482,
-0.028429746627807617,
-0.06620568037033081,
-0.023815231397747993,
-0.005247755907475948,
0.029012536630034447,
-0.0711236298084259,
0.07448998838663101,
-0.07805284857749939,
0.014739076606929302,
-0.06715814769268036,
0.15778641402721405,
0.03493919596076012,
0.004901719279587269,
-0.016062166541814804,
0.013770334422588348,
0.019995352253317833,
0.06748102605342865,
-0.01934036612510681,
0.07510005682706833,
-0.06343628466129303,
-0.029136214405298233,
-0.0038903953973203897,
-0.05655655264854431,
-0.011843238025903702,
0.022294102236628532,
0.0022030912805348635,
0.022827045992016792,
-0.035818327218294144,
-0.11390891671180725,
0.05606766790151596,
0.03760724514722824,
-0.013955811969935894,
0.05786758288741112,
-0.005063347984105349,
-0.06833773106336594
] | 0.201707
|
a node's resources. To ensure that your master node is stable and not under pressure, it is a good idea in a bigger cluster to split the roles between dedicated master-eligible nodes and dedicated data nodes. While master nodes can also behave as <> and route search and indexing requests from clients to data nodes, it is better \_not\_ to use dedicated master nodes for this purpose. It is important for the stability of the cluster that master-eligible nodes do as little work as possible. To create a dedicated master-eligible node, set: [source,yaml] ------------------- node.master: true <1> node.data: false <2> node.ingest: false <3> search.remote.connect: false <4> ------------------- <1> The `node.master` role is enabled by default. <2> Disable the `node.data` role (enabled by default). <3> Disable the `node.ingest` role (enabled by default). <4> Disable {ccs} (enabled by default). ifdef::include-xpack[] NOTE: These settings apply only when {xpack} is not installed. To create a dedicated master-eligible node when {xpack} is installed, see <>. endif::include-xpack[] [float] [[split-brain]] ==== Avoiding split brain with `minimum\_master\_nodes` To prevent data loss, it is vital to configure the `discovery.zen.minimum\_master\_nodes` setting (which defaults to `1`) so that each master-eligible node knows the \_minimum number of master-eligible nodes\_ that must be visible in order to form a cluster. To explain, imagine that you have a cluster consisting of two master-eligible nodes. A network failure breaks communication between these two nodes. Each node sees one master-eligible node... itself. With `minimum\_master\_nodes` set to the default of `1`, this is sufficient to form a cluster. Each node elects itself as the new master (thinking that the other master-eligible node has died) and the result is two clusters, or a \_split brain\_. These two nodes will never rejoin until one node is restarted. Any data that has been written to the restarted node will be lost. Now imagine that you have a cluster with three master-eligible nodes, and `minimum\_master\_nodes` set to `2`. If a network split separates one node from the other two nodes, the side with one node cannot see enough master-eligible nodes and will realise that it cannot elect itself as master. The side with two nodes will elect a new master (if needed) and continue functioning correctly. As soon as the network split is resolved, the single node will rejoin the cluster and start serving requests again. This setting should be set to a \_quorum\_ of master-eligible nodes: (master\_eligible\_nodes / 2) + 1 In other words, if there are three master-eligible nodes, then minimum master nodes should be set to `(3 / 2) + 1` or `2`: [source,yaml] ---------------------------- discovery.zen.minimum\_master\_nodes: 2 <1> ---------------------------- <1> Defaults to `1`. To be able to remain available when one of the master-eligible nodes fails, clusters should have at least three master-eligible nodes, with `minimum\_master\_nodes` set accordingly. A <>, performed without any downtime, also requires at least three master-eligible nodes to avoid the possibility of data loss if a network split occurs while the upgrade is in progress. This setting can also be changed dynamically on a live cluster with the <>: [source,js] ---------------------------- PUT \_cluster/settings { "transient": { "discovery.zen.minimum\_master\_nodes": 2 } } ---------------------------- // CONSOLE // TEST[catch:/cannot set discovery.zen.minimum\_master\_nodes to more than the current master nodes/] TIP: An advantage of splitting the master and data roles between dedicated nodes is that you can have just three master-eligible nodes and set `minimum\_master\_nodes` to `2`. You never have to change this setting, no matter how many dedicated data nodes you add to the cluster. [float] [[data-node]] === Data Node Data nodes hold the shards that contain the documents you have indexed. Data nodes handle data related operations like
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/node.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.009862345643341541,
-0.0315859280526638,
-0.008064871653914452,
0.09489469230175018,
0.044778600335121155,
-0.04204205423593521,
-0.07588669657707214,
-0.005132442805916071,
-0.023289687931537628,
0.015388918109238148,
-0.0434541255235672,
0.011694484390318394,
0.07133094221353531,
-0.05901484191417694,
0.019896749407052994,
0.06589362770318985,
0.07707367092370987,
-0.002132722642272711,
0.07774248719215393,
-0.06311850994825363,
-0.030845144763588905,
-0.01635580137372017,
0.03637420013546944,
-0.06623272597789764,
-0.07038713246583939,
-0.016975289210677147,
-0.054117102175951004,
-0.05293286219239235,
0.06091449409723282,
-0.00576168904080987,
0.011586141772568226,
0.006468211766332388,
-0.0372801199555397,
0.11755257099866867,
-0.017729470506310463,
0.07795941084623337,
0.06217052787542343,
-0.08375101536512375,
-0.06977643817663193,
0.025950565934181213,
0.09823434799909592,
0.10505806654691696,
-0.024442125111818314,
-0.07117348909378052,
-0.05145718529820442,
-0.017876192927360535,
-0.05423826351761818,
-0.005754182580858469,
-0.01897244155406952,
-0.0520118847489357,
-0.05507891625165939,
-0.06253840029239655,
-0.023055244237184525,
0.032709307968616486,
0.040075067430734634,
0.06538299471139908,
-0.013697566464543343,
-0.07822619378566742,
-0.003074468346312642,
0.00573952030390501,
0.08952672779560089,
0.020103557035326958,
0.026639901101589203,
-0.07106474786996841,
0.07062295824289322,
-0.002613905817270279,
-0.0017282854532822967,
0.05555132403969765,
0.0696488469839096,
0.009015216492116451,
0.08903791010379791,
-0.049015484750270844,
-0.10585520416498184,
0.006120184902101755,
-0.0819447934627533,
-0.03525125980377197,
0.013728365302085876,
-0.006596984341740608,
0.02156616374850273,
0.008082292973995209,
-0.08898379653692245,
0.020966704934835434,
0.0005679404712282121,
0.022722113877534866,
-0.08296141028404236,
-0.05827565863728523,
-0.022378047928214073,
-0.06653239578008652,
0.05230340734124184,
0.03292308747768402,
0.012466957792639732,
0.01509587001055479,
-0.00896927248686552,
-0.0009341186378151178,
0.04425453022122383,
0.05596806854009628,
0.021807238459587097,
-0.04047287255525589,
0.003739390755072236,
-0.009276164695620537,
0.0066554006189107895,
-0.0344940647482872,
0.0017751845298334956,
-0.019300978630781174,
-0.023318005725741386,
0.041885245591402054,
0.008456209674477577,
0.05488663911819458,
0.03735008090734482,
0.05000936612486839,
-0.01977638155221939,
0.10089695453643799,
-0.03700755909085274,
-0.019835125654935837,
-0.07213133573532104,
0.026837429031729698,
0.020504169166088104,
-0.013129203580319881,
-0.0370078943669796,
0.12732140719890594,
0.019758149981498718,
-0.031324323266744614,
0.029934389516711235,
-0.028837472200393677,
0.022342801094055176,
-0.013868667185306549,
-0.10759998112916946,
2.4246473817190073e-33,
0.034023139625787735,
-0.07446949183940887,
0.046024322509765625,
-0.028241559863090515,
0.033085551112890244,
0.02915666624903679,
0.053389862179756165,
-0.04641668498516083,
-0.1320832222700119,
-0.04748394340276718,
-0.022762618958950043,
0.01061065774410963,
-0.03787974640727043,
-0.05197548866271973,
0.009676322340965271,
-0.09284122288227081,
0.07483682036399841,
0.07302914559841156,
0.12355627864599228,
-0.036286137998104095,
0.015502889640629292,
-0.05258316919207573,
0.00517718680202961,
0.03407983481884003,
0.039875637739896774,
-0.04902895167469978,
0.018082475289702415,
-0.0636567696928978,
0.04361627623438835,
0.03163943812251091,
-0.00212857942096889,
-0.010078491643071175,
-0.0209043025970459,
0.033913612365722656,
0.000606572488322854,
0.04888630285859108,
-0.06447429209947586,
-0.010178414173424244,
-0.08470477908849716,
-0.03764713555574417,
-0.045513469725847244,
0.0355713851749897,
0.05552907660603523,
-0.09020739048719406,
-0.04673473909497261,
-0.038636405020952225,
-0.015853403136134148,
-0.05683193728327751,
0.01748889684677124,
0.04771868512034416,
-0.014970199204981327,
0.0010577752254903316,
0.032968536019325256,
-0.011262595653533936,
0.032691214233636856,
-0.004150197375565767,
0.027406984940171242,
0.04746066406369209,
-0.02080986648797989,
0.008985225111246109,
-0.035473354160785675,
-0.12190014123916626,
-0.054682835936546326,
0.012850886210799217,
0.05302687734365463,
0.08618873357772827,
0.005781891290098429,
-0.00447881268337369,
0.05190663039684296,
0.03615931048989296,
-0.03774404153227806,
0.023983214050531387,
0.055993787944316864,
0.01719493605196476,
-0.011896315030753613,
-0.12897473573684692,
-0.0746072456240654,
-0.021787496283650398,
-0.05660279840230942,
0.037333667278289795,
-0.06559479236602783,
0.04338621720671654,
-0.08218083530664444,
0.10177934914827347,
0.016129665076732635,
-0.03549547493457794,
-0.028529025614261627,
0.04755929484963417,
0.020548652857542038,
0.048845406621694565,
0.028126927092671394,
-0.010693877935409546,
-0.015416962094604969,
-0.03726906701922417,
-0.08921639621257782,
-2.8066224343087865e-33,
-0.03150632232427597,
-0.05209505930542946,
-0.004897430073469877,
0.023452796041965485,
0.0397280789911747,
-0.06335008889436722,
-0.024306271225214005,
-0.05666123703122139,
-0.0014318069443106651,
0.0016164494445547462,
-0.016352811828255653,
-0.03984224423766136,
0.021823516115546227,
-0.05578073486685753,
-0.0684225857257843,
0.022081920877099037,
-0.01613977923989296,
-0.029109684750437737,
0.003905900754034519,
0.004501408897340298,
-0.055102042853832245,
0.0371333472430706,
0.05595140904188156,
0.018131472170352936,
0.03803778067231178,
0.03424627706408501,
-0.11818093806505203,
0.039039649069309235,
-0.04461238160729408,
-0.03404635563492775,
0.04178917035460472,
0.013224804773926735,
-0.07031416147947311,
-0.08534315228462219,
-0.03519755229353905,
0.012022034265100956,
-0.07902681082487106,
0.10657927393913269,
-0.028501173481345177,
0.04060967639088631,
0.08096742630004883,
0.03177451714873314,
-0.046117231249809265,
0.020539967343211174,
-0.008165727369487286,
0.037390295416116714,
0.014838705770671368,
0.01696351356804371,
-0.05260331928730011,
0.05905942991375923,
-0.03982087969779968,
-0.03199274465441704,
0.008662535808980465,
0.06623714417219162,
0.035510893911123276,
-0.01247240137308836,
0.007863294333219528,
0.1262386441230774,
0.0022930377162992954,
-0.020774854347109795,
0.11223415285348892,
-0.06380057334899902,
-0.07487913221120834,
0.08155839890241623,
-0.019565414637327194,
-0.030174586921930313,
0.01960577629506588,
0.04940222203731537,
0.010686703957617283,
0.014831493608653545,
-0.05369671806693077,
0.04417235776782036,
0.09568154811859131,
0.051081784069538116,
0.0007320619188249111,
0.016675861552357674,
-0.013742317445576191,
-0.061460163444280624,
-0.02718859724700451,
0.006409785710275173,
-0.14468100666999817,
0.1097491905093193,
-0.06594227254390717,
0.037114277482032776,
0.07717917859554291,
-0.0031178079079836607,
0.010110842064023018,
0.08871857076883316,
0.0037832327652722597,
0.049756284803152084,
-0.050262343138456345,
-0.05484858155250549,
-0.07672949880361557,
0.025194719433784485,
-0.04355402663350105,
-6.346999725792557e-8,
-0.05549225956201553,
0.020232560113072395,
-0.09960688650608063,
0.0399065837264061,
0.027735672891139984,
0.06632187217473984,
-0.0001699362910585478,
0.06518866121768951,
0.05051460489630699,
0.08782754093408585,
0.07088744640350342,
-0.022025220096111298,
-0.045512132346630096,
-0.04225947707891464,
0.05593188479542732,
-0.04411797598004341,
0.05413982644677162,
-0.03241947665810585,
-0.01866723969578743,
-0.048151712864637375,
-0.026562292128801346,
-0.00850228127092123,
-0.04480263590812683,
0.12291458249092102,
0.010554136708378792,
0.036242466419935226,
0.06334882974624634,
0.03163102641701698,
-0.03970692306756973,
0.06181475892663002,
0.004957025870680809,
-0.007014491595327854,
-0.05018139258027077,
0.06409304589033127,
-0.028930800035595894,
0.024279942736029625,
-0.09200389683246613,
0.08686714619398117,
-0.022707195952534676,
0.0801699161529541,
0.05928751453757286,
0.07065992802381516,
-0.005995152052491903,
0.011761609464883804,
-0.00745503231883049,
0.026482751592993736,
-0.04834849759936333,
0.06632581353187561,
0.07658351212739944,
0.02317521534860134,
-0.043791450560092926,
-0.11751459538936615,
-0.03905105218291283,
0.031801287084817886,
0.05503039434552193,
0.029056617990136147,
0.017178038135170937,
-0.04150564596056938,
0.03506210818886757,
-0.017824811860919,
0.05001232028007507,
-0.003466513240709901,
-0.04906701296567917,
-0.03798334300518036
] | 0.0705
|
master-eligible nodes and set `minimum\_master\_nodes` to `2`. You never have to change this setting, no matter how many dedicated data nodes you add to the cluster. [float] [[data-node]] === Data Node Data nodes hold the shards that contain the documents you have indexed. Data nodes handle data related operations like CRUD, search, and aggregations. These operations are I/O-, memory-, and CPU-intensive. It is important to monitor these resources and to add more data nodes if they are overloaded. The main benefit of having dedicated data nodes is the separation of the master and data roles. To create a dedicated data node, set: [source,yaml] ------------------- node.master: false <1> node.data: true <2> node.ingest: false <3> search.remote.connect: false <4> ------------------- <1> Disable the `node.master` role (enabled by default). <2> The `node.data` role is enabled by default. <3> Disable the `node.ingest` role (enabled by default). <4> Disable {ccs} (enabled by default). ifdef::include-xpack[] NOTE: These settings apply only when {xpack} is not installed. To create a dedicated data node when {xpack} is installed, see <>. endif::include-xpack[] [float] [[node-ingest-node]] === Ingest Node Ingest nodes can execute pre-processing pipelines, composed of one or more ingest processors. Depending on the type of operations performed by the ingest processors and the required resources, it may make sense to have dedicated ingest nodes, that will only perform this specific task. To create a dedicated ingest node, set: [source,yaml] ------------------- node.master: false <1> node.data: false <2> node.ingest: true <3> search.remote.connect: false <4> ------------------- <1> Disable the `node.master` role (enabled by default). <2> Disable the `node.data` role (enabled by default). <3> The `node.ingest` role is enabled by default. <4> Disable {ccs} (enabled by default). ifdef::include-xpack[] NOTE: These settings apply only when {xpack} is not installed. To create a dedicated ingest node when {xpack} is installed, see <>. endif::include-xpack[] [float] [[coordinating-only-node]] === Coordinating only node If you take away the ability to be able to handle master duties, to hold data, and pre-process documents, then you are left with a \_coordinating\_ node that can only route requests, handle the search reduce phase, and distribute bulk indexing. Essentially, coordinating only nodes behave as smart load balancers. Coordinating only nodes can benefit large clusters by offloading the coordinating node role from data and master-eligible nodes. They join the cluster and receive the full <>, like every other node, and they use the cluster state to route requests directly to the appropriate place(s). WARNING: Adding too many coordinating only nodes to a cluster can increase the burden on the entire cluster because the elected master node must await acknowledgement of cluster state updates from every node! The benefit of coordinating only nodes should not be overstated -- data nodes can happily serve the same purpose. To create a dedicated coordinating node, set: [source,yaml] ------------------- node.master: false <1> node.data: false <2> node.ingest: false <3> search.remote.connect: false <4> ------------------- <1> Disable the `node.master` role (enabled by default). <2> Disable the `node.data` role (enabled by default). <3> Disable the `node.ingest` role (enabled by default). <4> Disable {ccs} (enabled by default). ifdef::include-xpack[] NOTE: These settings apply only when {xpack} is not installed. To create a dedicated coordinating node when {xpack} is installed, see <>. endif::include-xpack[] [float] == Node data path settings [float] [[data-path]] === `path.data` Every data and master-eligible node requires access to a data directory where shards and index and cluster metadata will be stored. The `path.data` defaults to `$ES\_HOME/data` but can be configured in the `elasticsearch.yml` config file an absolute path or a path relative to `$ES\_HOME` as follows: [source,yaml] ----------------------- path.data: /var/elasticsearch/data ----------------------- Like all node settings, it can also be specified on the command line as:
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/node.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.0836983174085617,
-0.028776094317436218,
0.006932753603905439,
0.09611812233924866,
-0.004902733489871025,
-0.033357150852680206,
-0.06668088585138321,
0.009050223976373672,
0.0032078498043119907,
0.05241147428750992,
-0.026408014819025993,
-0.011027039960026741,
0.08084481209516525,
-0.032557401806116104,
-0.023947671055793762,
0.04146404564380646,
0.019690189510583878,
-0.023752951994538307,
0.012674267403781414,
-0.034763410687446594,
0.03561718389391899,
-0.049055326730012894,
0.036384012550115585,
-0.04116659611463547,
-0.054238226264715195,
-0.005903852637857199,
-0.08465385437011719,
-0.055806513875722885,
0.06425944715738297,
0.0063360705971717834,
0.03486232832074165,
-0.00012679326755460352,
0.028315510600805283,
0.09323163330554962,
-0.020969178527593613,
0.0577523298561573,
0.049946460872888565,
-0.07102551311254501,
-0.12498163431882858,
0.04887901619076729,
0.10349787026643753,
0.0469621904194355,
-0.05896400660276413,
-0.02156044729053974,
-0.024673087522387505,
-0.011452691629529,
-0.05283199995756149,
-0.03019765391945839,
0.0055888621136546135,
0.025524962693452835,
-0.04623522236943245,
-0.047051869332790375,
-0.025034518912434578,
0.04766407981514931,
0.029524914920330048,
0.06310277432203293,
0.005556909833103418,
-0.03424610197544098,
0.017738059163093567,
-0.033639583736658096,
0.10676105320453644,
-0.02029389888048172,
0.030337832868099213,
-0.08023212105035782,
0.06803467124700546,
0.013076658360660076,
0.05742145702242851,
0.03320952504873276,
0.004849444609135389,
0.024653388187289238,
0.09199478477239609,
0.015355837531387806,
-0.058372315019369125,
0.011500394903123379,
-0.049306757748126984,
-0.010800671763718128,
-0.013056188821792603,
-0.015144271776080132,
-0.01810910366475582,
0.029001900926232338,
-0.0991709753870964,
-0.001229071756824851,
0.03227910399436951,
0.011057543568313122,
-0.1066373661160469,
-0.10898149013519287,
-0.045071180909872055,
-0.05307919904589653,
-0.009531289339065552,
0.02092788554728031,
0.01586565189063549,
-0.0015106333885341883,
-0.0032253486569970846,
-0.034580718725919724,
0.061431847512722015,
0.05865166708827019,
-0.03495267778635025,
0.006585806142538786,
0.048080019652843475,
-0.051188576966524124,
0.0063871839083731174,
-0.04223988577723503,
0.014191863127052784,
0.006286525633186102,
-0.020773235708475113,
0.005717489868402481,
-0.043288394808769226,
0.02540145255625248,
-0.05102283135056496,
0.020997509360313416,
0.05908309295773506,
0.0723249688744545,
-0.05578109249472618,
-0.04209816828370094,
-0.02299511432647705,
0.10634318739175797,
0.021509850397706032,
-0.03970333933830261,
-0.050904158502817154,
0.08650348335504532,
0.030618412420153618,
0.0022406545467674732,
0.06730663776397705,
-0.038830533623695374,
0.007674404885619879,
-0.02436048910021782,
-0.1294468343257904,
1.1933238450593769e-33,
0.05498214066028595,
-0.018985241651535034,
0.03791840001940727,
-0.050156544893980026,
0.03459286317229271,
0.028039170429110527,
-0.00894810352474451,
-0.007894709706306458,
-0.13274480402469635,
-0.05778266116976738,
-0.05232297256588936,
0.03873993456363678,
-0.015979064628481865,
-0.06756609678268433,
0.024895556271076202,
-0.11040811985731125,
0.09231007099151611,
0.0867326557636261,
0.06569914519786835,
-0.05032782629132271,
0.05722948908805847,
-0.048849716782569885,
-0.020333435386419296,
0.003194661345332861,
0.009845058433711529,
-0.022403400391340256,
-0.00803656131029129,
-0.12149282544851303,
-0.02278972789645195,
0.0013679822441190481,
-0.042371876537799835,
-0.018313512206077576,
0.050457246601581573,
0.028470870107412338,
-0.002695984672755003,
0.042515166103839874,
-0.05480579286813736,
0.022798968479037285,
-0.06514700502157211,
-0.055898282676935196,
0.04953140392899513,
0.04181239381432533,
0.08577669411897659,
-0.08954185247421265,
-0.043371908366680145,
0.04302677512168884,
0.01366435643285513,
-0.05578017234802246,
0.021178526803851128,
0.02042207680642605,
0.006297432351857424,
-0.018681995570659637,
-0.012879110872745514,
0.054758861660957336,
0.02128475531935692,
0.04042139649391174,
0.03953782469034195,
0.005089139565825462,
0.010354548692703247,
0.00881670881062746,
-0.03807773441076279,
-0.10989633947610855,
-0.003351453226059675,
0.08521706610918045,
0.009583069011569023,
0.051813386380672455,
0.061953261494636536,
0.058795299381017685,
0.0679408386349678,
0.03851626440882683,
-0.034168995916843414,
0.053700387477874756,
0.014791379682719707,
0.015260625630617142,
-0.010195172391831875,
-0.09504803270101547,
-0.022360850125551224,
-0.06335010379552841,
-0.11021541804075241,
0.028601884841918945,
-0.08377981185913086,
0.03289399668574333,
-0.03675398975610733,
0.028777172788977623,
-0.007428888697177172,
0.02575049176812172,
-0.0072155483067035675,
0.07902426272630692,
-0.005086968187242746,
-0.024720333516597748,
0.013674239628016949,
-0.034732017666101456,
-0.032077010720968246,
-0.10184096544981003,
-0.09832075238227844,
-1.6096475772641525e-33,
-0.023720290511846542,
-0.061861515045166016,
0.01404653862118721,
0.05716591700911522,
0.07975581288337708,
-0.004758869297802448,
0.0014545292360708117,
-0.016149133443832397,
-0.004373518284410238,
-0.024045346304774284,
0.004127517808228731,
-0.05713093653321266,
0.034464653581380844,
-0.06401783227920532,
-0.14004914462566376,
0.0328877791762352,
-0.00003655294131021947,
-0.06319310516119003,
0.06672349572181702,
-0.017732860520482063,
-0.04843979328870773,
-0.042809177190065384,
0.05779686197638512,
0.06916750967502594,
0.0533347949385643,
-0.0030290877912193537,
-0.05445929616689682,
-0.018838856369256973,
-0.04528332129120827,
-0.006011764984577894,
-0.002040208550170064,
-0.030579926446080208,
-0.04002643749117851,
-0.08550839871168137,
-0.019835948944091797,
-0.015549697913229465,
-0.011513397097587585,
0.06121458113193512,
-0.03131946176290512,
0.056691236793994904,
0.05289781093597412,
0.017830468714237213,
-0.0966576486825943,
0.015144013799726963,
-0.028400210663676262,
0.0004761854943353683,
-0.012367678806185722,
0.01775355078279972,
-0.024617278948426247,
-0.024410851299762726,
-0.05950651317834854,
-0.06887352466583252,
0.04987901821732521,
0.09234853833913803,
0.004231154453009367,
-0.0318024605512619,
-0.016721230000257492,
0.14970716834068298,
-0.012127984315156937,
-0.007831810042262077,
0.057569921016693115,
-0.039214976131916046,
-0.08858642727136612,
0.07095792889595032,
-0.02535851113498211,
-0.047939278185367584,
-0.008370542898774147,
-0.004643688909709454,
-0.08888673782348633,
0.002375488169491291,
-0.08790473639965057,
0.03417752683162689,
0.06561563163995743,
0.04233739152550697,
-0.020401841029524803,
-0.008123514242470264,
-0.007073021028190851,
-0.02506279945373535,
0.0541897714138031,
0.04335315525531769,
-0.08605179190635681,
0.12759822607040405,
-0.018857013434171677,
0.02009311132133007,
0.09496907144784927,
-0.04353879392147064,
0.013828816823661327,
0.0998367965221405,
-0.041541554033756256,
0.07083860784769058,
-0.0939568504691124,
-0.011437535285949707,
-0.08643537759780884,
0.02454100176692009,
-0.038187477737665176,
-5.4742173460908816e-8,
-0.026006102561950684,
0.01388346217572689,
-0.04570743441581726,
0.0699249804019928,
0.042507752776145935,
0.0035028676502406597,
0.002070550573989749,
0.11635252088308334,
-0.019549967721104622,
0.019798215478658676,
0.08720375597476959,
-0.02727424167096615,
-0.0557505339384079,
-0.043274227529764175,
0.06034286692738533,
-0.021614758297801018,
0.10068084299564362,
-0.031733784824609756,
0.005394234787672758,
-0.002535731764510274,
0.0024688602425158024,
0.013980128802359104,
-0.012667371891438961,
0.056205254048109055,
0.04012978821992874,
0.02345721423625946,
0.07483374327421188,
0.01955466903746128,
-0.01009644940495491,
0.018465064465999603,
-0.010892463847994804,
-0.03797664865851402,
-0.03325578570365906,
0.052201900631189346,
-0.026507651433348656,
0.02641785517334938,
-0.07802115380764008,
0.11415916681289673,
-0.049607884138822556,
0.09364183992147446,
0.03804833069443703,
0.0379830077290535,
0.00038527505239471793,
-0.02520671859383583,
0.010642231442034245,
0.05253120884299278,
-0.09335653483867645,
0.09228484332561493,
0.05856645479798317,
0.02508290484547615,
0.008198216557502747,
-0.07217534631490707,
0.05705692246556282,
0.06250867247581482,
0.061261136084795,
0.03222476318478584,
0.042430806905031204,
0.009998509660363197,
0.046256329864263535,
-0.012174045667052269,
0.050448138266801834,
-0.05433914437890053,
-0.0402173288166523,
-0.052469801157712936
] | 0.035653
|
and cluster metadata will be stored. The `path.data` defaults to `$ES\_HOME/data` but can be configured in the `elasticsearch.yml` config file an absolute path or a path relative to `$ES\_HOME` as follows: [source,yaml] ----------------------- path.data: /var/elasticsearch/data ----------------------- Like all node settings, it can also be specified on the command line as: [source,sh] ----------------------- ./bin/elasticsearch -Epath.data=/var/elasticsearch/data ----------------------- TIP: When using the `.zip` or `.tar.gz` distributions, the `path.data` setting should be configured to locate the data directory outside the Elasticsearch home directory, so that the home directory can be deleted without deleting your data! The RPM and Debian distributions do this for you already. [float] [[max-local-storage-nodes]] === `node.max\_local\_storage\_nodes` The <> can be shared by multiple nodes, even by nodes from different clusters. This is very useful for testing failover and different configurations on your development machine. In production, however, it is recommended to run only one node of Elasticsearch per server. By default, Elasticsearch is configured to prevent more than one node from sharing the same data path. To allow for more than one node (e.g., on your development machine), use the setting `node.max\_local\_storage\_nodes` and set this to a positive integer larger than one. WARNING: Never run different node types (i.e. master, data) from the same data directory. This can lead to unexpected data loss. [float] == Other node settings More node settings can be found in <>. Of particular note are the <>, the <> and the <>. ifdef::include-xpack[] :edit\_url!: include::{xes-repo-dir}/node.asciidoc[] endif::include-xpack[]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/node.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.06146499142050743,
0.022306865081191063,
-0.03526423126459122,
0.06934105604887009,
0.06459972262382507,
0.010043767280876637,
-0.018649693578481674,
0.0023878347128629684,
0.06039317697286606,
0.03259127959609032,
0.01694442704319954,
0.0019949101842939854,
-0.017720621079206467,
-0.03204978629946709,
0.009919369593262672,
-0.04550966992974281,
-0.05466601252555847,
-0.021472318097949028,
0.009081380441784859,
0.007593017071485519,
0.08293420076370239,
0.057815901935100555,
0.04679117351770401,
-0.014666938222944736,
-0.03986377641558647,
0.03500578925013542,
-0.04078010842204094,
0.037107549607753754,
0.04676232114434242,
0.0009588396642357111,
0.014077716507017612,
-0.014140160754323006,
0.047375794500112534,
0.05609595403075218,
0.017765911296010017,
0.10757295042276382,
0.09761418402194977,
-0.032067883759737015,
-0.11042989790439606,
0.04676911607384682,
0.07229220122098923,
0.04658991098403931,
-0.02897673100233078,
-0.09767412394285202,
-0.10499490797519684,
-0.11346325278282166,
0.014999805949628353,
-0.06711327284574509,
-0.08771353214979172,
0.07932325452566147,
-0.00719016557559371,
-0.05760868638753891,
-0.04835685342550278,
0.05695667862892151,
0.0298752561211586,
0.1059393510222435,
-0.05036592110991478,
0.03226833418011665,
0.008123132400214672,
-0.03540303558111191,
0.07971235364675522,
-0.03927294537425041,
0.0030020272824913263,
0.004298750776797533,
-0.019708361476659775,
-0.02122938074171543,
0.04472793638706207,
-0.005049544386565685,
0.0632137656211853,
-0.12121371179819107,
0.062080930918455124,
-0.02408495359122753,
-0.02958730235695839,
-0.024205733090639114,
0.04082051292061806,
0.060671161860227585,
0.04976188763976097,
0.05405449494719505,
0.03161092475056648,
-0.02833937667310238,
-0.03700129687786102,
-0.02386477217078209,
0.01928124949336052,
0.04990275576710701,
-0.07412966340780258,
-0.05099896341562271,
0.01547976117581129,
-0.03912142291665077,
0.06873675435781479,
-0.02996978722512722,
0.020522214472293854,
-0.10732303559780121,
-0.03073841519653797,
-0.052275851368904114,
-0.0046082064509391785,
0.05021387338638306,
-0.07377312332391739,
0.06295621395111084,
0.0968223586678505,
-0.018711628392338753,
0.016229962930083275,
-0.007739801425486803,
0.008690944872796535,
0.04306618869304657,
-0.03487800061702728,
-0.021239807829260826,
-0.06408455222845078,
0.005408934783190489,
-0.02783472090959549,
0.09668891131877899,
-0.0012548173544928432,
0.06155199557542801,
0.021868593990802765,
0.0033268826082348824,
-0.017754342406988144,
0.012810277752578259,
-0.041135188192129135,
-0.03370765224099159,
-0.01120695285499096,
0.10204225778579712,
0.035145193338394165,
-0.055544815957546234,
0.11365333199501038,
-0.018428122624754906,
0.02270071767270565,
0.0178856048732996,
-0.07537327706813812,
-2.048011093862877e-33,
0.05163423717021942,
-0.04305252805352211,
-0.011205052956938744,
-0.021829871460795403,
-0.011481850408017635,
0.03578367084264755,
0.02493436448276043,
0.06320054084062576,
-0.03145650774240494,
-0.012059305794537067,
-0.06381908804178238,
0.09820160269737244,
0.007155303377658129,
0.0007106840494088829,
-0.010354645550251007,
0.047237321734428406,
0.026532702147960663,
0.009329961612820625,
-0.003223532810807228,
-0.03795771673321724,
0.08930915594100952,
0.0260316114872694,
-0.038441091775894165,
0.0016342279268428683,
-0.05309610441327095,
-0.01822078600525856,
0.008790825493633747,
-0.05784154683351517,
-0.059142377227544785,
0.024086151272058487,
-0.05341285094618797,
0.01656688190996647,
0.06021374091506004,
0.06445497274398804,
-0.010061689652502537,
0.08138425648212433,
-0.028271740302443504,
0.059032224118709564,
-0.08357797563076019,
0.027029763907194138,
0.12359077483415604,
0.03759082779288292,
0.04751860350370407,
-0.051734134554862976,
-0.02536538988351822,
-0.06888190656900406,
0.0063986764289438725,
-0.07869114726781845,
0.14047181606292725,
-0.006520709488540888,
-0.046330612152814865,
-0.07906068116426468,
0.07302717119455338,
-0.007363856770098209,
0.06338492035865784,
0.07740549743175507,
-0.03716108202934265,
-0.09330357611179352,
-0.030816782265901566,
-0.021887481212615967,
-0.02094997838139534,
-0.013521200977265835,
0.0781950056552887,
0.0216177050024271,
0.060065023601055145,
0.01234397292137146,
0.03162200748920441,
-0.010021096095442772,
0.015498622320592403,
0.05640331655740738,
0.0004065810062456876,
0.037308480590581894,
0.015222608111798763,
0.02341521345078945,
-0.014188897795975208,
-0.047966741025447845,
-0.017814630642533302,
0.00950164906680584,
-0.06819803267717361,
0.053203146904706955,
-0.041422039270401,
-0.0332556888461113,
-0.0761822760105133,
0.09016153961420059,
0.000014522500350722112,
-0.04655657336115837,
-0.0023129070177674294,
0.028765961527824402,
-0.010942543856799603,
-0.08787138015031815,
0.05194060504436493,
-0.026863111183047295,
-0.048401035368442535,
-0.11764534562826157,
-0.07226844131946564,
-1.156849816556796e-33,
0.04556103050708771,
-0.03836223855614662,
-0.05497156083583832,
-0.01485478412359953,
-0.059572089463472366,
0.0322393923997879,
0.03932970389723778,
0.039909567683935165,
-0.06512948870658875,
0.020834587514400482,
-0.03633420914411545,
-0.00800592266023159,
0.024526432156562805,
-0.06005808711051941,
-0.06129202991724014,
0.04212995246052742,
0.015587091445922852,
-0.11280050873756409,
0.014785095117986202,
-0.051561158150434494,
-0.06200117617845535,
-0.07302981615066528,
0.012110703624784946,
0.08618975430727005,
0.01391886081546545,
-0.09879143536090851,
0.0376250296831131,
-0.03189969062805176,
-0.10709159821271896,
-0.004478389397263527,
-0.03185662254691124,
-0.03029666468501091,
-0.07577987760305405,
0.012014851905405521,
-0.10714904963970184,
-0.007245743181556463,
-0.04497763141989708,
-0.02236228622496128,
0.00138764432631433,
-0.019817283377051353,
-0.009455578401684761,
0.08992748707532883,
-0.0879904106259346,
-0.0031442083418369293,
0.024118417873978615,
0.03303290903568268,
-0.008670911192893982,
0.011488305404782295,
-0.04465795308351517,
-0.04538821056485176,
0.019601264968514442,
-0.03226955980062485,
-0.0372062548995018,
0.05111975967884064,
-0.009595568291842937,
0.06485466659069061,
-0.07857627421617508,
0.07601349800825119,
-0.1206808090209961,
0.05835504084825516,
0.06411910802125931,
-0.011217244900763035,
-0.06948184221982956,
-0.007782215718179941,
-0.09417000412940979,
-0.03616803511977196,
-0.0617518350481987,
-0.04344754293560982,
-0.10961662232875824,
-0.010325165465474129,
-0.06353230029344559,
0.005986838601529598,
0.05221790075302124,
0.021557429805397987,
0.023077866062521935,
0.004337786231189966,
0.013361685909330845,
-0.04027412459254265,
0.034517645835876465,
-0.030809318646788597,
0.0026735258288681507,
0.07560635358095169,
-0.07378846406936646,
0.031333837658166885,
0.027372512966394424,
-0.01370544545352459,
-0.027966652065515518,
0.09216687828302383,
-0.00039524538442492485,
0.03420839458703995,
-0.015203620307147503,
-0.034597545862197876,
-0.10772772878408432,
-0.029101651161909103,
-0.008999709039926529,
-5.0555247099737244e-8,
-0.03293623402714729,
0.03856775909662247,
-0.008706161752343178,
0.04139288514852524,
0.0010061872890219092,
0.06273166835308075,
0.1028875857591629,
0.1035710945725441,
0.0185617133975029,
0.04896899312734604,
0.05918611213564873,
0.025667497888207436,
-0.10599365830421448,
-0.0038612079806625843,
-0.06381310522556305,
0.004098699428141117,
0.10588205605745316,
0.05499253794550896,
-0.011605169624090195,
0.011267987079918385,
-0.0050106169655919075,
-0.005052944179624319,
-0.037124019116163254,
0.037789978086948395,
0.11179139465093613,
-0.008023357950150967,
-0.0006869619246572256,
0.03390994668006897,
-0.023798754438757896,
-0.04298365116119385,
-0.046282656490802765,
-0.04162523150444031,
-0.0034281592816114426,
0.027793364599347115,
-0.09203965961933136,
-0.003719303058460355,
-0.015329944901168346,
0.0555260106921196,
-0.03178609162569046,
0.07690940797328949,
0.054571643471717834,
-0.0010645067086443305,
-0.04942182078957558,
-0.04274217411875725,
-0.043248992413282394,
0.02243092842400074,
0.007347610779106617,
0.07648088783025742,
-0.025314614176750183,
-0.02212795615196228,
-0.03351113572716713,
-0.031905125826597214,
-0.031587883830070496,
0.05769578740000725,
0.055791668593883514,
-0.042372796684503555,
-0.06797029078006744,
-0.047911908477544785,
0.004446446895599365,
0.019353240728378296,
0.006150167901068926,
-0.01199401170015335,
-0.018571756780147552,
-0.07760254293680191
] | 0.102625
|
[[allocation-awareness]] === Shard Allocation Awareness When running nodes on multiple VMs on the same physical server, on multiple racks, or across multiple zones or domains, it is more likely that two nodes on the same physical server, in the same rack, or in the same zone or domain will crash at the same time, rather than two unrelated nodes crashing simultaneously. If Elasticsearch is \_aware\_ of the physical configuration of your hardware, it can ensure that the primary shard and its replica shards are spread across different physical servers, racks, or zones, to minimise the risk of losing all shard copies at the same time. The shard allocation awareness settings allow you to tell Elasticsearch about your hardware configuration. As an example, let's assume we have several racks. When we start a node, we can tell it which rack it is in by assigning it an arbitrary metadata attribute called `rack\_id` -- we could use any attribute name. For example: [source,sh] ---------------------- ./bin/elasticsearch -Enode.attr.rack\_id=rack\_one <1> ---------------------- <1> This setting could also be specified in the `elasticsearch.yml` config file. Now, we need to set up \_shard allocation awareness\_ by telling Elasticsearch which attributes to use. This can be configured in the `elasticsearch.yml` file on \*all\* master-eligible nodes, or it can be set (and changed) with the <> API. For our example, we'll set the value in the config file: [source,yaml] -------------------------------------------------------- cluster.routing.allocation.awareness.attributes: rack\_id -------------------------------------------------------- With this config in place, let's say we start two nodes with `node.attr.rack\_id` set to `rack\_one`, and we create an index with 5 primary shards and 1 replica of each primary. All primaries and replicas are allocated across the two nodes. Now, if we start two more nodes with `node.attr.rack\_id` set to `rack\_two`, Elasticsearch will move shards across to the new nodes, ensuring (if possible) that no two copies of the same shard will be in the same rack. However if `rack\_two` were to fail, taking down both of its nodes, Elasticsearch will still allocate the lost shard copies to nodes in `rack\_one`. .Prefer local shards \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* When executing search or GET requests, with shard awareness enabled, Elasticsearch will prefer using local shards -- shards in the same awareness group -- to execute the request. This is usually faster than crossing between racks or across zone boundaries. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Multiple awareness attributes can be specified, in which case each attribute is considered separately when deciding where to allocate the shards. [source,yaml] ------------------------------------------------------------- cluster.routing.allocation.awareness.attributes: rack\_id,zone ------------------------------------------------------------- NOTE: When using awareness attributes, shards will not be allocated to nodes that don't have values set for those attributes. NOTE: Number of primary/replica of a shard allocated on a specific group of nodes with the same awareness attribute value is determined by the number of attribute values. When the number of nodes in groups is unbalanced and there are many replicas, replica shards may be left unassigned. [float] [[forced-awareness]] === Forced Awareness Imagine that you have two zones and enough hardware across the two zones to host all of your primary and replica shards. But perhaps the hardware in a single zone, while sufficient to host half the shards, would be unable to host \*ALL\* the shards. With ordinary awareness, if one zone lost contact with the other zone, Elasticsearch would assign all of the missing replica shards to a single zone. But in this example, this sudden extra load would cause the hardware in the remaining zone to be overloaded. Forced awareness solves this problem by \*NEVER\* allowing copies of the same shard to be allocated to the same zone. For example, lets say we have an awareness attribute called `zone`,
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/cluster/allocation_awareness.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.09514007717370987,
0.011328345164656639,
0.03590046614408493,
0.020938511937856674,
0.05297655612230301,
-0.020726200193166733,
-0.03160436451435089,
-0.02628682367503643,
0.06835106760263443,
0.04524027928709984,
-0.08469230681657791,
0.015424023382365704,
0.07508789747953415,
-0.048208944499492645,
-0.05133137106895447,
-0.023442145437002182,
-0.012760727666318417,
-0.013162961229681969,
-0.06910912692546844,
0.05464493855834007,
0.10761097073554993,
0.02235325239598751,
0.00483516464009881,
-0.01962048001587391,
-0.1501074582338333,
-0.00455692270770669,
-0.07139724493026733,
0.027891632169485092,
0.012846274301409721,
-0.035068124532699585,
0.05355971306562424,
-0.06398241966962814,
-0.02603316865861416,
0.06675894558429718,
-0.059770114719867706,
0.06996025145053864,
-0.04810556024312973,
-0.040280651301145554,
-0.0872420072555542,
0.03595518693327904,
0.016779711470007896,
-0.014432243071496487,
-0.05356153845787048,
-0.054518964141607285,
-0.05338935926556587,
-0.021333377808332443,
0.0062155090272426605,
-0.006509941536933184,
-0.026406962424516678,
0.006446762941777706,
0.020782053470611572,
-0.08196444809436798,
0.0619075708091259,
0.03454706817865372,
0.017209069803357124,
0.04410536214709282,
-0.0386216826736927,
-0.018491989001631737,
-0.028114590793848038,
-0.0068818326108157635,
0.130685955286026,
-0.012495317496359348,
-0.00127532915212214,
-0.01654893532395363,
0.10284585505723953,
0.051813993602991104,
0.1328936219215393,
0.01529272273182869,
0.013599677942693233,
0.02649489790201187,
0.05027664825320244,
-0.010060091502964497,
-0.04921568185091019,
0.029527336359024048,
0.11642725765705109,
0.12495292723178864,
-0.00747478986158967,
-0.0028606269042938948,
0.036399468779563904,
0.014216245152056217,
-0.056505683809518814,
-0.03957647457718849,
-0.04894506186246872,
-0.014095953665673733,
-0.008807641454041004,
-0.04271315410733223,
0.028995441272854805,
-0.057392410933971405,
0.09660069644451141,
0.004441765137016773,
0.013332393951714039,
-0.04124806076288223,
0.06458631157875061,
-0.03165290504693985,
0.0757732093334198,
0.037779491394758224,
-0.030537264421582222,
0.05300801992416382,
0.03324906527996063,
-0.04186444357037544,
0.022700686007738113,
-0.04482191428542137,
0.03305315226316452,
0.017820758745074272,
0.015913674607872963,
-0.052052099257707596,
-0.0763416662812233,
0.038346629589796066,
-0.007927093654870987,
-0.011730927973985672,
0.08066091686487198,
0.06096721068024635,
0.04475108161568642,
0.061837390065193176,
-0.024684684351086617,
0.13049763441085815,
0.004923185799270868,
-0.06934557855129242,
-0.009229591116309166,
0.04401654750108719,
-0.0007229077746160328,
-0.06042281538248062,
0.09595829248428345,
-0.05089034512639046,
-0.0018944951007142663,
0.04754041135311127,
-0.14029058814048767,
2.5981147157278677e-33,
0.0344393327832222,
-0.004316333215683699,
-0.038611412048339844,
-0.013433901593089104,
-0.00006318793020909652,
0.020906439051032066,
-0.039010826498270035,
0.046128470450639725,
-0.06640265136957169,
-0.03173740208148956,
-0.03929579630494118,
0.10088714212179184,
0.049664583057165146,
-0.017745353281497955,
0.041683588176965714,
-0.007122981362044811,
0.045898325741291046,
0.07228709012269974,
-0.008555852808058262,
-0.01235990971326828,
0.03264555707573891,
-0.0240666251629591,
-0.014613745734095573,
-0.03382505476474762,
-0.00007534248288720846,
0.0022515873424708843,
-0.03302732855081558,
-0.06895662844181061,
-0.03089809976518154,
0.03530774638056755,
-0.08409320563077927,
0.019255653023719788,
0.05807821452617645,
0.01644609309732914,
0.016019754111766815,
0.03970140218734741,
-0.06343277543783188,
0.04588168114423752,
-0.0331956148147583,
-0.0921509861946106,
0.03589014708995819,
-0.01944146491587162,
0.01995103619992733,
-0.010589580051600933,
-0.04602564498782158,
-0.05740776285529137,
-0.08753050863742828,
-0.02605466917157173,
0.004921631887555122,
-0.019614148885011673,
0.006955781020224094,
0.006107195746153593,
0.08112511783838272,
-0.01686115190386772,
0.07892061024904251,
0.0261967945843935,
0.020260227844119072,
-0.04724503681063652,
-0.03281593322753906,
0.06220458820462227,
-0.01305160392075777,
-0.037207767367362976,
0.08467380702495575,
0.09103040397167206,
0.03178063780069351,
-0.02257191203534603,
0.09706664830446243,
0.0038145428989082575,
0.002780401613563299,
0.07631264626979828,
-0.017186112701892853,
0.025614352896809578,
-0.034182559698820114,
-0.01343240961432457,
-0.026740193367004395,
-0.06378751248121262,
-0.045129694044589996,
-0.052321188151836395,
-0.0730457529425621,
0.01882665790617466,
-0.0823863297700882,
0.026814041659235954,
-0.019474588334560394,
-0.014474132098257542,
-0.12263288348913193,
0.010973506607115269,
0.024987660348415375,
-0.010712070390582085,
-0.0816541314125061,
-0.07723157852888107,
-0.006238509900867939,
0.012499246746301651,
-0.04479116201400757,
-0.048143789172172546,
-0.02837001532316208,
-3.435169916611018e-33,
-0.004078972619026899,
-0.06794977188110352,
-0.006663272622972727,
0.07673744112253189,
0.01161930337548256,
-0.04133595898747444,
0.0315982885658741,
-0.017419882118701935,
-0.09398030489683151,
-0.07104164361953735,
-0.001588069717399776,
-0.04232184588909149,
-0.025815563276410103,
0.0046834442764520645,
-0.052988212555646896,
0.029229464009404182,
0.0017309031682088971,
-0.11592334508895874,
0.07085936516523361,
-0.025037989020347595,
-0.026775658130645752,
-0.04338889569044113,
-0.033386584371328354,
0.08028663694858551,
-0.011983667500317097,
-0.016015920788049698,
-0.04242480918765068,
-0.028635859489440918,
0.00002158104325644672,
-0.03490161895751953,
-0.022262170910835266,
-0.019643766805529594,
0.01788049004971981,
0.030737733468413353,
-0.05681753531098366,
0.06498169898986816,
0.01553040649741888,
-0.0008926380542106926,
0.04777398705482483,
0.018357891589403152,
0.07187684625387192,
0.06332842260599136,
-0.12205174565315247,
-0.010316007770597935,
0.013554217293858528,
0.0075656939297914505,
-0.014410905539989471,
0.08842329680919647,
0.00744521152228117,
-0.06035817414522171,
-0.020404670387506485,
-0.0625939890742302,
0.03132515028119087,
0.07429991662502289,
-0.01345824170857668,
0.04274332895874977,
-0.02765495516359806,
0.11991720646619797,
-0.09801074117422104,
0.08242496103048325,
-0.008669883944094181,
0.00851195678114891,
-0.06474699079990387,
0.06368758529424667,
-0.06283202022314072,
0.00968261994421482,
-0.024788198992609978,
-0.08383346349000931,
-0.051026567816734314,
-0.01880500838160515,
0.0015674151945859194,
0.03947080671787262,
-0.02990698255598545,
0.017329372465610504,
0.017720714211463928,
-0.0003211005823686719,
-0.00020255852723494172,
-0.013373310677707195,
-0.031043343245983124,
0.017941147089004517,
-0.08052390813827515,
0.06932273507118225,
-0.007707450073212385,
0.07160636782646179,
0.005683408584445715,
0.03880438581109047,
0.009082085452973843,
0.11361030489206314,
-0.040825046598911285,
-0.0020350695122033358,
-0.04650302976369858,
-0.03173251822590828,
-0.1725403517484665,
-0.006767138373106718,
-0.07421404123306274,
-5.680729486812197e-8,
0.006874585524201393,
0.07697867602109909,
-0.020382512360811234,
0.0403512641787529,
0.015967294573783875,
-0.01550909411162138,
0.051092490553855896,
0.035396091639995575,
-0.04544428735971451,
0.05780825391411781,
-0.014886411838233471,
-0.019300784915685654,
-0.06488621234893799,
0.03888969495892525,
0.026683753356337547,
0.023023275658488274,
0.0009908083593472838,
0.08980407565832138,
-0.0873093530535698,
-0.02882806956768036,
-0.009032247588038445,
0.011866268701851368,
0.008733241818845272,
0.040179505944252014,
0.05386076122522354,
-0.021034227684140205,
0.04527925327420235,
-0.010162650607526302,
0.01762111857533455,
0.026891810819506645,
-0.03996840864419937,
-0.07002125680446625,
0.01719760335981846,
-0.00711408257484436,
-0.038785241544246674,
0.12853571772575378,
-0.10414723306894302,
0.00939884688705206,
0.027392268180847168,
0.09390263259410858,
0.0035532519686967134,
0.009553086943924427,
-0.01447570975869894,
0.027609610930085182,
0.030580561608076096,
0.032693348824977875,
-0.051376476883888245,
0.0946458950638771,
0.01756296306848526,
-0.011946062557399273,
-0.04506208375096321,
-0.006643571890890598,
0.03252219781279564,
0.0815337598323822,
-0.013082874938845634,
-0.04798548296093941,
-0.014812298119068146,
-0.0563063845038414,
0.13547755777835846,
0.025729263201355934,
0.08849494159221649,
-0.040788691490888596,
-0.03669910877943039,
-0.05580013245344162
] | 0.106579
|
But in this example, this sudden extra load would cause the hardware in the remaining zone to be overloaded. Forced awareness solves this problem by \*NEVER\* allowing copies of the same shard to be allocated to the same zone. For example, lets say we have an awareness attribute called `zone`, and we know we are going to have two zones, `zone1` and `zone2`. Here is how we can force awareness on a node: [source,yaml] ------------------------------------------------------------------- cluster.routing.allocation.awareness.force.zone.values: zone1,zone2 <1> cluster.routing.allocation.awareness.attributes: zone ------------------------------------------------------------------- <1> We must list all possible values that the `zone` attribute can have. Now, if we start 2 nodes with `node.attr.zone` set to `zone1` and create an index with 5 shards and 1 replica. The index will be created, but only the 5 primary shards will be allocated (with no replicas). Only when we start more nodes with `node.attr.zone` set to `zone2` will the replicas be allocated. The `cluster.routing.allocation.awareness.\*` settings can all be updated dynamically on a live cluster with the <> API.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/cluster/allocation_awareness.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.04432641714811325,
-0.032469529658555984,
0.00905682984739542,
0.0706460252404213,
0.04591481387615204,
-0.054497137665748596,
0.03496100753545761,
-0.05982590094208717,
0.03951217606663704,
0.0531308688223362,
0.0085228206589818,
-0.01837659627199173,
0.04752665013074875,
-0.10936563462018967,
-0.013108941726386547,
0.051863428205251694,
0.027056248858571053,
-0.0199199877679348,
-0.05843878537416458,
-0.04936157912015915,
0.07774049788713455,
0.013362850993871689,
0.0036762121599167585,
-0.009168756194412708,
-0.08434908837080002,
-0.01804330199956894,
-0.03009875677525997,
0.04569431394338608,
0.1273016780614853,
-0.0678308755159378,
0.014165099710226059,
0.03134642913937569,
-0.0988573357462883,
0.006750412285327911,
-0.039313238114118576,
0.12534475326538086,
-0.05707123875617981,
-0.03175455331802368,
-0.08276855200529099,
-0.013975200243294239,
0.06228237971663475,
0.018300572410225868,
0.00006138577737146989,
-0.019517140462994576,
-0.06127553805708885,
0.010209336876869202,
-0.06149333715438843,
0.06932882964611053,
-0.01577950455248356,
-0.08722372353076935,
0.018587613478302956,
-0.16055260598659515,
0.02392868511378765,
-0.011125682853162289,
0.0568675696849823,
0.05024772509932518,
0.04036905989050865,
-0.028941601514816284,
-0.021785574033856392,
-0.04452889785170555,
-0.04378937929868698,
-0.01939360983669758,
0.016765817999839783,
-0.01719014160335064,
0.12038066983222961,
0.07922129333019257,
0.022358495742082596,
0.05124964192509651,
-0.020482735708355904,
0.08061914145946503,
0.07712280750274658,
-0.04424086958169937,
0.012475013732910156,
-0.023810137063264847,
0.0650320053100586,
0.05210398510098457,
-0.1007467582821846,
0.032445795834064484,
-0.004281011875718832,
-0.026892688125371933,
-0.02565610408782959,
-0.02016795240342617,
0.007803809829056263,
-0.03240369260311127,
-0.032772887498140335,
-0.048899244517087936,
-0.030499577522277832,
-0.04468505457043648,
0.11374903470277786,
0.03725387528538704,
0.00001639698166400194,
-0.0022184886038303375,
0.06406565755605698,
-0.025731509551405907,
0.09251512587070465,
-0.01305724959820509,
-0.003118134569376707,
-0.0005542259314097464,
-0.016103802248835564,
-0.005149370990693569,
0.03720586374402046,
0.015473891980946064,
-0.04449984431266785,
0.05055880919098854,
0.010256093926727772,
-0.014050930738449097,
-0.1070188358426094,
-0.001304635195992887,
-0.035047098994255066,
0.06045269966125488,
0.018939539790153503,
0.06876800209283829,
0.00241813319735229,
-0.048991963267326355,
-0.05716140568256378,
0.03490789607167244,
0.1186801865696907,
0.005207560956478119,
-0.0778493881225586,
-0.003019705880433321,
-0.008202767930924892,
-0.09487194567918777,
0.06648637354373932,
-0.02343488670885563,
0.015096748247742653,
-0.02224576473236084,
-0.11742821335792542,
-5.545793900741436e-33,
-0.007375793997198343,
-0.09302889555692673,
-0.04499306157231331,
-0.03909161686897278,
-0.013923079706728458,
0.0004891775897704065,
0.02162305638194084,
-0.024832502007484436,
-0.03391927108168602,
-0.02408190444111824,
-0.0425918772816658,
0.05588969215750694,
0.027258338406682014,
-0.06953784823417664,
0.05031714588403702,
-0.07391843944787979,
0.05632060766220093,
0.10159430652856827,
-0.015834355726838112,
-0.0113257747143507,
0.05205516889691353,
-0.02112952433526516,
-0.030807917937636375,
-0.08627720177173615,
-0.052778374403715134,
-0.007732211612164974,
-0.00013425378710962832,
-0.020816871896386147,
-0.025630440562963486,
0.026694990694522858,
-0.019839052110910416,
0.016279565170407295,
0.022550217807292938,
0.034656304866075516,
-0.03758397698402405,
0.042239584028720856,
0.02030840329825878,
0.0008965726010501385,
-0.0320686399936676,
-0.08944319933652878,
0.045821551233530045,
-0.0000791593047324568,
0.0526311956346035,
-0.03690566122531891,
-0.020894730463624,
-0.08484553545713425,
-0.026831714436411858,
-0.0583888478577137,
-0.05759711191058159,
-0.003161379834637046,
0.02116694301366806,
-0.009342874400317669,
0.036821089684963226,
-0.043017830699682236,
-0.0054857018403708935,
-0.06239262595772743,
-0.011537515558302402,
-0.0358123816549778,
-0.017608938738703728,
0.14170926809310913,
-0.024167178198695183,
-0.04816712811589241,
-0.027993788942694664,
0.08841763436794281,
0.05496132746338844,
0.021759914234280586,
0.01516638696193695,
0.0009790153708308935,
0.012580618262290955,
0.059413760900497437,
-0.035998083651065826,
-0.007285427302122116,
-0.030891750007867813,
0.052348628640174866,
-0.0841803327202797,
-0.05727383866906166,
-0.04508305713534355,
-0.057876359671354294,
-0.10056696087121964,
-0.0517510324716568,
-0.07616458833217621,
0.024169834330677986,
-0.07742971181869507,
0.02354530803859234,
0.025341011583805084,
-0.048312708735466,
-0.0022743905428797007,
-0.02633761800825596,
-0.17363926768302917,
-0.035495009273290634,
-0.03545176610350609,
-0.03796662390232086,
0.02578633278608322,
-0.03587564826011658,
-0.012712239287793636,
8.781609526344595e-34,
0.023706156760454178,
0.01554951909929514,
-0.03737780079245567,
0.051484182476997375,
0.03931909054517746,
-0.03386965021491051,
0.017370739951729774,
-0.014327527955174446,
-0.05110463500022888,
0.0008505172445438802,
-0.09922363609075546,
-0.01770884171128273,
0.0024248273111879826,
-0.014376118779182434,
0.011645898222923279,
-0.008321758359670639,
0.0013310135109350085,
-0.04078305885195732,
-0.01612030901014805,
0.028744535520672798,
-0.0008262591436505318,
-0.006057497579604387,
0.022170474752783775,
0.024313442409038544,
0.009372424334287643,
0.00834514107555151,
-0.08374303579330444,
0.04319007694721222,
-0.06603140383958817,
0.018370090052485466,
-0.03127303719520569,
-0.05354899913072586,
-0.04411713033914566,
0.03685896843671799,
-0.030594347044825554,
-0.025806566700339317,
0.006442770827561617,
0.09282868355512619,
0.040159136056900024,
0.005326514597982168,
0.030596250668168068,
0.02527572587132454,
-0.13815461099147797,
0.0624418742954731,
-0.008198950439691544,
-0.021462539210915565,
0.018408451229333878,
0.02615116722881794,
-0.08783275634050369,
0.012374155223369598,
-0.010307753458619118,
-0.04333367571234703,
0.02880125679075718,
0.1534373015165329,
-0.0004973856848664582,
0.09314104169607162,
0.029340991750359535,
0.09437956660985947,
-0.029964426532387733,
-0.0015443075681105256,
0.07299350202083588,
-0.08039317280054092,
-0.040931347757577896,
0.0046394080854952335,
0.056134309619665146,
-0.0024194393772631884,
0.062028419226408005,
0.0011976378737017512,
0.03686223179101944,
-0.0070418789982795715,
-0.032626017928123474,
0.148728147149086,
-0.03604467585682869,
-0.01041488815099001,
0.03766859695315361,
-0.00026604431332089007,
-0.019364094361662865,
-0.01138257421553135,
-0.026100430637598038,
-0.02135368622839451,
-0.12491948902606964,
0.037315208464860916,
-0.022940561175346375,
0.005140981171280146,
0.0680481493473053,
0.046272024512290955,
0.06336414813995361,
0.0757906585931778,
0.01106210332363844,
0.03656260296702385,
-0.08857955783605576,
0.012733937241137028,
-0.057130973786115646,
-0.0056076208129525185,
-0.08534731715917587,
-5.053591323189721e-8,
-0.06423266977071762,
-0.006844759918749332,
-0.061131443828344345,
0.013944399543106556,
0.062053803354501724,
-0.03674767538905144,
-0.03636949881911278,
-0.008268645964562893,
-0.07607623189687729,
0.003178421640768647,
0.037586651742458344,
0.020615577697753906,
0.018185824155807495,
-0.01667257584631443,
-0.023999040946364403,
0.0002907745656557381,
-0.001125858980230987,
0.040612924844026566,
-0.10349445790052414,
-0.06717409938573837,
-0.025877373293042183,
-0.019713470712304115,
-0.06140705198049545,
0.09613905102014542,
0.024457214400172234,
-0.03369936719536781,
0.013962054625153542,
0.006251645274460316,
0.09417044371366501,
0.07066083699464798,
-0.011841041035950184,
-0.05891893804073334,
-0.018901363015174866,
0.053425755351781845,
-0.05488524213433266,
0.08447297662496567,
0.00967989768832922,
0.0036686465609818697,
0.038776710629463196,
0.06449180841445923,
-0.01596651040017605,
0.025412678718566895,
-0.0234382301568985,
0.06973110884428024,
0.05422252416610718,
0.06264980137348175,
-0.08796650916337967,
0.030677642673254013,
0.02261236682534218,
0.0299864262342453,
-0.03204456716775894,
-0.004603696055710316,
0.00015316724602598697,
0.09437571465969086,
0.050348713994026184,
-0.079585000872612,
-0.037467002868652344,
-0.035425107926130295,
0.07389897108078003,
0.08791658282279968,
0.061104223132133484,
-0.025125475600361824,
-0.007081120740622282,
-0.024506689980626106
] | 0.12559
|
[[shards-allocation]] === Cluster Level Shard Allocation Shard allocation is the process of allocating shards to nodes. This can happen during initial recovery, replica allocation, rebalancing, or when nodes are added or removed. [float] === Shard Allocation Settings The following \_dynamic\_ settings may be used to control shard allocation and recovery: `cluster.routing.allocation.enable`:: + -- Enable or disable allocation for specific kinds of shards: \* `all` - (default) Allows shard allocation for all kinds of shards. \* `primaries` - Allows shard allocation only for primary shards. \* `new\_primaries` - Allows shard allocation only for primary shards for new indices. \* `none` - No shard allocations of any kind are allowed for any indices. This setting does not affect the recovery of local primary shards when restarting a node. A restarted node that has a copy of an unassigned primary shard will recover that primary immediately, assuming that its allocation id matches one of the active allocation ids in the cluster state. -- `cluster.routing.allocation.node\_concurrent\_incoming\_recoveries`:: How many concurrent incoming shard recoveries are allowed to happen on a node. Incoming recoveries are the recoveries where the target shard (most likely the replica unless a shard is relocating) is allocated on the node. Defaults to `2`. `cluster.routing.allocation.node\_concurrent\_outgoing\_recoveries`:: How many concurrent outgoing shard recoveries are allowed to happen on a node. Outgoing recoveries are the recoveries where the source shard (most likely the primary unless a shard is relocating) is allocated on the node. Defaults to `2`. `cluster.routing.allocation.node\_concurrent\_recoveries`:: A shortcut to set both `cluster.routing.allocation.node\_concurrent\_incoming\_recoveries` and `cluster.routing.allocation.node\_concurrent\_outgoing\_recoveries`. `cluster.routing.allocation.node\_initial\_primaries\_recoveries`:: While the recovery of replicas happens over the network, the recovery of an unassigned primary after node restart uses data from the local disk. These should be fast so more initial primary recoveries can happen in parallel on the same node. Defaults to `4`. `cluster.routing.allocation.same\_shard.host`:: Allows to perform a check to prevent allocation of multiple instances of the same shard on a single host, based on host name and host address. Defaults to `false`, meaning that no check is performed by default. This setting only applies if multiple nodes are started on the same machine. [float] === Shard Rebalancing Settings The following \_dynamic\_ settings may be used to control the rebalancing of shards across the cluster: `cluster.routing.rebalance.enable`:: + -- Enable or disable rebalancing for specific kinds of shards: \* `all` - (default) Allows shard balancing for all kinds of shards. \* `primaries` - Allows shard balancing only for primary shards. \* `replicas` - Allows shard balancing only for replica shards. \* `none` - No shard balancing of any kind are allowed for any indices. -- `cluster.routing.allocation.allow\_rebalance`:: + -- Specify when shard rebalancing is allowed: \* `always` - Always allow rebalancing. \* `indices\_primaries\_active` - Only when all primaries in the cluster are allocated. \* `indices\_all\_active` - (default) Only when all shards (primaries and replicas) in the cluster are allocated. -- `cluster.routing.allocation.cluster\_concurrent\_rebalance`:: Allow to control how many concurrent shard rebalances are allowed cluster wide. Defaults to `2`. Note that this setting only controls the number of concurrent shard relocations due to imbalances in the cluster. This setting does not limit shard relocations due to <> or <>. [float] === Shard Balancing Heuristics The following settings are used together to determine where to place each shard. The cluster is balanced when no allowed rebalancing operation can bring the weight of any node closer to the weight of any other node by more than the `balance.threshold`. `cluster.routing.allocation.balance.shard`:: Defines the weight factor for the total number of shards allocated on a node (float). Defaults to `0.45f`. Raising this raises the tendency to equalize the number of shards across all nodes in the cluster. `cluster.routing.allocation.balance.index`:: Defines
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/cluster/shards_allocation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.041219890117645264,
-0.027321137487888336,
0.008986079134047031,
0.04925564303994179,
0.012787348590791225,
-0.01778898946940899,
-0.02582789771258831,
-0.06809819489717484,
0.03964274004101753,
0.00525709381327033,
0.02216182090342045,
0.03843473643064499,
0.019572671502828598,
0.0034978778567165136,
-0.08082301169633865,
-0.018967701122164726,
0.0006857632542960346,
-0.015736831352114677,
-0.05395277962088585,
0.043526820838451385,
-0.003570388536900282,
-0.0455341599881649,
-0.006874651648104191,
0.006613728124648333,
-0.0421256348490715,
-0.04541550576686859,
-0.04771929606795311,
0.017761558294296265,
0.043160580098629,
-0.026180198416113853,
-0.02123599499464035,
-0.017284737899899483,
0.0035377421882003546,
-0.00116018729750067,
0.03715956211090088,
0.12259508669376373,
-0.015356664545834064,
-0.039351023733615875,
-0.10343793779611588,
-0.029945706948637962,
0.04240075498819351,
-0.023813925683498383,
-0.07864868640899658,
-0.03885044530034065,
-0.04010794311761856,
0.029155191034078598,
-0.07274969667196274,
0.03358506038784981,
-0.04450300335884094,
-0.035536788403987885,
0.02913542091846466,
-0.0336049348115921,
-0.0007561940001323819,
0.10672876983880997,
0.03314976021647453,
0.0594780296087265,
-0.021988963708281517,
0.0008778441697359085,
0.037134233862161636,
-0.04438747838139534,
0.08021733909845352,
-0.02726210281252861,
0.01564268209040165,
-0.01096720714122057,
0.05141592398285866,
0.0248687993735075,
0.09584172070026398,
-0.025573424994945526,
0.0033615794964134693,
-0.012821119278669357,
-0.03455858305096626,
0.06367307901382446,
-0.0664183720946312,
0.03285899758338928,
0.007184320595115423,
0.07561864703893661,
0.02535579912364483,
0.03692339360713959,
-0.008063402026891708,
0.026769714429974556,
-0.0820939764380455,
-0.008611956611275673,
0.037685029208660126,
0.0029784408397972584,
-0.03656797111034393,
-0.008110026828944683,
-0.0870203897356987,
-0.024922527372837067,
0.06622814387083054,
0.04276375100016594,
-0.044153034687042236,
0.03347841277718544,
0.09833431243896484,
-0.021230274811387062,
0.05696398764848709,
0.03431931883096695,
-0.02077869139611721,
0.06758707016706467,
0.04977385699748993,
-0.005295492243021727,
0.023298140615224838,
-0.038930170238018036,
0.014545517042279243,
-0.007575387600809336,
-0.014283561147749424,
-0.040579576045274734,
-0.06103144586086273,
0.022236976772546768,
-0.02568414807319641,
0.0047624241560697556,
0.06440029293298721,
0.04007883742451668,
0.038299690932035446,
0.017721788957715034,
-0.02145305648446083,
0.1531803160905838,
0.012171697802841663,
-0.027728388085961342,
-0.07701094448566437,
0.013100698590278625,
0.0045327371917665005,
-0.05191256105899811,
0.11036665737628937,
-0.020898237824440002,
-0.053645484149456024,
0.02169245108962059,
-0.14941450953483582,
4.055083025564475e-33,
0.04259266331791878,
-0.061504971235990524,
0.013843540102243423,
-0.007069468963891268,
0.037701357156038284,
-0.02024250291287899,
-0.03413663059473038,
0.0014029983431100845,
-0.06094261258840561,
-0.08228690177202225,
-0.07907216250896454,
0.09285993129014969,
0.05280347540974617,
-0.03255677968263626,
0.018788859248161316,
-0.09808548539876938,
0.08293610066175461,
0.15580525994300842,
0.019024735316634178,
-0.029460905119776726,
0.034620653837919235,
0.043875910341739655,
0.0065680877305567265,
-0.04938524588942528,
-0.011106304824352264,
0.02741055190563202,
-0.03063674084842205,
-0.11860289424657822,
-0.05574878305196762,
0.01522213127464056,
-0.05211978033185005,
-0.029190946370363235,
0.05573216825723648,
0.029132062569260597,
-0.003469530027359724,
0.04198402538895607,
-0.017455697059631348,
-0.023626849055290222,
-0.058846764266490936,
-0.11399132758378983,
0.04691940173506737,
0.015955990180373192,
0.0943971499800682,
-0.016849728301167488,
-0.0654871016740799,
-0.03487253189086914,
-0.03728153184056282,
0.017832325771450996,
-0.05275696516036987,
-0.0031685084104537964,
0.019970927387475967,
0.005093147978186607,
0.03945697098970413,
0.003936799243092537,
-0.039682433009147644,
0.0033373867627233267,
0.012419390492141247,
-0.03793474659323692,
-0.01717512495815754,
0.022160978987812996,
0.05124634876847267,
-0.020365025848150253,
-0.0188418161123991,
0.07950184494256973,
-0.003101266920566559,
0.026871446520090103,
0.029849743470549583,
0.038628578186035156,
0.03902823105454445,
0.0727502852678299,
-0.0615929551422596,
0.08028261363506317,
-0.009181275963783264,
0.07281368970870972,
-0.058771319687366486,
-0.06517234444618225,
-0.023245010524988174,
-0.084056057035923,
-0.12409888952970505,
0.03619637340307236,
-0.08689764887094498,
0.017865099012851715,
-0.07055317610502243,
-0.053771261125802994,
-0.09898010641336441,
-0.006832698360085487,
0.038695596158504486,
-0.03332522138953209,
0.0011513292556628585,
-0.07521925121545792,
0.002236108062788844,
-0.042763836681842804,
0.007852783426642418,
-0.02360174059867859,
-0.051339343190193176,
-5.501889186738224e-33,
0.019575728103518486,
-0.025099504739046097,
-0.020603492856025696,
-0.0006773862987756729,
0.013257184065878391,
0.011033033952116966,
0.02260306105017662,
0.0206875242292881,
-0.0220126174390316,
-0.11052559316158295,
-0.0011862375540658832,
-0.03519251197576523,
0.03490905836224556,
-0.010457239113748074,
-0.06727766990661621,
0.025745252147316933,
-0.031662702560424805,
-0.08176064491271973,
0.046001631766557693,
0.029720935970544815,
-0.029232202097773552,
-0.02600291557610035,
-0.0094716502353549,
0.02839694917201996,
-0.01173306629061699,
0.023310823366045952,
-0.014952861703932285,
-0.027301989495754242,
-0.015411820262670517,
0.020545609295368195,
0.003963438328355551,
-0.041244227439165115,
-0.05645490810275078,
-0.0009728946606628597,
-0.0005638633156195283,
0.020113950595259666,
-0.04941990599036217,
-0.01043796818703413,
0.03874136507511139,
0.016228707507252693,
0.08004316687583923,
-0.012928081676363945,
-0.06679491698741913,
0.060053013265132904,
-0.012881427071988583,
0.03540824353694916,
0.03052411787211895,
0.037537816911935806,
0.006747037172317505,
-0.04989999160170555,
-0.00257543264888227,
-0.06944044679403305,
0.0904928594827652,
0.15710419416427612,
0.039036598056554794,
0.1264871060848236,
0.005934948101639748,
0.12874792516231537,
-0.0648684948682785,
0.02473430149257183,
0.017006630077958107,
-0.06565960496664047,
-0.09333635866641998,
0.040191393345594406,
-0.04614373296499252,
0.004178515635430813,
-0.046436816453933716,
-0.08956880122423172,
-0.07641884684562683,
-0.030292032286524773,
-0.05487663671374321,
0.04718952253460884,
0.014037616550922394,
0.04674430936574936,
0.011034704744815826,
-0.056705184280872345,
-0.04069473594427109,
-0.025518864393234253,
-0.004233065992593765,
0.06305745244026184,
-0.13108113408088684,
0.10633907467126846,
-0.030527180060744286,
-0.0010972657473757863,
0.05145172029733658,
-0.12993144989013672,
0.07674083113670349,
0.07613937556743622,
-0.03748713806271553,
0.035920534282922745,
-0.0705508142709732,
0.00819608848541975,
-0.04603024199604988,
0.015225389041006565,
-0.03727182373404503,
-4.149735843839153e-8,
0.010044007562100887,
0.030098726972937584,
-0.02000214345753193,
0.08167480677366257,
0.04347272589802742,
-0.02416282519698143,
0.032677002251148224,
0.005964615847915411,
-0.07872145622968674,
0.025091659277677536,
-0.016721300780773163,
0.02063002623617649,
-0.046636614948511124,
-0.072269007563591,
-0.010538357309997082,
0.0074404506012797356,
0.015209370292723179,
0.04134747385978699,
-0.046853821724653244,
-0.07377226650714874,
-0.03043529763817787,
-0.03061257116496563,
0.02110685594379902,
0.0507349818944931,
0.009872639551758766,
0.007911717519164085,
0.07277695089578629,
-0.001235888572409749,
-0.01408277079463005,
0.03962958976626396,
-0.03974208980798721,
-0.01559192594140768,
0.05658554285764694,
0.018314532935619354,
-0.0564265139400959,
0.17596833407878876,
-0.1467781513929367,
0.06631544977426529,
0.054259043186903,
0.07785562425851822,
-0.03664805740118027,
0.021436139941215515,
-0.015448207035660744,
0.011902968399226665,
0.003813858376815915,
0.02195865660905838,
-0.09091374278068542,
0.07406103610992432,
-0.01878424547612667,
0.03621625155210495,
-0.0200581643730402,
0.016650576144456863,
0.06564579159021378,
0.028272435069084167,
0.010024724528193474,
0.03339172527194023,
0.00427485816180706,
-0.018338782712817192,
0.08135111629962921,
0.05442933365702629,
0.07808200269937515,
-0.004784827586263418,
-0.014002221636474133,
-0.1032930240035057
] | 0.114679
|
to the weight of any other node by more than the `balance.threshold`. `cluster.routing.allocation.balance.shard`:: Defines the weight factor for the total number of shards allocated on a node (float). Defaults to `0.45f`. Raising this raises the tendency to equalize the number of shards across all nodes in the cluster. `cluster.routing.allocation.balance.index`:: Defines the weight factor for the number of shards per index allocated on a specific node (float). Defaults to `0.55f`. Raising this raises the tendency to equalize the number of shards per index across all nodes in the cluster. `cluster.routing.allocation.balance.threshold`:: Minimal optimization value of operations that should be performed (non negative float). Defaults to `1.0f`. Raising this will cause the cluster to be less aggressive about optimizing the shard balance. NOTE: Regardless of the result of the balancing algorithm, rebalancing might not be allowed due to forced awareness or allocation filtering.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/cluster/shards_allocation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.07112451642751694,
-0.019510366022586823,
0.014090541750192642,
0.04407266154885292,
0.0002669012174010277,
-0.06498612463474274,
-0.028066059574484825,
-0.014069238677620888,
0.03114091418683529,
0.022901052609086037,
-0.0607491098344326,
0.009577049873769283,
0.02030571922659874,
-0.016350464895367622,
-0.07931400090456009,
-0.0048220292665064335,
0.03693600371479988,
0.04197316616773605,
-0.07894904911518097,
-0.012202908284962177,
0.0022953299339860678,
-0.05687515810132027,
-0.011406950652599335,
0.020772352814674377,
-0.048400651663541794,
-0.03162635117769241,
-0.09331357479095459,
-0.013697576709091663,
0.019524725154042244,
-0.03553337976336479,
0.007036072667688131,
0.014592727646231651,
-0.018168287351727486,
0.006104640197008848,
-0.10455647110939026,
0.07024792581796646,
-0.03569905087351799,
-0.0625474825501442,
-0.09949549287557602,
-0.0026033511385321617,
0.018323101103305817,
0.04999827221035957,
-0.04614248126745224,
0.0067635648883879185,
-0.04357912018895149,
0.009111843071877956,
-0.0962875634431839,
0.014338713139295578,
-0.01581837609410286,
0.008475344628095627,
0.02036687359213829,
-0.03082193434238434,
-0.03249817714095116,
0.04715381935238838,
-0.021578822284936905,
0.04108358919620514,
0.041474658995866776,
-0.006498944479972124,
0.0207124762237072,
-0.07155712693929672,
0.06698230654001236,
-0.03785030171275139,
0.04156697914004326,
-0.0069965701550245285,
0.06293901801109314,
-0.029466670006513596,
0.12950566411018372,
-0.03416113555431366,
-0.02498222328722477,
0.04002028703689575,
0.06464487314224243,
0.0207462627440691,
-0.04892697557806969,
0.030156301334500313,
0.023126134648919106,
0.07626627385616302,
0.022048084065318108,
0.003959878347814083,
-0.0021741767413914204,
0.04603370651602745,
-0.0650274008512497,
-0.0017886452842503786,
0.02141694165766239,
0.00480802683159709,
-0.0015236589824780822,
-0.09546160697937012,
-0.0564778633415699,
-0.05987250432372093,
0.0782736986875534,
0.04338419809937477,
0.004991405643522739,
0.0958833247423172,
0.05422383174300194,
-0.048224616795778275,
0.02334478683769703,
0.04251176863908768,
-0.09432853758335114,
0.04493745043873787,
-0.00031144224340096116,
0.006226766854524612,
0.005574566312134266,
-0.009728243574500084,
0.027373049408197403,
-0.012057353742420673,
0.023766234517097473,
-0.0018007168546319008,
-0.02035233937203884,
0.046309731900691986,
-0.006736526731401682,
0.03304600715637207,
0.07083628326654434,
0.03909551724791527,
0.03288792446255684,
0.0027542340103536844,
-0.011239342391490936,
0.14746664464473724,
0.10517570376396179,
-0.03502338379621506,
-0.09607619047164917,
0.050860390067100525,
0.007481007371097803,
-0.009803958237171173,
0.05669543147087097,
-0.01965619996190071,
-0.012010641396045685,
0.047530483454465866,
-0.15065380930900574,
1.5286326902764728e-33,
-0.016933856531977654,
-0.045164644718170166,
0.04246468096971512,
-0.08152692019939423,
0.025928517803549767,
-0.018230661749839783,
-0.05770496279001236,
0.012379651889204979,
-0.08588467538356781,
-0.06334001570940018,
-0.10060121864080429,
0.10425661504268646,
0.05011057108640671,
-0.08399254083633423,
0.05145789682865143,
-0.12853600084781647,
0.0561738982796669,
0.12571440637111664,
0.052468352019786835,
-0.08268529176712036,
0.04857292026281357,
-0.1090003177523613,
0.0010116075864061713,
-0.03727595508098602,
-0.01320022251456976,
-0.006023078225553036,
-0.02362256497144699,
-0.09058839082717896,
-0.05322323366999626,
0.0019854854326695204,
-0.0191123578697443,
-0.004823414143174887,
0.029405303299427032,
-0.02246098220348358,
-0.03829911723732948,
0.0033951555378735065,
0.004106142558157444,
0.03320574760437012,
-0.011996932327747345,
-0.09522616863250732,
0.025454221293330193,
0.03059050627052784,
0.09964622557163239,
-0.039655789732933044,
-0.05119745433330536,
0.014881723560392857,
-0.01670096255838871,
0.015134860761463642,
-0.07228924334049225,
0.041489239782094955,
0.03805559501051903,
-0.025768108665943146,
0.03804827108979225,
0.06423597782850266,
-0.0070419334806501865,
-0.012456946074962616,
0.04611395671963692,
-0.00004124284896533936,
-0.01662655733525753,
0.08194932341575623,
0.053011465817689896,
-0.07030532509088516,
-0.004064261447638273,
0.07992683351039886,
0.03078334406018257,
0.035541560500860214,
0.036049630492925644,
0.07773833721876144,
-0.0058612884022295475,
0.0877598375082016,
-0.021010030061006546,
0.07245678454637527,
-0.0019448548555374146,
0.07779423892498016,
-0.07243070751428604,
-0.05840092524886131,
-0.010890893638134003,
-0.04722036421298981,
-0.07145857065916061,
0.0031032476108521223,
-0.08879747986793518,
0.07796815782785416,
-0.008839227259159088,
-0.04282233119010925,
-0.04654429852962494,
-0.010762515477836132,
0.034833844751119614,
-0.009357682429254055,
-0.05172841250896454,
0.007043665274977684,
-0.005140999797731638,
-0.056454434990882874,
0.02027014270424843,
0.003035578178241849,
-0.04320017620921135,
-1.5511753658473826e-33,
-0.04474598914384842,
-0.01493031345307827,
-0.03843154385685921,
0.048420000821352005,
0.07293585687875748,
-0.007889100350439548,
0.05730424448847771,
0.0026406061369925737,
0.00176178477704525,
-0.05275845155119896,
0.015615798532962799,
-0.02736656926572323,
0.014025905169546604,
-0.0001621745468582958,
-0.04775827005505562,
-0.009561717510223389,
0.01591932401061058,
-0.026631316170096397,
0.03810078278183937,
-0.0003807667817454785,
-0.03780646249651909,
-0.004782151896506548,
-0.03417117893695831,
0.03877926617860794,
0.0033842583652585745,
0.021925944834947586,
-0.009002638049423695,
-0.04893714189529419,
-0.007226177025586367,
0.03813820704817772,
-0.014518625102937222,
-0.03766487166285515,
-0.01325503271073103,
-0.040644653141498566,
0.017087247222661972,
0.029043158516287804,
-0.022863518446683884,
0.05356704071164131,
0.07696326822042465,
0.07447004318237305,
0.07596420496702194,
-0.012295304797589779,
-0.08442927151918411,
0.01595868170261383,
-0.003936937544494867,
0.0024904224555939436,
0.021208198741078377,
0.0022704380098730326,
-0.017129341140389442,
-0.049136653542518616,
-0.018920181319117546,
-0.06388446688652039,
0.07314717024564743,
0.20505446195602417,
0.007086366880685091,
0.11031065136194229,
-0.029021093621850014,
0.14417828619480133,
-0.03527044877409935,
0.0017931823385879397,
0.013901344500482082,
0.004129826091229916,
-0.09018614888191223,
-0.0018899053102359176,
-0.025157539173960686,
0.025234537199139595,
0.006053083576261997,
-0.059495970606803894,
-0.0537400059401989,
-0.00328842387534678,
-0.07421724498271942,
0.042416125535964966,
0.07285953313112259,
0.06219489872455597,
0.0028725070878863335,
-0.06893108785152435,
0.023267051205039024,
0.020486092194914818,
0.0048378645442426205,
0.009577052667737007,
-0.07782963663339615,
0.09857436269521713,
0.02173445373773575,
-0.01669044978916645,
0.041302092373371124,
-0.060392268002033234,
0.03845428675413132,
0.06023383513092995,
-0.015027586370706558,
0.06927726417779922,
-0.05973879247903824,
-0.03682054951786995,
-0.017416132614016533,
-0.05988093093037605,
-0.03728153184056282,
-4.08184774869369e-8,
0.007443147245794535,
0.02434760332107544,
-0.019806941971182823,
0.07857125252485275,
0.04702143371105194,
0.01856979727745056,
0.03208312764763832,
0.04088519513607025,
-0.0808250829577446,
0.05405041575431824,
0.021994104608893394,
0.03256633132696152,
-0.03966102376580238,
-0.023811208084225655,
0.001400271663442254,
0.0185691025108099,
-0.01316139753907919,
0.011289048939943314,
-0.04154212400317192,
-0.05880536139011383,
-0.09086541086435318,
-0.026438429951667786,
-0.03384770080447197,
0.01898215524852276,
-0.018627174198627472,
-0.026744691655039787,
0.05602503940463066,
-0.03227115049958229,
0.05567904934287071,
-0.015237106010317802,
-0.07547861337661743,
-0.02635014057159424,
-0.009500483050942421,
0.012690695933997631,
-0.022154565900564194,
0.12219361215829849,
-0.12075714021921158,
0.050391778349876404,
0.03134974464774132,
0.1282832771539688,
-0.03080092929303646,
0.030895788222551346,
0.02556714229285717,
0.001901082112453878,
0.06644713133573532,
0.021723320707678795,
-0.13564467430114746,
0.11120704561471939,
0.025382788851857185,
0.01745680905878544,
0.0018972755642607808,
0.00020047770522069186,
0.04679083451628685,
0.027143772691488266,
0.02072780393064022,
0.0018661640351638198,
-0.0265213493257761,
-0.056549087166786194,
0.004039542283862829,
0.04045325890183449,
0.07214013487100601,
-0.0798899233341217,
-0.06713100522756577,
-0.10646221786737442
] | 0.056733
|
[[misc-cluster]] === Miscellaneous cluster settings [[cluster-read-only]] ==== Metadata An entire cluster may be set to read-only with the following \_dynamic\_ setting: `cluster.blocks.read\_only`:: Make the whole cluster read only (indices do not accept write operations), metadata is not allowed to be modified (create or delete indices). `cluster.blocks.read\_only\_allow\_delete`:: Identical to `cluster.blocks.read\_only` but allows to delete indices to free up resources. WARNING: Don't rely on this setting to prevent changes to your cluster. Any user with access to the <> API can make the cluster read-write again. [[cluster-max-tombstones]] ==== Index Tombstones The cluster state maintains index tombstones to explicitly denote indices that have been deleted. The number of tombstones maintained in the cluster state is controlled by the following property, which cannot be updated dynamically: `cluster.indices.tombstones.size`:: Index tombstones prevent nodes that are not part of the cluster when a delete occurs from joining the cluster and reimporting the index as though the delete was never issued. To keep the cluster state from growing huge we only keep the last `cluster.indices.tombstones.size` deletes, which defaults to 500. You can increase it if you expect nodes to be absent from the cluster and miss more than 500 deletes. We think that is rare, thus the default. Tombstones don't take up much space, but we also think that a number like 50,000 is probably too big. [[cluster-logger]] ==== Logger The settings which control logging can be updated dynamically with the `logger.` prefix. For instance, to increase the logging level of the `indices.recovery` module to `DEBUG`, issue this request: [source,js] ------------------------------- PUT /\_cluster/settings { "transient": { "logger.org.elasticsearch.indices.recovery": "DEBUG" } } ------------------------------- // CONSOLE
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/cluster/misc.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.025348423048853874,
-0.0067919595167040825,
-0.07001824676990509,
0.10606623440980911,
0.015013100579380989,
-0.030888451263308525,
-0.02225264348089695,
-0.04075673222541809,
0.03078092634677887,
0.00908439140766859,
-0.005141718778759241,
0.0030324794352054596,
0.016376614570617676,
-0.005742038134485483,
-0.1037987545132637,
-0.000015539488231297582,
-0.04487595707178116,
0.05189308151602745,
-0.005734072532504797,
-0.03859720379114151,
-0.023916102945804596,
0.029519377276301384,
-0.0057409522123634815,
0.0778355672955513,
-0.046578384935855865,
0.0055776736699044704,
-0.07494949549436569,
-0.0212156530469656,
-0.005589286796748638,
0.0023917530197650194,
-0.03033159114420414,
0.029801510274410248,
0.026744723320007324,
-0.00838018860667944,
0.05419012904167175,
0.09042952954769135,
0.0069993590004742146,
-0.044421177357435226,
-0.028616888448596,
-0.059257857501506805,
0.0541781447827816,
0.10956452041864395,
-0.0648578628897667,
-0.019532963633537292,
-0.06431522965431213,
-0.004363625776022673,
-0.1069958359003067,
-0.02106386609375477,
-0.08820710331201553,
0.009750759229063988,
0.0060057565569877625,
0.0660940483212471,
-0.024005534127354622,
0.024082450196146965,
0.02371533028781414,
0.03747422620654106,
-0.005447758361697197,
-0.0011480320245027542,
-0.026771480217576027,
-0.09123803675174713,
0.03855818510055542,
-0.029240606352686882,
0.06422366946935654,
-0.09488988667726517,
-0.013829613104462624,
0.04694930464029312,
0.049612920731306076,
-0.0345345102250576,
0.06808463484048843,
0.04511997476220131,
0.013597658835351467,
0.05289644002914429,
-0.019283076748251915,
-0.0012462257873266935,
-0.02725066989660263,
0.06584571301937103,
-0.0086642075330019,
0.03008217178285122,
-0.0003881604934576899,
-0.0009017341071739793,
-0.0985921174287796,
-0.047036319971084595,
0.06556705385446548,
-0.045209433883428574,
-0.07206109166145325,
-0.01622287929058075,
-0.03610752522945404,
-0.025254063308238983,
0.12161239236593246,
-0.03306448832154274,
-0.007822646759450436,
0.018676429986953735,
0.07532907277345657,
-0.04034360125660896,
0.056020572781562805,
0.04498086869716644,
-0.021681755781173706,
0.05873047187924385,
0.01639602892100811,
0.04375690221786499,
0.018702935427427292,
-0.030309468507766724,
-0.06801296770572662,
0.032827891409397125,
-0.0282217338681221,
-0.022194990888237953,
-0.032425619661808014,
0.03649425134062767,
-0.010977066121995449,
0.0836377814412117,
0.053857192397117615,
0.12056709825992584,
-0.026910655200481415,
0.034310005605220795,
-0.06308117508888245,
0.06853894889354706,
0.07897511124610901,
0.0008128000190481544,
0.0017605649773031473,
0.15569892525672913,
0.09747833758592606,
-0.07941579073667526,
-0.024388086050748825,
0.018035447224974632,
0.04834359884262085,
-0.046879321336746216,
-0.04765581712126732,
4.278922496557978e-33,
0.01613922230899334,
-0.0487431064248085,
0.0487942099571228,
0.00013122598465997726,
-0.016726693138480186,
-0.004684423562139273,
-0.0034285292495042086,
-0.030404968187212944,
-0.03094649687409401,
-0.08593687415122986,
-0.0362662672996521,
0.05096827447414398,
0.055726613849401474,
-0.06271129101514816,
-0.002501821843907237,
-0.00498876441270113,
0.0800870880484581,
0.060041408985853195,
0.053604185581207275,
-0.09515292942523956,
0.07325375825166702,
0.00905721914023161,
-0.026953086256980896,
-0.05780898034572601,
-0.049867305904626846,
-0.00525863841176033,
-0.028911476954817772,
-0.08555783331394196,
0.02042980119585991,
0.014442919753491879,
-0.0022821861784905195,
0.03220104053616524,
-0.002357601188123226,
0.04155422002077103,
-0.028370937332510948,
0.0366351343691349,
-0.026102369651198387,
0.011430414393544197,
-0.03353004902601242,
-0.025299055501818657,
0.03583284467458725,
0.0006485896883532405,
0.021186385303735733,
-0.06863588094711304,
0.0052472129464149475,
-0.005773626267910004,
0.011500286869704723,
0.0043733492493629456,
-0.00004759200965054333,
-0.009337473660707474,
-0.01491179782897234,
-0.05683430656790733,
0.017892127856612206,
0.010484281927347183,
-0.01981041021645069,
0.008750075474381447,
0.03179521486163139,
-0.05710185319185257,
0.05590381473302841,
0.030392054468393326,
0.043706055730581284,
-0.01963973417878151,
0.007585928309708834,
0.04695553332567215,
-0.021750885993242264,
0.06889896839857101,
0.0438043475151062,
0.05344446003437042,
-0.0010636569932103157,
-0.04505261778831482,
-0.044545549899339676,
0.01402154378592968,
-0.012207236140966415,
0.049334052950143814,
-0.14699022471904755,
-0.06091514602303505,
0.05592650920152664,
-0.04981255903840065,
-0.08831435441970825,
0.003802880411967635,
-0.009042110294103622,
-0.006638399790972471,
-0.07375779747962952,
-0.014423644170165062,
0.020349426195025444,
-0.08412132412195206,
-0.023891877382993698,
0.03695579990744591,
-0.06954765319824219,
-0.07968956977128983,
0.05733108147978783,
-0.06694301962852478,
0.04494495689868927,
-0.04365750402212143,
-0.07562825083732605,
-5.3841208158331544e-33,
-0.009600679390132427,
-0.07645093649625778,
0.014946083538234234,
-0.001322794472798705,
-0.028487632051110268,
-0.08088076859712601,
0.004235434345901012,
0.10079915076494217,
-0.004862401634454727,
-0.05567459762096405,
-0.006295374128967524,
-0.0012170412810519338,
-0.036525972187519073,
0.014300599694252014,
-0.07577598094940186,
0.054570578038692474,
0.02695534937083721,
-0.052937109023332596,
0.0389283150434494,
0.02972991019487381,
-0.0724654272198677,
-0.056910619139671326,
-0.028251970186829567,
0.11299765110015869,
-0.046881891787052155,
0.020273597911000252,
-0.05144847556948662,
-0.040452685207128525,
-0.010223407298326492,
-0.04691816121339798,
-0.08072911202907562,
-0.017990244552493095,
-0.03442050889134407,
0.02562558278441429,
0.03861544653773308,
-0.07042219489812851,
-0.054401833564043045,
-0.04318378493189812,
-0.06441262364387512,
-0.03262605890631676,
0.03550391271710396,
0.09796792268753052,
-0.02857127971947193,
0.054612211883068085,
0.08273928612470627,
0.014752556569874287,
0.03539895638823509,
0.05365631729364395,
-0.031711820513010025,
-0.010516948066651821,
0.018309012055397034,
-0.11496306955814362,
0.014278369955718517,
0.044741351157426834,
-0.017694540321826935,
0.04321625456213951,
0.04097428172826767,
0.05894830450415611,
-0.05220767855644226,
-0.024304356426000595,
0.07044610381126404,
-0.07494384050369263,
-0.13010641932487488,
0.07935403287410736,
0.007918866351246834,
-0.030469639226794243,
0.0299796424806118,
-0.038258180022239685,
-0.11262699961662292,
0.030017832294106483,
-0.03178805112838745,
0.028448352590203285,
-0.004598889499902725,
0.03498728573322296,
0.02341267466545105,
-0.03274029865860939,
-0.030352013185620308,
-0.0350346677005291,
-0.04214385151863098,
0.02768070064485073,
-0.04767308384180069,
0.05438282713294029,
-0.029200326651334763,
0.031488604843616486,
0.09726854413747787,
0.045578207820653915,
-0.052090227603912354,
0.1255871206521988,
0.008357655256986618,
0.0765763595700264,
-0.06315630674362183,
-0.07157338410615921,
0.005410835146903992,
-0.01985587365925312,
-0.08412853628396988,
-5.501316735490036e-8,
0.0338931679725647,
0.011965423822402954,
-0.07143982499837875,
0.0321107916533947,
0.017986617982387543,
-0.05302418768405914,
0.03095322661101818,
0.08141670376062393,
-0.01686120592057705,
0.007790387608110905,
0.07084926217794418,
-0.0018932247767224908,
-0.10826076567173004,
-0.01835470087826252,
-0.022268282249569893,
-0.004402391612529755,
-0.008889494463801384,
0.022869205102324486,
0.0005428512813523412,
-0.05523742735385895,
-0.06961264461278915,
-0.010019432753324509,
-0.016144637018442154,
0.024014905095100403,
0.0886114314198494,
-0.011041508056223392,
0.09788937121629715,
0.04166640713810921,
0.016626965254545212,
-0.023129167035222054,
-0.010965429246425629,
-0.05387893691658974,
0.10017737746238708,
0.10144424438476562,
-0.10243318974971771,
0.02832823619246483,
0.01161914225667715,
0.11288952082395554,
-0.01313620526343584,
0.12529832124710083,
0.01572156697511673,
0.0674489289522171,
-0.03364960104227066,
-0.0030810199677944183,
0.005035463720560074,
0.003181520150974393,
-0.022049546241760254,
0.07860087603330612,
0.08618824183940887,
0.005435324739664793,
-0.022899670526385307,
0.010803228244185448,
-0.08108088374137878,
0.07788930833339691,
-0.0054863858968019485,
-0.03077562339603901,
-0.04161795973777771,
0.04250462353229523,
0.10066857933998108,
0.013610119000077248,
0.10878707468509674,
-0.015256892889738083,
-0.012562698684632778,
-0.07968602329492569
] | 0.136425
|
[[disk-allocator]] === Disk-based Shard Allocation Elasticsearch considers the available disk space on a node before deciding whether to allocate new shards to that node or to actively relocate shards away from that node. Below are the settings that can be configured in the `elasticsearch.yml` config file or updated dynamically on a live cluster with the <> API: `cluster.routing.allocation.disk.threshold\_enabled`:: Defaults to `true`. Set to `false` to disable the disk allocation decider. `cluster.routing.allocation.disk.watermark.low`:: Controls the low watermark for disk usage. It defaults to `85%`, meaning that Elasticsearch will not allocate shards to nodes that have more than 85% disk used. It can also be set to an absolute byte value (like `500mb`) to prevent Elasticsearch from allocating shards if less than the specified amount of space is available. This setting has no effect on the primary shards of newly-created indices or, specifically, any shards that have never previously been allocated. `cluster.routing.allocation.disk.watermark.high`:: Controls the high watermark. It defaults to `90%`, meaning that Elasticsearch will attempt to relocate shards away from a node whose disk usage is above 90%. It can also be set to an absolute byte value (similarly to the low watermark) to relocate shards away from a node if it has less than the specified amount of free space. This setting affects the allocation of all shards, whether previously allocated or not. `cluster.routing.allocation.disk.watermark.flood\_stage`:: + -- Controls the flood stage watermark. It defaults to 95%, meaning that Elasticsearch enforces a read-only index block (`index.blocks.read\_only\_allow\_delete`) on every index that has one or more shards allocated on the node that has at least one disk exceeding the flood stage. This is a last resort to prevent nodes from running out of disk space. The index block must be released manually once there is enough disk space available to allow indexing operations to continue. NOTE: You can not mix the usage of percentage values and byte values within these settings. Either all are set to percentage values, or all are set to byte values. This is so that we can we validate that the settings are internally consistent (that is, the low disk threshold is not more than the high disk threshold, and the high disk threshold is not more than the flood stage threshold). An example of resetting the read-only index block on the `twitter` index: [source,js] -------------------------------------------------- PUT /twitter/\_settings { "index.blocks.read\_only\_allow\_delete": null } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] -- `cluster.info.update.interval`:: How often Elasticsearch should check on disk usage for each node in the cluster. Defaults to `30s`. `cluster.routing.allocation.disk.include\_relocations`:: Defaults to +true+, which means that Elasticsearch will take into account shards that are currently being relocated to the target node when computing a node's disk usage. Taking relocating shards' sizes into account may, however, mean that the disk usage for a node is incorrectly estimated on the high side, since the relocation could be 90% complete and a recently retrieved disk usage would include the total size of the relocating shard as well as the space already used by the running relocation. NOTE: Percentage values refer to used disk space, while byte values refer to free disk space. This can be confusing, since it flips the meaning of high and low. For example, it makes sense to set the low watermark to 10gb and the high watermark to 5gb, but not the other way around. An example of updating the low watermark to at least 100 gigabytes free, a high watermark of at least 50 gigabytes free, and a flood stage watermark of 10 gigabytes free, and updating the information about the cluster every minute: [source,js] -------------------------------------------------- PUT \_cluster/settings { "transient": { "cluster.routing.allocation.disk.watermark.low": "100gb",
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/cluster/disk_allocator.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.08471502363681793,
-0.006599701941013336,
0.020760351791977882,
0.07258964329957962,
0.08553435653448105,
-0.04763764888048172,
-0.060428306460380554,
-0.00013490852143149823,
0.049439072608947754,
0.04268626868724823,
0.000024297749405377544,
0.03403141722083092,
0.01539288368076086,
0.004287792835384607,
-0.09568957984447479,
-0.04072387516498566,
-0.04176759347319603,
-0.056510984897613525,
-0.02089262753725052,
-0.006443133112043142,
0.10134387016296387,
-0.006858921144157648,
0.03408718481659889,
-0.03773731738328934,
-0.06015114486217499,
-0.04645882546901703,
-0.09334301203489304,
0.008230539038777351,
0.04178207367658615,
0.009137319400906563,
0.018877394497394562,
-0.029553871601819992,
0.020154744386672974,
0.01925947517156601,
0.012635570950806141,
0.05935914069414139,
-0.006008978467434645,
-0.06798060238361359,
-0.08828184008598328,
0.0036947487387806177,
0.04256824404001236,
0.0344097837805748,
-0.04134778678417206,
-0.05970587953925133,
-0.06573273241519928,
-0.025009162724018097,
-0.03241197019815445,
-0.0038638778496533632,
-0.06657256931066513,
0.010880705900490284,
-0.01687728613615036,
-0.06786806881427765,
0.013726157136261463,
0.04217483475804329,
-0.02023238316178322,
0.059145621955394745,
-0.035591043531894684,
0.014620179310441017,
-0.007203298155218363,
-0.055791765451431274,
0.09479941427707672,
-0.032001614570617676,
0.05165080726146698,
-0.03632820397615433,
0.03304619342088699,
0.0015621364582329988,
0.09167325496673584,
-0.03716769441962242,
0.005880451761186123,
0.03491527587175369,
0.024884870275855064,
0.07770700007677078,
-0.040121421217918396,
0.05391756072640419,
0.012121835723519325,
0.038977451622486115,
0.04524517431855202,
0.07434524595737457,
0.036923639476299286,
-0.002715342678129673,
-0.06041970103979111,
-0.10435555130243301,
0.0311940535902977,
0.00041336152935400605,
-0.06594469398260117,
-0.022608721628785133,
-0.033095378428697586,
-0.08421772718429565,
0.050389014184474945,
-0.009266099892556667,
0.05663643777370453,
-0.017111964523792267,
0.016906222328543663,
-0.008235213346779346,
-0.0018463947344571352,
0.022479798644781113,
-0.05872277915477753,
0.07818606495857239,
-0.00037619160139001906,
-0.029451102018356323,
-0.010722063481807709,
-0.03053104318678379,
-0.004120511934161186,
-0.00938057154417038,
0.026351533830165863,
-0.004664768930524588,
-0.020959557965397835,
0.04810313880443573,
0.017053348943591118,
0.05055175721645355,
0.09320825338363647,
0.012747743166983128,
0.003226988250389695,
0.04622194170951843,
-0.06403907388448715,
0.11212366074323654,
0.00010656034282874316,
-0.01821364276111126,
-0.05300024896860123,
0.0191285852342844,
0.054231658577919006,
-0.0043173497542738914,
0.023689279332756996,
-0.05577631667256355,
-0.011711280792951584,
0.04786887764930725,
-0.08174387365579605,
3.601933259400345e-33,
0.06621035188436508,
-0.053809311240911484,
-0.03840942308306694,
-0.05101972073316574,
-0.03137540444731712,
0.020489254966378212,
-0.012237162329256535,
0.07171308249235153,
-0.06888865679502487,
-0.05851595848798752,
-0.08142904192209244,
0.09555669873952866,
0.027560170739889145,
-0.0441446453332901,
0.04431469738483429,
-0.07549005001783371,
0.061127398163080215,
0.06486321985721588,
0.0069144656881690025,
-0.052094344049692154,
0.04935881868004799,
-0.0193334948271513,
-0.024780750274658203,
-0.09629650413990021,
-0.04398947209119797,
0.005694851279258728,
-0.016707420349121094,
-0.14255595207214355,
-0.040730759501457214,
0.020258883014321327,
-0.11758086830377579,
0.04090288653969765,
0.0647280290722847,
0.024063700810074806,
0.035775259137153625,
0.05432162061333656,
-0.07841600477695465,
0.026456639170646667,
-0.045303624123334885,
-0.052075404673814774,
0.06895887851715088,
-0.00035224598832428455,
0.05583653971552849,
-0.06512802094221115,
-0.06496576219797134,
-0.009650652296841145,
-0.02584187686443329,
-0.023461641743779182,
0.004094842355698347,
0.05188196524977684,
0.0036823642440140247,
0.010816073045134544,
0.028389815241098404,
0.02190222032368183,
-0.025909295305609703,
0.02341230772435665,
0.03534766659140587,
-0.05398695915937424,
-0.002006331691518426,
0.031307075172662735,
-0.0036398957017809153,
-0.07338476181030273,
0.10741052031517029,
0.06894862651824951,
0.00197154120542109,
0.052131108939647675,
0.10558278858661652,
0.029185814782977104,
-0.004239934496581554,
0.06249683350324631,
-0.01998830959200859,
0.03762596473097801,
0.07382615655660629,
0.0741296112537384,
-0.07293570786714554,
-0.09955654293298721,
-0.009439156390726566,
-0.04571132734417915,
-0.10899831354618073,
0.0002459219831507653,
-0.0620746873319149,
-0.05247628688812256,
-0.004835819359868765,
-0.005825613625347614,
-0.013087102212011814,
-0.03278958797454834,
0.04185520112514496,
0.04133424535393715,
-0.035765282809734344,
-0.06070198118686676,
0.03093895874917507,
-0.045914165675640106,
0.008420816622674465,
-0.06297290325164795,
-0.0669282004237175,
-4.0015216254692576e-33,
-0.018987417221069336,
-0.05343271419405937,
-0.03464338555932045,
0.04311235621571541,
-0.006638440303504467,
0.005800335202366114,
0.06928819417953491,
0.05216127634048462,
-0.05594655126333237,
-0.06415552645921707,
-0.012438603676855564,
-0.027963217347860336,
-0.005047235172241926,
-0.061633139848709106,
-0.11666711419820786,
0.03728123754262924,
-0.0012478368589654565,
-0.07942909747362137,
0.04878523573279381,
-0.011086738668382168,
-0.036761995404958725,
-0.044883470982313156,
0.0017614124808460474,
0.08311042189598083,
-0.013417264446616173,
-0.01833929866552353,
0.03429844602942467,
-0.015596344135701656,
-0.1034754067659378,
-0.021022608503699303,
-0.03402017802000046,
-0.009012702852487564,
-0.009010618552565575,
-0.05099666118621826,
-0.018432557582855225,
0.020664241164922714,
-0.037977710366249084,
-0.013720675371587276,
0.05024418607354164,
0.053964968770742416,
0.052810683846473694,
0.0073808059096336365,
-0.06833916157484055,
0.02381546050310135,
0.0026912190951406956,
0.03541696444153786,
0.008807668462395668,
0.036170829087495804,
0.017959069460630417,
-0.04012320935726166,
0.02156827040016651,
-0.044398535043001175,
0.08479316532611847,
0.120274119079113,
0.002981990110129118,
0.0989842414855957,
-0.046489279717206955,
0.09286835789680481,
-0.09100262075662613,
0.045752208679914474,
0.049489010125398636,
0.016561340540647507,
-0.080900177359581,
0.010207151994109154,
-0.013532011769711971,
0.024853181093931198,
-0.01863894984126091,
-0.04021140933036804,
-0.07417131215333939,
-0.02227923274040222,
-0.05024280026555061,
0.0286606065928936,
0.07553062587976456,
0.07413898408412933,
0.02812366746366024,
-0.0232718326151371,
0.0107886902987957,
-0.04064719006419182,
0.010206283070147038,
0.020980287343263626,
-0.0991767942905426,
0.11914049088954926,
-0.01822563447058201,
0.028828579932451248,
0.06487447023391724,
-0.01671018823981285,
-0.020332474261522293,
0.09380709379911423,
-0.07569804042577744,
0.10574070364236832,
-0.02728484943509102,
-0.015461097471415997,
-0.08878147602081299,
-0.021658029407262802,
-0.023996388539671898,
-4.687616694809549e-8,
0.021727638319134712,
0.06740230321884155,
-0.004060292150825262,
0.06570577621459961,
0.038781918585300446,
-0.007595591712743044,
0.08506780117750168,
0.12183225899934769,
-0.06484269350767136,
0.01698586903512478,
0.028034068644046783,
-0.0007826977525837719,
-0.11317426711320877,
-0.03259655460715294,
0.003154916223138571,
-0.009329761378467083,
0.013909846544265747,
0.024411387741565704,
-0.09285126626491547,
-0.05894544720649719,
-0.06213252991437912,
-0.023240309208631516,
-0.022998297587037086,
0.04700268432497978,
0.04588978737592697,
0.005609849467873573,
0.054927583783864975,
0.04421526566147804,
0.00843021459877491,
-0.02612631767988205,
-0.02964194118976593,
-0.0243375301361084,
0.029189201071858406,
0.03786025941371918,
-0.0573742501437664,
0.12478870153427124,
-0.09663738310337067,
0.08029795438051224,
-0.01957204006612301,
0.14018531143665314,
-0.031844113022089005,
0.03314158320426941,
-0.01161827053874731,
-0.022207995876669884,
-0.0023452218156307936,
0.003250896232202649,
-0.08900654315948486,
0.08420921117067337,
0.01427171565592289,
0.0036450170446187258,
0.02302282117307186,
-0.047009263187646866,
0.010827228426933289,
0.06953900307416916,
0.05424400791525841,
-0.025326775386929512,
-0.01764070615172386,
-0.012473328970372677,
0.016824498772621155,
0.08559395372867584,
0.11147768050432205,
-0.057097479701042175,
-0.015910591930150986,
-0.024238653481006622
] | 0.05385
|
around. An example of updating the low watermark to at least 100 gigabytes free, a high watermark of at least 50 gigabytes free, and a flood stage watermark of 10 gigabytes free, and updating the information about the cluster every minute: [source,js] -------------------------------------------------- PUT \_cluster/settings { "transient": { "cluster.routing.allocation.disk.watermark.low": "100gb", "cluster.routing.allocation.disk.watermark.high": "50gb", "cluster.routing.allocation.disk.watermark.flood\_stage": "10gb", "cluster.info.update.interval": "1m" } } -------------------------------------------------- // CONSOLE
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/cluster/disk_allocator.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.019005844369530678,
0.013479639776051044,
0.003958742134273052,
0.08658494800329208,
0.10115999728441238,
-0.10560336709022522,
-0.03497560694813728,
0.04636035114526749,
0.00794510543346405,
0.013543248176574707,
-0.027490144595503807,
0.0008108858019113541,
0.01444090437144041,
-0.05478999763727188,
-0.05933316797018051,
0.00026436144253239036,
-0.000039522656152257696,
-0.0031048881355673075,
-0.04386411979794502,
-0.12123231589794159,
0.019031411036849022,
-0.07602223008871078,
0.029565665870904922,
0.00525224395096302,
-0.00919861625880003,
0.051231399178504944,
-0.018362434580922127,
-0.03454853594303131,
0.027238860726356506,
0.020877042785286903,
-0.009941346943378448,
0.006984279025346041,
0.004128054715692997,
-0.04367963597178459,
0.052898481488227844,
0.08375392109155655,
0.025084810331463814,
0.012616312131285667,
-0.005766784306615591,
-0.027189847081899643,
0.10403184592723846,
0.0659061074256897,
-0.0443599708378315,
-0.003489104798063636,
-0.019267944619059563,
-0.03425274416804314,
-0.03869600221514702,
0.0076483432203531265,
-0.13331378996372223,
0.006027841009199619,
0.0075491066090762615,
-0.07966741919517517,
-0.03366868942975998,
0.01491817831993103,
-0.05302056297659874,
0.012605063617229462,
-0.0059279766865074635,
0.01643873006105423,
-0.05629250779747963,
-0.007584653794765472,
0.016218209639191628,
-0.09841245412826538,
0.024067357182502747,
-0.005665073171257973,
0.041064128279685974,
0.022827208042144775,
0.0030823973938822746,
-0.00667695514857769,
0.015949295833706856,
0.0042180754244327545,
-0.02471625804901123,
0.1126074567437172,
0.02060200646519661,
-0.02506346069276333,
-0.031214943155646324,
-0.009758034721016884,
0.017352871596813202,
0.11251375079154968,
0.032843369990587234,
-0.02763020060956478,
-0.0042894561775028706,
-0.1444995403289795,
0.04133366048336029,
-0.007575496565550566,
0.010369242168962955,
0.0031244298443198204,
0.026761315762996674,
-0.03614174574613571,
0.030499350279569626,
-0.08344276994466782,
-0.044138383120298386,
-0.005540115758776665,
0.057455796748399734,
0.00011798560444731265,
-0.08586820960044861,
0.05780668929219246,
-0.038269154727458954,
-0.005406311247497797,
0.010892795398831367,
0.024046756327152252,
-0.006915430538356304,
-0.015291030518710613,
0.014073530212044716,
-0.006456681992858648,
0.05434298515319824,
0.0035552142653614283,
0.004710782784968615,
0.11355780810117722,
0.032655101269483566,
0.035723328590393066,
0.02405187487602234,
0.0535765215754509,
0.010178287513554096,
-0.031114879995584488,
-0.024626117199659348,
0.004324965178966522,
0.008650669828057289,
-0.028888287022709846,
0.003421022789552808,
0.059590794146060944,
0.13152803480625153,
-0.07125667482614517,
-0.027697518467903137,
-0.039378415793180466,
0.019520917907357216,
0.033530570566654205,
-0.0173692237585783,
7.467278731608137e-34,
0.06814759969711304,
-0.04018149524927139,
-0.01621401496231556,
-0.07456431537866592,
0.036447398364543915,
-0.017163963988423347,
-0.01982000656425953,
-0.051255952566862106,
-0.0647486224770546,
-0.05353209376335144,
-0.02566029690206051,
0.03937988355755806,
-0.019390789791941643,
0.01236391719430685,
0.011180246248841286,
-0.09458497166633606,
0.05060141906142235,
0.100800521671772,
0.04371286556124687,
-0.07089641690254211,
0.02368905395269394,
-0.03219927102327347,
-0.10335931926965714,
-0.08564583957195282,
-0.006695739924907684,
0.03412367403507233,
0.062170401215553284,
-0.0481790155172348,
-0.013342829421162605,
-0.0004054802702739835,
0.0008792669395916164,
0.050445254892110825,
-0.004312051925808191,
0.016052667051553726,
0.018165482208132744,
0.058719389140605927,
-0.042332522571086884,
-0.03425872325897217,
-0.0025492608547210693,
-0.03912471979856491,
0.045175522565841675,
-0.003565800143405795,
-0.013107161037623882,
-0.08502529561519623,
-0.03642642870545387,
-0.05542033165693283,
-0.04224061593413353,
-0.07142102718353271,
0.02528231032192707,
-0.03585539013147354,
0.025386186316609383,
0.013088907115161419,
-0.027380598708987236,
0.009068040177226067,
-0.016979319974780083,
0.044551849365234375,
0.03857490420341492,
-0.0400882251560688,
0.08620692044496536,
0.09620166569948196,
-0.005141634959727526,
-0.04293711110949516,
-0.012756509706377983,
0.023707034066319466,
-0.006236108019948006,
0.07721570134162903,
0.07456163316965103,
0.03506286069750786,
-0.0026516621001064777,
0.044227052479982376,
0.005260093603283167,
0.040306009352207184,
0.03934052586555481,
0.06134648621082306,
-0.08547358214855194,
-0.0847611203789711,
0.0011365156387910247,
0.02205299213528633,
-0.15123452246189117,
0.017195317894220352,
-0.0006294863997027278,
-0.13895365595817566,
-0.03292200714349747,
0.06252984702587128,
0.04627610743045807,
-0.06544074416160583,
0.0021600453183054924,
0.04433521255850792,
-0.10740730911493301,
-0.008246726356446743,
0.021792985498905182,
-0.010483021847903728,
0.03597598522901535,
-0.08871346712112427,
-0.09359880536794662,
-1.7409486432120712e-33,
-0.012397248297929764,
-0.03602880239486694,
-0.03182867914438248,
0.11791017651557922,
0.012648044154047966,
-0.04607399180531502,
0.025069959461688995,
0.1191091313958168,
0.029627332463860512,
0.039806660264730453,
-0.0843537449836731,
0.003083499614149332,
-0.09708049148321152,
-0.10764680057764053,
-0.06939178705215454,
0.04517931491136551,
0.05548560246825218,
-0.056710321456193924,
0.029884178191423416,
-0.03313363716006279,
-0.040733709931373596,
-0.06666027754545212,
0.017304537817835808,
0.10542070120573044,
-0.01975378580391407,
0.012339627370238304,
0.014814397320151329,
0.002648930763825774,
-0.12656264007091522,
-0.03908224403858185,
-0.1522281914949417,
0.0043735746294260025,
-0.06063680350780487,
-0.06423807889223099,
0.031738296151161194,
-0.04602823778986931,
0.022016538307070732,
-0.01062494982033968,
-0.034182753413915634,
0.015312369912862778,
0.013203037902712822,
0.007145547308027744,
-0.07960106432437897,
0.016089145094156265,
0.056545209139585495,
0.0502997450530529,
-0.027237169444561005,
0.02788405306637287,
-0.010616516694426537,
0.018543461337685585,
0.016831329092383385,
-0.08898632228374481,
0.03679201379418373,
0.10653328150510788,
0.01769169606268406,
0.02444334700703621,
0.026548311114311218,
0.024405069649219513,
-0.024089429527521133,
0.029406355693936348,
0.05788155272603035,
-0.06418440490961075,
-0.07583126425743103,
0.004308866336941719,
0.02581164799630642,
0.03636877238750458,
-0.003991246223449707,
0.00003237220153096132,
-0.036366336047649384,
0.04149215668439865,
-0.004658204969018698,
0.021374505013227463,
0.055792901664972305,
0.024600928649306297,
-0.008988801389932632,
-0.04913429543375969,
0.0003157081955578178,
-0.04004994407296181,
0.0035766358487308025,
-0.007763762958347797,
-0.0568121112883091,
0.09716612845659256,
-0.030438091605901718,
0.022232133895158768,
0.092715322971344,
0.01523908693343401,
-0.028387000784277916,
0.0010658024111762643,
-0.013192380778491497,
0.05245465785264969,
-0.08028475195169449,
0.01984834484755993,
-0.07089213281869888,
-0.003975062631070614,
-0.0317159965634346,
-5.255497015355104e-8,
-0.001360617927275598,
0.025867225602269173,
-0.009422858245670795,
-0.015116001479327679,
0.05251254141330719,
0.01549765095114708,
0.021823102608323097,
0.12491436302661896,
0.005489337258040905,
-0.07628944516181946,
0.06607755273580551,
-0.010714614763855934,
-0.05341898277401924,
0.009613717906177044,
0.006575684994459152,
0.0028055987786501646,
0.024353569373488426,
-0.049515917897224426,
-0.06373976916074753,
-0.013165351003408432,
-0.028268784284591675,
0.04784057289361954,
-0.0102933244779706,
0.01883239485323429,
0.09372267127037048,
-0.03988196700811386,
0.14846618473529816,
0.10025854408740997,
0.0033013864886015654,
-0.1220114678144455,
-0.08358924835920334,
0.0002588937641121447,
0.03558176010847092,
0.055086344480514526,
-0.007723716087639332,
0.06635258346796036,
0.00041600954136811197,
0.0930800586938858,
-0.014896232634782791,
0.1337718367576599,
-0.009075919166207314,
0.03798288106918335,
0.02901563234627247,
-0.0018739703809842467,
0.04916496202349663,
0.02297443337738514,
-0.09814602881669998,
0.03354679420590401,
0.04596300795674324,
-0.005335349123924971,
0.02198934182524681,
-0.009576483629643917,
-0.05126176029443741,
0.05460149422287941,
0.008387979120016098,
-0.07315858453512192,
-0.027593690901994705,
-0.06723161786794662,
0.016583044081926346,
0.027395514771342278,
0.1100749596953392,
-0.025303009897470474,
0.0072160521522164345,
0.02940237894654274
] | 0.123376
|
[[allocation-filtering]] === Shard Allocation Filtering While <> provides \*per-index\* settings to control the allocation of shards to nodes, cluster-level shard allocation filtering allows you to allow or disallow the allocation of shards from \*any\* index to particular nodes. The available \_dynamic\_ cluster settings are as follows, where `{attribute}` refers to an arbitrary node attribute.: `cluster.routing.allocation.include.{attribute}`:: Allocate shards to a node whose `{attribute}` has at least one of the comma-separated values. `cluster.routing.allocation.require.{attribute}`:: Only allocate shards to a node whose `{attribute}` has \_all\_ of the comma-separated values. `cluster.routing.allocation.exclude.{attribute}`:: Do not allocate shards to a node whose `{attribute}` has \_any\_ of the comma-separated values. These special attributes are also supported: [horizontal] `\_name`:: Match nodes by node names `\_ip`:: Match nodes by IP addresses (the IP address associated with the hostname) `\_host`:: Match nodes by hostnames The typical use case for cluster-wide shard allocation filtering is when you want to decommission a node, and you would like to move the shards from that node to other nodes in the cluster before shutting it down. For instance, we could decommission a node using its IP address as follows: [source,js] -------------------------------------------------- PUT \_cluster/settings { "transient" : { "cluster.routing.allocation.exclude.\_ip" : "10.0.0.1" } } -------------------------------------------------- // CONSOLE NOTE: Shards will only be relocated if it is possible to do so without breaking another routing constraint, such as never allocating a primary and replica shard to the same node. In addition to listing multiple values as a comma-separated list, all attribute values can be specified with wildcards, eg: [source,js] ------------------------ PUT \_cluster/settings { "transient": { "cluster.routing.allocation.exclude.\_ip": "192.168.2.\*" } } ------------------------ // CONSOLE
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/cluster/allocation_filtering.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.08621373027563095,
0.049920570105314255,
0.04628198593854904,
0.061346594244241714,
0.05109811946749687,
-0.008368792943656445,
0.01605137623846531,
-0.10459087789058685,
0.03227951377630234,
0.0024353794287890196,
0.003096220316365361,
-0.015582844614982605,
0.031723298132419586,
0.0039058837573975325,
-0.041367899626493454,
0.021497491747140884,
0.017027704045176506,
0.0031088150572031736,
-0.002089038724079728,
-0.014529907144606113,
0.027608802542090416,
0.012350649572908878,
0.017028603702783585,
0.011014592833817005,
-0.09251891076564789,
-0.01356095913797617,
-0.10882393270730972,
-0.025224192067980766,
0.03115065023303032,
0.010965816676616669,
0.02278161607682705,
-0.017584752291440964,
-0.04488414153456688,
0.07403431087732315,
-0.018102547153830528,
0.040478963404893875,
-0.0015228090342134237,
-0.010190623812377453,
-0.09342066198587418,
0.005097627639770508,
0.08162947744131088,
0.04424407705664635,
-0.027214717119932175,
-0.0636182650923729,
-0.05621376633644104,
-0.010464812628924847,
-0.0647369846701622,
0.01253015361726284,
-0.07997609674930573,
-0.026584457606077194,
-0.036883581429719925,
-0.033309683203697205,
-0.02194572426378727,
0.02729153260588646,
0.04869059845805168,
0.05326121672987938,
-0.03363882377743721,
0.020020127296447754,
0.02862394228577614,
-0.08122552931308746,
0.04431735724210739,
-0.07671826332807541,
0.05371033027768135,
-0.04539956897497177,
-0.011363089084625244,
0.004465158563107252,
0.042466141283512115,
0.01655156910419464,
0.029672181233763695,
0.04170488193631172,
0.017017994076013565,
0.06694041192531586,
-0.04854566603899002,
0.02708953619003296,
-0.0011287914821878076,
0.13110770285129547,
0.02751867100596428,
0.017926305532455444,
-0.005885957274585962,
-0.00009765787399373949,
-0.09497673809528351,
-0.05621437728404999,
0.035934630781412125,
0.014904642477631569,
-0.052655983716249466,
-0.015418228693306446,
-0.09122593700885773,
-0.10554321110248566,
0.05328846350312233,
-0.01717223972082138,
-0.02023264393210411,
-0.01713348925113678,
0.055258676409721375,
-0.052570343017578125,
0.08234775811433792,
-0.0025884779170155525,
-0.01057547889649868,
0.014592279680073261,
0.032535918056964874,
0.00028148270212113857,
-0.00764814205467701,
-0.0490439347922802,
-0.012221199460327625,
-0.02983209863305092,
-0.02276650071144104,
0.01043458841741085,
-0.06418917328119278,
0.0015026706969365478,
-0.0404297336935997,
0.06368428468704224,
0.02799605391919613,
0.07463663816452026,
0.004360617604106665,
-0.037101686000823975,
-0.0009985222714021802,
0.10797255486249924,
0.12707717716693878,
-0.05555710196495056,
-0.006290968041867018,
0.0250542014837265,
0.01640268601477146,
-0.05800558626651764,
0.08230676501989365,
0.01632763259112835,
-0.0058777816593647,
-0.033829353749752045,
-0.1209791824221611,
3.377957504530543e-33,
0.06316744536161423,
-0.03837711364030838,
-0.027436237782239914,
-0.04356162250041962,
0.006673538126051426,
0.013614301569759846,
0.013398533686995506,
0.02077757567167282,
-0.06240608170628548,
-0.027919210493564606,
-0.10691698640584946,
0.09641630202531815,
0.03580678999423981,
-0.05133427679538727,
0.06340407580137253,
-0.07958093285560608,
0.09098836779594421,
0.11284327507019043,
0.041130248457193375,
-0.0449940524995327,
0.03311024606227875,
-0.024364670738577843,
-0.01916232705116272,
-0.006500598508864641,
-0.04681497812271118,
-0.020409271121025085,
-0.036394067108631134,
-0.11529937386512756,
0.019381145015358925,
0.007296114694327116,
-0.04643457755446434,
0.00285599404014647,
0.08374762535095215,
0.036454010754823685,
0.02005128189921379,
0.04756665602326393,
-0.06622492522001266,
0.011348776519298553,
-0.04317893832921982,
-0.10315001755952835,
0.04773469641804695,
0.025195926427841187,
0.06810158491134644,
-0.05893890932202339,
-0.03534170985221863,
0.0082136495038867,
-0.06230233982205391,
0.00990837998688221,
-0.027901282534003258,
-0.01753455400466919,
0.012584494426846504,
0.0017520637484267354,
0.019742513075470924,
0.020232446491718292,
0.0008044196874834597,
-0.036849282681941986,
0.019753258675336838,
0.02942351996898651,
0.008228837512433529,
0.047014184296131134,
0.01887601800262928,
-0.04691090062260628,
-0.02412441372871399,
0.06780242174863815,
-0.012343935668468475,
0.029406338930130005,
0.0769057497382164,
0.09994527697563171,
0.01610441319644451,
0.08172393590211868,
-0.019992338493466377,
0.10884754359722137,
-0.02060629427433014,
0.08533276617527008,
-0.06182197481393814,
-0.10317408293485641,
-0.029686277732253075,
-0.05424842983484268,
-0.09835877269506454,
0.013561396859586239,
-0.07681868225336075,
0.006569996476173401,
-0.03555842116475105,
0.009577657096087933,
-0.03786626085639,
-0.011858233250677586,
0.048753414303064346,
0.01165099162608385,
-0.00090104277478531,
-0.08475849032402039,
0.032657552510499954,
-0.06226735934615135,
-0.0342702753841877,
-0.05190065875649452,
-0.06270187348127365,
-3.2304248819786844e-33,
0.02569447085261345,
-0.025806115940213203,
-0.006180522032082081,
-0.01470500323921442,
0.025266798213124275,
-0.0651053860783577,
0.07285868376493454,
-0.015454757027328014,
0.04767227545380592,
-0.04833074286580086,
-0.023844951763749123,
-0.049231987446546555,
0.06612817943096161,
-0.041357386857271194,
-0.0580984503030777,
0.03020981140434742,
-0.05294487252831459,
-0.09222826361656189,
0.05926821380853653,
0.023465676233172417,
-0.0907551646232605,
-0.017138293012976646,
-0.001960760448127985,
0.030056985095143318,
-0.003895432222634554,
0.022028319537639618,
0.01657874323427677,
-0.020223282277584076,
-0.04506964609026909,
0.009188282303512096,
-0.032867155969142914,
-0.004868252668529749,
-0.06326913833618164,
-0.04851870611310005,
-0.055409085005521774,
-0.012016329914331436,
-0.09916231036186218,
0.06941355019807816,
0.09367869049310684,
0.01687331683933735,
0.05606403574347496,
-0.0014298701426014304,
-0.10124587267637253,
0.04207288846373558,
0.011339489370584488,
0.01460204366594553,
0.0318080373108387,
0.05634923279285431,
-0.03225390985608101,
-0.02997833490371704,
-0.006895056460052729,
-0.05116032809019089,
0.03401745483279228,
0.12329787015914917,
0.0010354421101510525,
0.08349715918302536,
-0.005312228109687567,
0.1441226750612259,
-0.050243914127349854,
0.036069635301828384,
0.01773926615715027,
-0.03921710327267647,
-0.06860591471195221,
0.04997340217232704,
-0.010858044028282166,
0.01366102322936058,
-0.024440225213766098,
-0.06822778284549713,
-0.037469569593667984,
-0.047797270119190216,
-0.0653769001364708,
0.004576207138597965,
0.016594763845205307,
0.09615642577409744,
-0.012441745959222317,
-0.03006577119231224,
0.01886524073779583,
0.06438972800970078,
0.030719632282853127,
0.08869277685880661,
-0.13200314342975616,
0.11858998984098434,
0.01140747219324112,
0.01735454984009266,
0.09254100918769836,
-0.08655911684036255,
-0.010629911907017231,
0.10323596745729446,
-0.04784950613975525,
0.07021787017583847,
-0.018643520772457123,
-0.0032610392663627863,
-0.00922657735645771,
-0.037112440913915634,
-0.01763262413442135,
-4.361240613093287e-8,
0.0012172991409897804,
0.055452849715948105,
-0.033184804022312164,
0.07419092953205109,
0.015177992172539234,
0.0363142192363739,
0.08626782894134521,
0.04779086261987686,
-0.06230223923921585,
0.05613267794251442,
0.025995168834924698,
0.03516300395131111,
-0.05662906914949417,
-0.044429488480091095,
-0.010821182280778885,
-0.001151742530055344,
-0.011970319785177708,
0.029465578496456146,
-0.0573921836912632,
-0.026783159002661705,
-0.039281174540519714,
-0.025499852374196053,
-0.03570981323719025,
0.05832773447036743,
0.015375339426100254,
-0.004942979663610458,
0.007188454270362854,
-0.05121498927474022,
0.023471204563975334,
0.041304003447294235,
-0.04364050179719925,
-0.025136934593319893,
0.01430639810860157,
0.0005250012618489563,
-0.06957352161407471,
0.14859215915203094,
-0.11386599391698837,
0.07446285337209702,
-0.010140018537640572,
0.1266786903142929,
-0.020687956362962723,
0.018587704747915268,
-0.007444539573043585,
-0.009053329937160015,
0.039586931467056274,
-0.0051546585746109486,
-0.07986459881067276,
0.07032199203968048,
0.05341709777712822,
0.07484366744756699,
-0.01222425140440464,
-0.013383413664996624,
0.06663251668214798,
0.015642918646335602,
0.005440529435873032,
-0.04929112643003464,
-0.01931135542690754,
-0.020654473453760147,
0.042939770966768265,
0.018294816836714745,
0.07015354186296463,
-0.068799689412117,
0.01649584248661995,
-0.0529610700905323
] | 0.048249
|
[[circuit-breaker]] === Circuit Breaker Elasticsearch contains multiple circuit breakers used to prevent operations from causing an OutOfMemoryError. Each breaker specifies a limit for how much memory it can use. Additionally, there is a parent-level breaker that specifies the total amount of memory that can be used across all breakers. These settings can be dynamically updated on a live cluster with the <> API. [[parent-circuit-breaker]] [float] ==== Parent circuit breaker The parent-level breaker can be configured with the following setting: `indices.breaker.total.limit`:: Starting limit for overall parent breaker, defaults to 70% of JVM heap. [[fielddata-circuit-breaker]] [float] ==== Field data circuit breaker The field data circuit breaker allows Elasticsearch to estimate the amount of memory a field will require to be loaded into memory. It can then prevent the field data loading by raising an exception. By default the limit is configured to 60% of the maximum JVM heap. It can be configured with the following parameters: `indices.breaker.fielddata.limit`:: Limit for fielddata breaker, defaults to 60% of JVM heap `indices.breaker.fielddata.overhead`:: A constant that all field data estimations are multiplied with to determine a final estimation. Defaults to 1.03 [[request-circuit-breaker]] [float] ==== Request circuit breaker The request circuit breaker allows Elasticsearch to prevent per-request data structures (for example, memory used for calculating aggregations during a request) from exceeding a certain amount of memory. `indices.breaker.request.limit`:: Limit for request breaker, defaults to 60% of JVM heap `indices.breaker.request.overhead`:: A constant that all request estimations are multiplied with to determine a final estimation. Defaults to 1 [[in-flight-circuit-breaker]] [float] ==== In flight requests circuit breaker The in flight requests circuit breaker allows Elasticsearch to limit the memory usage of all currently active incoming requests on transport or HTTP level from exceeding a certain amount of memory on a node. The memory usage is based on the content length of the request itself. `network.breaker.inflight\_requests.limit`:: Limit for in flight requests breaker, defaults to 100% of JVM heap. This means that it is bound by the limit configured for the parent circuit breaker. `network.breaker.inflight\_requests.overhead`:: A constant that all in flight requests estimations are multiplied with to determine a final estimation. Defaults to 1 [[accounting-circuit-breaker]] [float] ==== Accounting requests circuit breaker The accounting circuit breaker allows Elasticsearch to limit the memory usage of things held in memory that are not released when a request is completed. This includes things like the Lucene segment memory. `indices.breaker.accounting.limit`:: Limit for accounting breaker, defaults to 100% of JVM heap. This means that it is bound by the limit configured for the parent circuit breaker. `indices.breaker.accounting.overhead`:: A constant that all accounting estimations are multiplied with to determine a final estimation. Defaults to 1 [[script-compilation-circuit-breaker]] [float] ==== Script compilation circuit breaker Slightly different than the previous memory-based circuit breaker, the script compilation circuit breaker limits the number of inline script compilations within a period of time. See the "prefer-parameters" section of the <> documentation for more information. `script.max\_compilations\_rate`:: Limit for the number of unique dynamic scripts within a certain interval that are allowed to be compiled. Defaults to 75/5m, meaning 75 every 5 minutes.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/indices/circuit_breaker.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.00860009714961052,
0.07989434897899628,
0.007131681777536869,
0.06033306568861008,
-0.0026873524766415358,
-0.017144089564681053,
-0.04525959491729736,
0.06491740047931671,
-0.01086600124835968,
0.062124934047460556,
-0.06023635342717171,
0.003705675480887294,
0.04626816138625145,
0.0009819366969168186,
-0.012468673288822174,
0.03706614673137665,
-0.05767204985022545,
-0.0033257610630244017,
-0.030664168298244476,
-0.006020072847604752,
0.13561393320560455,
0.007670767605304718,
-0.017698854207992554,
-0.016489988192915916,
-0.07708422839641571,
0.0606861338019371,
-0.08686473220586777,
0.023409852758049965,
0.014600303024053574,
-0.03558754175901413,
-0.048776231706142426,
-0.046432577073574066,
0.003426780691370368,
0.06756851822137833,
0.011586656793951988,
0.05247994139790535,
-0.08295220881700516,
0.0072133224457502365,
-0.007993582636117935,
0.033952780067920685,
-0.007550692651420832,
0.07476847618818283,
-0.024902377277612686,
-0.041337523609399796,
0.010791349224746227,
-0.049457401037216187,
-0.025333913043141365,
-0.06019100174307823,
0.015718642622232437,
-0.012674350291490555,
-0.006815094035118818,
0.033130913972854614,
0.09362278133630753,
0.07333912700414658,
-0.0035562547855079174,
0.04385009780526161,
-0.002163380617275834,
-0.004416916519403458,
-0.022897308692336082,
0.04490598291158676,
0.023266425356268883,
-0.06780178844928741,
0.02168762870132923,
-0.09479571133852005,
-0.04150255024433136,
-0.005582832731306553,
0.08534519374370575,
0.04974657669663429,
0.04266344755887985,
0.029511818662285805,
0.040015701204538345,
-0.011564386077225208,
-0.04867538437247276,
-0.01113880705088377,
0.027203045785427094,
0.06509527564048767,
-0.02818218246102333,
-0.0024610860273241997,
0.021118884906172752,
-0.06392806768417358,
-0.09380760043859482,
-0.1363336741924286,
-0.04531911388039589,
-0.06976866722106934,
-0.01246427372097969,
-0.042766034603118896,
0.02186381071805954,
-0.10053938627243042,
0.08066800981760025,
0.05373803526163101,
0.01296295877546072,
-0.06079544126987457,
0.06278957426548004,
0.009936465881764889,
0.04059945419430733,
0.06233328580856323,
-0.06967030465602875,
0.04499435797333717,
0.004014510661363602,
-0.02177463285624981,
0.08189132809638977,
0.013469324447214603,
0.0215181652456522,
0.08695071935653687,
0.01742873713374138,
-0.05940450355410576,
-0.003190971678122878,
0.08000654727220535,
-0.017902279272675514,
-0.029463492333889008,
0.11004571616649628,
0.08916838467121124,
0.002173260087147355,
-0.028290553018450737,
0.01959208957850933,
0.05138541758060455,
0.005793094169348478,
-0.02887459471821785,
-0.01833168789744377,
0.09343306720256805,
0.08910693228244781,
0.006265256088227034,
0.032898638397455215,
-0.005082323681563139,
-0.01713496260344982,
0.06546670198440552,
-0.05379096046090126,
6.326613451881248e-33,
0.06719429790973663,
-0.019630126655101776,
-0.00550253177061677,
-0.04818924888968468,
-0.020745590329170227,
0.0738697275519371,
-0.03391953557729721,
0.138914093375206,
-0.032281212508678436,
0.011936853639781475,
-0.04093777388334274,
0.05169174075126648,
0.026625458151102066,
-0.05944834649562836,
0.13916760683059692,
-0.07029349356889725,
-0.018891187384724617,
-0.04959236830472946,
0.06244528293609619,
0.027063176035881042,
0.0901767835021019,
-0.10400178283452988,
-0.04206328094005585,
0.012857749126851559,
0.008729695342481136,
-0.01876041293144226,
0.006261369213461876,
-0.02577614225447178,
-0.061580028384923935,
0.03581395372748375,
-0.042597826570272446,
0.013764346949756145,
0.04140510782599449,
0.010486387647688389,
0.04535219818353653,
0.0010429521789774299,
-0.00000955641644395655,
0.020672526210546494,
-0.009836230427026749,
-0.12524734437465668,
-0.003049207152798772,
-0.018859539180994034,
0.03827162832021713,
-0.023804161697626114,
-0.08052010834217072,
-0.08373784273862839,
0.02387968823313713,
0.009053514339029789,
0.04816647619009018,
0.03760513663291931,
0.010122043080627918,
-0.03140377253293991,
0.004905682988464832,
0.01934879645705223,
0.04060978814959526,
0.04797998070716858,
-0.001683620037510991,
0.014602349139750004,
0.045487746596336365,
0.08263881504535675,
-0.04087274149060249,
-0.034531012177467346,
0.043320439755916595,
0.06271690130233765,
-0.0025529416743665934,
0.08640304207801819,
0.022308768704533577,
0.010539260692894459,
-0.05862103030085564,
0.025249812752008438,
-0.027926158159971237,
-0.03642871975898743,
-0.009474857710301876,
-0.017218319699168205,
-0.0337652862071991,
-0.07690872251987457,
0.08616048097610474,
0.019446169957518578,
-0.11528239399194717,
-0.0442764014005661,
-0.07763322442770004,
-0.09713321924209595,
0.04303644970059395,
0.028229326009750366,
-0.024321502074599266,
-0.00614964310079813,
0.03339637070894241,
0.029190080240368843,
-0.0367172546684742,
-0.05052785947918892,
0.005417585838586092,
0.014057192951440811,
0.041101373732089996,
-0.01011873222887516,
-0.07501220703125,
-5.30223000188312e-33,
-0.0039642853662371635,
-0.06367691606283188,
0.03311340510845184,
0.008195233531296253,
0.026257643476128578,
-0.04105530306696892,
0.000930727575905621,
0.03822631016373634,
-0.09981337189674377,
-0.027323370799422264,
-0.04146614670753479,
-0.04109788313508034,
-0.005900213494896889,
-0.0594613254070282,
-0.10709823668003082,
-0.0065696449019014835,
-0.05128977447748184,
-0.012342923320829868,
0.06207552179694176,
0.052147090435028076,
-0.04979022964835167,
0.0322914645075798,
0.020649900659918785,
0.0013512888690456748,
-0.0273896474391222,
-0.020634178072214127,
-0.06805691868066788,
0.014274927787482738,
-0.0540996715426445,
0.025425011292099953,
-0.0006559728644788265,
-0.025911545380949974,
0.001360856113024056,
0.0030173591803759336,
-0.07957499474287033,
-0.0019980985671281815,
0.04401707276701927,
0.02660825476050377,
0.02702213265001774,
0.02581671252846718,
0.08206082135438919,
0.045340750366449356,
-0.045562103390693665,
0.06999265402555466,
-0.026971999555826187,
0.011643365025520325,
0.025917628780007362,
0.05648722127079964,
-0.056177783757448196,
0.030532317236065865,
-0.03386211767792702,
-0.04002846032381058,
0.010699128732085228,
0.10371522605419159,
-0.030653465539216995,
-0.02835008129477501,
-0.011882663704454899,
0.01768503338098526,
-0.07318972796201706,
0.003243289655074477,
0.03249748796224594,
-0.04004250466823578,
-0.01913856342434883,
0.008579242043197155,
0.025817034766077995,
-0.05771200358867645,
-0.053374625742435455,
0.03871223330497742,
-0.08233032375574112,
0.02486700564622879,
-0.03179622069001198,
0.023870030418038368,
0.05161014571785927,
0.03611958026885986,
-0.04839729145169258,
-0.022088361904025078,
-0.07860925793647766,
-0.05756828188896179,
0.038904666900634766,
-0.05838317424058914,
-0.04210236296057701,
0.04899242892861366,
-0.05316230282187462,
-0.01889084279537201,
0.02542908862233162,
-0.034530527889728546,
0.029743516817688942,
0.08239152282476425,
-0.0009328991291113198,
0.0612722784280777,
-0.07971362769603729,
-0.059349384158849716,
-0.07937853783369064,
-0.02895461395382881,
-0.06488778442144394,
-4.863990454850864e-8,
0.07958635687828064,
0.007408419623970985,
-0.02865653485059738,
0.024417268112301826,
0.16858983039855957,
-0.08186756819486618,
-0.00593713391572237,
0.0989009365439415,
-0.03103453665971756,
0.0077457791194319725,
0.11377737671136856,
0.05498272925615311,
-0.1021457314491272,
-0.02728077955543995,
0.0010932799195870757,
-0.006589354947209358,
0.017997611314058304,
0.07076507806777954,
-0.05173516646027565,
0.04577527567744255,
-0.07865871489048004,
-0.027409551665186882,
-0.012673654593527317,
0.10483081638813019,
0.10837326943874359,
-0.03832332417368889,
0.1110171377658844,
0.017320837825536728,
0.05349736288189888,
-0.04048629105091095,
-0.08386808633804321,
-0.028165265917778015,
0.030758943408727646,
0.030770791694521904,
-0.03864595666527748,
0.07898467779159546,
-0.07479876279830933,
-0.0017333499854430556,
-0.05724477767944336,
0.08287659287452698,
-0.017229637131094933,
-0.05441189184784889,
0.011074651032686234,
0.05919135734438896,
0.03713231533765793,
0.0063827489502727985,
-0.1326797753572464,
0.03695421293377876,
0.09328192472457886,
0.005283203907310963,
-0.05734167993068695,
-0.02269710786640644,
0.023900851607322693,
0.07032615691423416,
-0.008664248511195183,
0.02146676927804947,
-0.009102411568164825,
-0.015714291483163834,
0.023033635690808296,
0.035582397133111954,
0.07908155769109726,
-0.028618570417165756,
-0.028499756008386612,
-0.047985322773456573
] | 0.082955
|
[[modules-fielddata]] === Fielddata The field data cache is used mainly when sorting on or computing aggregations on a field. It loads all the field values to memory in order to provide fast document based access to those values. The field data cache can be expensive to build for a field, so its recommended to have enough memory to allocate it, and to keep it loaded. The amount of memory used for the field data cache can be controlled using `indices.fielddata.cache.size`. Note: reloading the field data which does not fit into your cache will be expensive and perform poorly. `indices.fielddata.cache.size`:: The max size of the field data cache, eg `30%` of node heap space, or an absolute value, eg `12GB`. Defaults to unbounded. Also see <>. NOTE: These are static settings which must be configured on every data node in the cluster. [float] [[fielddata-monitoring]] ==== Monitoring field data You can monitor memory usage for field data as well as the field data circuit breaker using <>
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/indices/fielddata.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.06900867074728012,
0.05913058668375015,
-0.06653270125389099,
0.08402102440595627,
0.008688666857779026,
-0.08651279658079147,
0.044631775468587875,
0.023234548047184944,
0.022586015984416008,
0.02118643745779991,
-0.03020559437572956,
0.08975183963775635,
-0.059325262904167175,
-0.05872044712305069,
-0.054260123521089554,
0.02456396073102951,
-0.009673734195530415,
-0.012500696815550327,
-0.0756649598479271,
-0.03382004052400589,
-0.007689833641052246,
-0.0025855167768895626,
-0.0015795762883499265,
0.03323204070329666,
-0.06925833970308304,
0.04566391557455063,
-0.04832668602466583,
0.0287063866853714,
0.00956055149435997,
-0.01525621023029089,
-0.07162417471408844,
0.052948206663131714,
0.011543014086782932,
0.054787348955869675,
-0.01695040799677372,
0.08188693225383759,
0.0005358480266295373,
-0.03969945013523102,
-0.05657361447811127,
-0.011423340998589993,
0.0009225077228620648,
0.02896629273891449,
-0.01783023029565811,
0.03362204134464264,
-0.00000961672321864171,
-0.022290943190455437,
-0.033018071204423904,
-0.022040318697690964,
0.0015405960148200393,
-0.0057838293723762035,
-0.024107838049530983,
0.08640708774328232,
-0.03600985184311867,
0.05994417145848274,
0.01930965855717659,
0.08114250004291534,
-0.017589716240763664,
-0.009991651400923729,
-0.048253171145915985,
0.01731817051768303,
-0.01985364593565464,
-0.04260312393307686,
0.046483997255563736,
-0.050708964467048645,
-0.047086842358112335,
-0.021690310910344124,
0.059899475425481796,
-0.028500517830252647,
0.06723076105117798,
-0.04710831865668297,
0.030078914016485214,
0.06610336899757385,
-0.05069854110479355,
-0.0008926839218474925,
-0.07887502014636993,
0.04810338094830513,
-0.007577251177281141,
-0.03739068657159805,
0.09120170027017593,
-0.09887875616550446,
-0.05886881425976753,
-0.05672253668308258,
0.018727364018559456,
-0.005976769607514143,
-0.007015392184257507,
-0.11031758040189743,
0.02616085112094879,
-0.009745475836098194,
0.009155548177659512,
-0.04178324714303017,
0.05674005672335625,
-0.009236176498234272,
-0.006690925918519497,
0.019755251705646515,
-0.009828559122979641,
0.07160139083862305,
0.005827802233397961,
0.030475111678242683,
-0.0018650719430297613,
-0.01809578947722912,
0.06941139698028564,
0.012575977481901646,
0.0022808315698057413,
0.15488164126873016,
0.0013603412080556154,
-0.08002942055463791,
0.04715583473443985,
0.0552489198744297,
-0.07394189387559891,
0.06593327224254608,
0.07423614710569382,
0.05857834219932556,
-0.0873497873544693,
0.0019040157785639167,
0.03825277090072632,
0.11248061805963516,
-0.043996747583150864,
-0.010872872546315193,
-0.07269921898841858,
0.11038219928741455,
0.07713870704174042,
-0.028851179406046867,
-0.01939014159142971,
-0.03820542246103287,
0.004027032293379307,
0.01431214064359665,
-0.007570667192339897,
6.630552209965736e-33,
0.015952177345752716,
-0.010624037124216557,
0.016440169885754585,
0.0014661229215562344,
-0.04485034942626953,
0.02562282234430313,
0.009231586009263992,
0.08594533801078796,
-0.047105640172958374,
0.024943580850958824,
-0.024616749957203865,
0.09906253963708878,
-0.02118319645524025,
-0.06542548537254333,
0.10537967830896378,
-0.0796203762292862,
0.0030065374448895454,
-0.003893392626196146,
0.05679737403988838,
-0.03490880876779556,
0.10896002501249313,
-0.00433371402323246,
-0.009773842990398407,
0.04393213987350464,
0.011899112723767757,
0.03204512223601341,
-0.022791460156440735,
-0.016550187021493912,
-0.0637165904045105,
0.03474810719490051,
0.0038443852681666613,
-0.010170225985348225,
0.04134475067257881,
-0.02144807204604149,
0.04587177932262421,
-0.034570321440696716,
0.03201572969555855,
0.002662086393684149,
-0.04961830750107765,
-0.07864700257778168,
0.03196370601654053,
0.05185846611857414,
0.07402591407299042,
-0.14039650559425354,
-0.09581755846738815,
-0.06146521121263504,
0.0449330098927021,
0.03514106199145317,
0.06312146037817001,
0.009814133867621422,
0.08150043338537216,
-0.014733461663126945,
0.0209328755736351,
0.0879957526922226,
0.05241480469703674,
0.04425349831581116,
0.029013369232416153,
-0.03287234902381897,
0.03406335040926933,
0.051477205008268356,
-0.02175232023000717,
-0.06416549533605576,
-0.019799310714006424,
0.02314000390470028,
-0.016369611024856567,
0.08648039400577545,
0.06590428948402405,
0.07734773308038712,
-0.006416263058781624,
0.019954213872551918,
-0.003851263551041484,
0.03628446161746979,
-0.036334022879600525,
-0.022023560479283333,
-0.03455429896712303,
-0.002391916699707508,
0.01954737864434719,
-0.06590104848146439,
-0.16922079026699066,
-0.005111137870699167,
-0.023141270503401756,
0.037084437906742096,
-0.03387404605746269,
-0.010287671349942684,
-0.049258530139923096,
-0.06707321852445602,
0.00554951885715127,
0.05096251145005226,
-0.058856502175331116,
-0.039349693804979324,
0.04463740810751915,
0.061739277094602585,
0.09315595030784607,
-0.0715251937508583,
-0.11798490583896637,
-6.00419004513008e-33,
0.014896515756845474,
-0.0724991038441658,
-0.028582390397787094,
0.068935826420784,
0.04668295383453369,
-0.03821446746587753,
0.0014742586063221097,
0.02567063458263874,
0.02551887184381485,
-0.026321446523070335,
-0.07032427191734314,
-0.06356819719076157,
-0.04352262243628502,
-0.04918411374092102,
0.022213835269212723,
0.07901278138160706,
-0.07794633507728577,
-0.07129668444395065,
0.038416583091020584,
0.0017640786245465279,
-0.07113930583000183,
0.03848717361688614,
0.06010616570711136,
0.027763836085796356,
-0.06717339158058167,
-0.02265145070850849,
-0.061385974287986755,
-0.02326519601047039,
0.00017102929996326566,
-0.06266722083091736,
-0.0071201384998857975,
-0.03236851096153259,
-0.02242569625377655,
-0.011542346328496933,
-0.008819262497127056,
-0.028044171631336212,
0.092787966132164,
-0.0012727179564535618,
0.01706676371395588,
0.047677405178546906,
0.05154368653893471,
0.11099826544523239,
-0.05830169841647148,
0.03819367662072182,
0.023521874099969864,
-0.033386699855327606,
-0.038020238280296326,
0.08814475685358047,
0.0003855674876831472,
-0.025748979300260544,
0.008641312830150127,
-0.10163556784391403,
-0.014406481757760048,
0.0442192517220974,
-0.012350542470812798,
0.015135991387069225,
-0.0002132955560227856,
0.02866334095597267,
-0.051332391798496246,
-0.002774699591100216,
0.09346214681863785,
-0.12447545677423477,
-0.09015949070453644,
0.01222649309784174,
-0.008546261116862297,
0.05667909234762192,
-0.03429093211889267,
-0.06064639240503311,
-0.05761004611849785,
0.04113905504345894,
-0.030049534514546394,
-0.0023481124080717564,
-0.006987201515585184,
0.04063952714204788,
-0.05849172919988632,
0.018487440422177315,
0.016050225123763084,
-0.008444037288427353,
0.09277991205453873,
0.009747137315571308,
0.05351443588733673,
0.04963920637965202,
-0.010875651612877846,
-0.051500868052244186,
0.0009340794640593231,
-0.003988726995885372,
-0.03623664751648903,
0.09744495153427124,
-0.04976242780685425,
0.015851566568017006,
-0.08371233940124512,
-0.047679293900728226,
-0.023585332557559013,
-0.02097119204699993,
-0.015603490173816681,
-5.0391665951110554e-8,
-0.019393041729927063,
-0.01914178393781185,
-0.016250740736722946,
0.06923738121986389,
0.04668759927153587,
-0.08919385820627213,
0.005251268390566111,
0.12479597330093384,
0.11288079619407654,
-0.0018894642125815153,
0.10886798053979874,
-0.005105013959109783,
-0.12549424171447754,
-0.047491252422332764,
0.014373480342328548,
0.02418571338057518,
0.025549666956067085,
-0.07900045812129974,
-0.01693999208509922,
-0.017561547458171844,
-0.001256470801308751,
-0.03952199965715408,
-0.030597493052482605,
0.010253694839775562,
0.04135508835315704,
-0.031440675258636475,
0.10357868671417236,
0.05552773177623749,
0.055660273879766464,
-0.034239672124385834,
-0.03169660270214081,
-0.04180225729942322,
0.0691738873720169,
-0.01292195450514555,
0.03160296753048897,
0.015657970681786537,
-0.020351683720946312,
-0.01079513505101204,
0.03747719153761864,
0.11086952686309814,
0.012431909330189228,
0.04263953119516373,
-0.03167727217078209,
-0.03415782004594803,
0.04121089354157448,
-0.020839937031269073,
-0.07894293963909149,
0.08389046043157578,
0.05585075169801712,
0.006885812152177095,
-0.024662017822265625,
-0.056127190589904785,
-0.05241477116942406,
0.026749420911073685,
-0.037239886820316315,
-0.01656062714755535,
0.007825101725757122,
0.035763099789619446,
0.061115335673093796,
0.022168561816215515,
0.007420865818858147,
-0.004019661340862513,
-0.09000211954116821,
-0.06976627558469772
] | 0.126996
|
[[indexing-buffer]] === Indexing Buffer The indexing buffer is used to store newly indexed documents. When it fills up, the documents in the buffer are written to a segment on disk. It is divided between all shards on the node. The following settings are \_static\_ and must be configured on every data node in the cluster: `indices.memory.index\_buffer\_size`:: Accepts either a percentage or a byte size value. It defaults to `10%`, meaning that `10%` of the total heap allocated to a node will be used as the indexing buffer size shared across all shards. `indices.memory.min\_index\_buffer\_size`:: If the `index\_buffer\_size` is specified as a percentage, then this setting can be used to specify an absolute minimum. Defaults to `48mb`. `indices.memory.max\_index\_buffer\_size`:: If the `index\_buffer\_size` is specified as a percentage, then this setting can be used to specify an absolute maximum. Defaults to unbounded.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/indices/indexing_buffer.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.09349849820137024,
0.015266858041286469,
-0.014843003824353218,
0.07496373355388641,
-0.02076360210776329,
-0.03646853566169739,
-0.017074555158615112,
0.021151581779122353,
0.03480653837323189,
-0.0033618996385484934,
-0.04046126827597618,
0.042251210659742355,
0.0185378585010767,
0.009146874770522118,
-0.1150534451007843,
-0.04506403207778931,
0.009512006305158138,
0.004175901412963867,
-0.037857528775930405,
0.043008316308259964,
0.0861683189868927,
0.0116535359993577,
-0.003537264186888933,
-0.04655807092785835,
-0.07422059029340744,
-0.0019498167093843222,
-0.09855955094099045,
-0.03574885055422783,
0.09923171252012253,
0.010008725337684155,
-0.01181944552809,
0.01849679835140705,
0.025989742949604988,
0.018955176696181297,
0.011215082369744778,
0.050481829792261124,
0.012350817210972309,
-0.09108427166938782,
-0.10318999737501144,
-0.007446545176208019,
0.06559699028730392,
0.03198425844311714,
-0.08499500155448914,
0.022133132442831993,
-0.02355300262570381,
0.01739138923585415,
-0.06774818897247314,
0.00799485482275486,
-0.050590720027685165,
-0.007414042484015226,
-0.06864746659994125,
-0.024100203067064285,
-0.040256891399621964,
0.061158470809459686,
0.004027210641652346,
0.031015826389193535,
-0.015268269926309586,
0.011419054120779037,
-0.004419818986207247,
-0.04314793646335602,
0.07442834973335266,
-0.04914085566997528,
0.03464528173208237,
-0.03729354217648506,
-0.011219330132007599,
-0.005123327951878309,
0.1365068554878235,
0.0050390553660690784,
-0.01439527329057455,
0.015587068162858486,
-0.015567251481115818,
0.06819318979978561,
-0.06953240931034088,
0.002303772373124957,
-0.0030453470535576344,
0.039945606142282486,
0.029384175315499306,
0.01616988331079483,
-0.039794523268938065,
-0.051361337304115295,
-0.07074189186096191,
-0.07653437554836273,
0.10296857357025146,
-0.02890777960419655,
-0.05933628976345062,
-0.03252886235713959,
-0.0227873045951128,
-0.044688157737255096,
0.06283508986234665,
0.012274360284209251,
0.016030587255954742,
0.020809156820178032,
0.002444569254294038,
-0.04537256062030792,
0.03977672755718231,
0.027510205283761024,
-0.02193482406437397,
0.09145339578390121,
0.006251878570765257,
-0.01572473905980587,
0.012203472666442394,
-0.015925951302051544,
0.009862330742180347,
0.030828606337308884,
-0.015106644481420517,
-0.027981841936707497,
-0.04842643812298775,
0.009749133139848709,
-0.04630556330084801,
0.04244288429617882,
0.06469058990478516,
0.054807890206575394,
0.01861455850303173,
-0.005821332801133394,
0.03699151426553726,
0.08419166505336761,
0.02129671908915043,
-0.03488226234912872,
-0.006836498621851206,
0.058753956109285355,
0.030249759554862976,
0.011447301134467125,
-0.012769543565809727,
-0.007721724919974804,
-0.027918070554733276,
0.022759681567549706,
-0.05102752521634102,
6.042214876697407e-35,
0.0635138675570488,
-0.057333819568157196,
0.0005253247218206525,
-0.021031146869063377,
-0.030575862154364586,
-0.013631601817905903,
-0.038088396191596985,
0.03106195479631424,
-0.08687757700681686,
-0.019881682470440865,
-0.10273610800504684,
0.024362727999687195,
0.03607100993394852,
-0.02821819670498371,
0.04817361757159233,
-0.04056340456008911,
0.0437086783349514,
0.11089849472045898,
0.0340258814394474,
-0.05331265553832054,
0.05024657025933266,
0.018652472645044327,
0.006223619449883699,
-0.04384765028953552,
-0.06658473610877991,
-0.012794842012226582,
-0.02474791184067726,
-0.16089841723442078,
-0.033816687762737274,
0.0010012449929490685,
-0.06542947143316269,
-0.025000300258398056,
0.04787042364478111,
-0.0037771398201584816,
0.043122388422489166,
0.05819409713149071,
-0.07858474552631378,
0.05318601056933403,
-0.05869979411363602,
-0.0754009410738945,
0.07776978611946106,
0.0032573745120316744,
0.07135654240846634,
-0.07503834366798401,
-0.05678839981555939,
0.00984548032283783,
-0.00522930733859539,
-0.007057240232825279,
-0.023530814796686172,
0.01194271445274353,
-0.007744475733488798,
0.0015552947297692299,
0.012992077507078648,
0.1132492944598198,
0.040350962430238724,
0.04303854703903198,
0.07138539105653763,
-0.002356883604079485,
0.0016540660290047526,
0.05778423324227333,
0.005767283961176872,
-0.05444364249706268,
0.03080632910132408,
0.10458866506814957,
0.0055384403094649315,
0.016979090869426727,
0.054700978100299835,
0.09157083928585052,
0.02119167521595955,
0.05430900678038597,
-0.03961113840341568,
0.054362792521715164,
0.04390449449419975,
0.059206318110227585,
-0.07224290817975998,
-0.07298745214939117,
-0.00931101106107235,
-0.08601256459951401,
-0.11299648880958557,
-0.006454081740230322,
-0.054888494312763214,
-0.015256854705512524,
-0.004045167937874794,
-0.08445216715335846,
-0.0925905704498291,
-0.012608961202204227,
0.05358491092920303,
0.026173217222094536,
-0.03326833248138428,
-0.10883090645074844,
0.02831551805138588,
-0.04330600053071976,
0.030359499156475067,
-0.10729721188545227,
-0.08741126954555511,
-1.4543440186983967e-33,
0.03288346901535988,
-0.07513993233442307,
-0.06036096438765526,
0.08231428265571594,
-0.010806760750710964,
0.013295826502144337,
0.06105287745594978,
0.051096491515636444,
-0.06783503293991089,
-0.060053035616874695,
-0.014570094645023346,
0.006976076401770115,
0.05495394393801689,
-0.042767785489559174,
-0.08789420127868652,
0.03428421542048454,
0.010584934614598751,
-0.11788352578878403,
0.0674440935254097,
0.006218991242349148,
-0.05385018140077591,
-0.05518388748168945,
0.05709528550505638,
0.09146308153867722,
-0.03208202123641968,
-0.049458034336566925,
-0.01625627651810646,
-0.0493113249540329,
-0.07189279049634933,
-0.02520091086626053,
0.0054178377613425255,
-0.04365614056587219,
-0.04165610671043396,
-0.03748755156993866,
-0.06227864325046539,
-0.0628175362944603,
-0.018986858427524567,
-0.028403541073203087,
0.017624424770474434,
0.0721135288476944,
0.05697357654571533,
0.04807068780064583,
-0.08838387578725815,
0.028618158772587776,
0.011944811791181564,
0.013763575814664364,
-0.031250130385160446,
0.013687552884221077,
0.009041400626301765,
-0.11058925092220306,
0.0222326647490263,
-0.049014296382665634,
0.11036937683820724,
0.09152738004922867,
0.008463751524686813,
0.044113948941230774,
-0.04809495806694031,
0.08649254590272903,
-0.03476228192448616,
0.02976137399673462,
0.07144878059625626,
-0.025830911472439766,
-0.09839178621768951,
-0.024260878562927246,
-0.03809690847992897,
-0.009096412919461727,
-0.03738651052117348,
-0.06500185281038284,
-0.10677724331617355,
-0.008054775185883045,
-0.0577731691300869,
0.042147669941186905,
0.030008427798748016,
0.05666378512978554,
-0.026240689679980278,
-0.034485723823308945,
0.019321473315358162,
-0.02256947010755539,
0.04379512369632721,
0.03477348014712334,
-0.0883522555232048,
0.15835417807102203,
0.016391076147556305,
0.059398382902145386,
0.03575928509235382,
-0.061948101967573166,
-0.0018193951109424233,
0.07721009105443954,
-0.06301558017730713,
0.02689320407807827,
-0.06225847825407982,
-0.018506649881601334,
-0.04860571026802063,
-0.02099871076643467,
0.0015100952005013824,
-4.572650524892197e-8,
0.019085058942437172,
-0.0014535128138959408,
-0.02840334177017212,
0.09353923797607422,
0.008848381228744984,
-0.033958688378334045,
0.042114321142435074,
0.08518381416797638,
-0.022470664232969284,
0.04481013864278793,
0.07050955295562744,
-0.03708869591355324,
-0.12801972031593323,
-0.025561202317476273,
0.03437095135450363,
-0.003022839780896902,
0.054137736558914185,
-0.01134985126554966,
-0.02103612571954727,
-0.04309865087270737,
-0.0011113176587969065,
0.004387900698930025,
0.011365912854671478,
-0.0006427560583688319,
0.07366883754730225,
-0.01134118065237999,
0.08056114614009857,
0.026068290695548058,
0.009061459451913834,
-0.03941599652171135,
-0.017162535339593887,
-0.020440950989723206,
0.03608999401330948,
0.012637581676244736,
-0.005657964386045933,
0.09935376793146133,
-0.07848334312438965,
0.08442191034555435,
0.01625208929181099,
0.09784959256649017,
-0.012154432013630867,
0.021296372637152672,
0.020977627485990524,
-0.026489486917853355,
0.014611729420721531,
0.041370123624801636,
-0.058939989656209946,
0.10145573318004608,
0.036714211106300354,
0.025717994198203087,
0.01901174522936344,
-0.008823547512292862,
0.04342690482735634,
0.08022067695856094,
0.046368345618247986,
-0.006454071030020714,
-0.020476583391427994,
-0.002369227819144726,
0.016456810757517815,
0.06583042442798615,
0.08736170828342438,
0.022556301206350327,
-0.024713687598705292,
-0.052336353808641434
] | 0.129728
|
[[shard-request-cache]] === Shard request cache When a search request is run against an index or against many indices, each involved shard executes the search locally and returns its local results to the \_coordinating node\_, which combines these shard-level results into a ``global'' result set. The shard-level request cache module caches the local results on each shard. This allows frequently used (and potentially heavy) search requests to return results almost instantly. The requests cache is a very good fit for the logging use case, where only the most recent index is being actively updated -- results from older indices will be served directly from the cache. [IMPORTANT] =================================== By default, the requests cache will only cache the results of search requests where `size=0`, so it will not cache `hits`, but it will cache `hits.total`, <>, and <>. Most queries that use `now` (see <>) cannot be cached. =================================== [float] ==== Cache invalidation The cache is smart -- it keeps the same \_near real-time\_ promise as uncached search. Cached results are invalidated automatically whenever the shard refreshes, but only if the data in the shard has actually changed. In other words, you will always get the same results from the cache as you would for an uncached search request. The longer the refresh interval, the longer that cached entries will remain valid. If the cache is full, the least recently used cache keys will be evicted. The cache can be expired manually with the <>: [source,js] ------------------------ POST /kimchy,elasticsearch/\_cache/clear?request=true ------------------------ // CONSOLE // TEST[s/^/PUT kimchy\nPUT elasticsearch\n/] [float] ==== Enabling and disabling caching The cache is enabled by default, but can be disabled when creating a new index as follows: [source,js] ----------------------------- PUT /my\_index { "settings": { "index.requests.cache.enable": false } } ----------------------------- // CONSOLE It can also be enabled or disabled dynamically on an existing index with the <> API: [source,js] ----------------------------- PUT /my\_index/\_settings { "index.requests.cache.enable": true } ----------------------------- // CONSOLE // TEST[continued] [float] ==== Enabling and disabling caching per request The `request\_cache` query-string parameter can be used to enable or disable caching on a \*per-request\* basis. If set, it overrides the index-level setting: [source,js] ----------------------------- GET /my\_index/\_search?request\_cache=true { "size": 0, "aggs": { "popular\_colors": { "terms": { "field": "colors" } } } } ----------------------------- // CONSOLE // TEST[continued] IMPORTANT: If your query uses a script whose result is not deterministic (e.g. it uses a random function or references the current time) you should set the `request\_cache` flag to `false` to disable caching for that request. Requests where `size` is greater than 0 will not be cached even if the request cache is enabled in the index settings. To cache these requests you will need to use the query-string parameter detailed here. [float] ==== Cache key The whole JSON body is used as the cache key. This means that if the JSON changes -- for instance if keys are output in a different order -- then the cache key will not be recognised. TIP: Most JSON libraries support a \_canonical\_ mode which ensures that JSON keys are always emitted in the same order. This canonical mode can be used in the application to ensure that a request is always serialized in the same way. [float] ==== Cache settings The cache is managed at the node level, and has a default maximum size of `1%` of the heap. This can be changed in the `config/elasticsearch.yml` file with: [source,yaml] -------------------------------- indices.requests.cache.size: 2% -------------------------------- Also, you can use the +indices.requests.cache.expire+ setting to specify a TTL for cached results, but there should be no reason to do so. Remember that stale results are automatically invalidated when the index
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/indices/request_cache.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.01593770645558834,
0.03098813258111477,
0.017470838502049446,
0.06383845955133438,
0.0248227771371603,
-0.07617373019456863,
0.011812499724328518,
-0.08588992804288864,
0.052604831755161285,
0.01004927046597004,
-0.027651596814393997,
0.05718331038951874,
-0.01536592748016119,
-0.024635545909404755,
-0.01873507909476757,
-0.0072854384779930115,
0.038774266839027405,
0.0190904438495636,
-0.055742643773555756,
-0.016183609142899513,
0.05558488890528679,
0.04634470492601395,
0.07589002698659897,
-0.006634335964918137,
-0.033227354288101196,
-0.06168331950902939,
-0.008810851722955704,
-0.061500437557697296,
0.05231981351971626,
-0.0050188591703772545,
-0.04455218091607094,
0.032280322164297104,
-0.09311085939407349,
0.06896544992923737,
-0.08957002311944962,
0.04326122626662254,
-0.04940563440322876,
-0.06751679629087448,
-0.02610231563448906,
-0.024258378893136978,
0.010468371212482452,
-0.002205722965300083,
-0.019765323027968407,
-0.040051162242889404,
-0.0033832197077572346,
-0.007199530024081469,
-0.022095568478107452,
-0.0022901915945112705,
-0.0264793299138546,
-0.013368595391511917,
-0.03866492211818695,
-0.04669029638171196,
-0.03608164191246033,
-0.020167816430330276,
0.011211277917027473,
-0.009494265541434288,
-0.034833479672670364,
-0.03260062634944916,
-0.025954129174351692,
-0.05145249515771866,
0.019514363259077072,
-0.041980136185884476,
0.03930526599287987,
-0.033776864409446716,
0.002808491699397564,
-0.04606407508254051,
0.0776832327246666,
-0.030782761052250862,
0.13032543659210205,
0.01105687115341425,
-0.06595951318740845,
0.031150303781032562,
-0.11995704472064972,
-0.042632389813661575,
0.03479085862636566,
0.08767775446176529,
-0.007293767295777798,
-0.04876326024532318,
0.04548576846718788,
-0.08137623965740204,
-0.060852035880088806,
-0.020449461415410042,
0.03309657424688339,
0.008870339021086693,
0.027521489188075066,
-0.07614192366600037,
0.03517154976725578,
-0.03604726493358612,
0.12543171644210815,
-0.0721934512257576,
0.04460928589105606,
0.017765743657946587,
-0.013113271445035934,
-0.015580394305288792,
0.029838841408491135,
-0.001037502777762711,
0.06120749190449715,
0.16238000988960266,
0.011255078949034214,
0.000220864822040312,
0.0619317851960659,
0.051339056342840195,
-0.06370272487401962,
-0.010010182857513428,
0.031194983050227165,
0.003790039336308837,
-0.04641299322247505,
0.04233449324965477,
-0.012806995771825314,
-0.00556406332179904,
-0.006798396818339825,
0.03927526995539665,
0.023571988567709923,
-0.04315256327390671,
0.011415945366024971,
0.07292302697896957,
0.057692646980285645,
-0.04172975569963455,
-0.025697048753499985,
0.06628691405057907,
0.05050705745816231,
0.030887333676218987,
0.016208024695515633,
-0.031905218958854675,
0.01271956879645586,
0.03744475916028023,
-0.08125609904527664,
6.073338867659186e-33,
0.057570233941078186,
-0.003187354654073715,
-0.009511347860097885,
-0.014635268598794937,
-0.05354676395654678,
0.06798502057790756,
0.03309979662299156,
0.029927851632237434,
-0.08106955140829086,
-0.001008913153782487,
-0.05900120735168457,
0.0972997397184372,
-0.027802810072898865,
-0.02407338097691536,
0.03274818882346153,
-0.003101932117715478,
0.04450302943587303,
0.006847015116363764,
0.037856392562389374,
0.03897532448172569,
0.013169859535992146,
0.043047502636909485,
0.047779105603694916,
-0.03899605572223663,
0.04060064256191254,
0.0024053973611444235,
0.027634743601083755,
-0.0316171757876873,
-0.11794228851795197,
-0.003444481175392866,
0.0030504080932587385,
-0.036227937787771225,
-0.04561772570014,
-0.011613486334681511,
0.02304007112979889,
0.04343760013580322,
0.0005973178776912391,
0.024801183491945267,
-0.014561304822564125,
-0.06144607067108154,
-0.026901816949248314,
0.008589171804487705,
0.027004031464457512,
-0.0954747200012207,
-0.14265786111354828,
-0.05600979924201965,
-0.12274957448244095,
0.06996282190084457,
0.02793963812291622,
-0.002184322103857994,
0.0236663818359375,
0.06616642326116562,
0.015530102886259556,
0.007775557693094015,
-0.017039233818650246,
-0.013795210048556328,
0.07926426827907562,
-0.0010942643275484443,
-0.03520304337143898,
0.04341111704707146,
0.06322749704122543,
-0.08447442203760147,
0.044519804418087006,
0.045826468616724014,
-0.03427119553089142,
0.060298580676317215,
0.07426412403583527,
0.12960071861743927,
0.03452059254050255,
0.09372671693563461,
0.013998642563819885,
0.04538093879818916,
0.04016927629709244,
-0.04503440856933594,
-0.031782060861587524,
-0.04217818006873131,
-0.07180214673280716,
-0.06414905190467834,
-0.037188488990068436,
0.011256495490670204,
0.05562007799744606,
-0.02778766117990017,
-0.0934295728802681,
0.041714347898960114,
-0.027471603825688362,
-0.013233572244644165,
0.03995537757873535,
-0.0721140205860138,
-0.05907309055328369,
0.0035918974317610264,
-0.09055574238300323,
0.01791774481534958,
0.07662351429462433,
-0.07242380827665329,
-0.1032528430223465,
-6.583241501081016e-33,
0.028889816254377365,
-0.09519887715578079,
-0.023375198245048523,
0.08657149225473404,
0.00011499917309265584,
-0.06197604537010193,
0.025458484888076782,
-0.0735449269413948,
-0.025243135169148445,
0.017098940908908844,
0.043444521725177765,
-0.03866321220993996,
0.05928749218583107,
-0.019119935110211372,
0.011341987177729607,
0.10802020877599716,
-0.04634813591837883,
-0.08672919124364853,
0.005966539494693279,
0.024721287190914154,
-0.04121294990181923,
0.062053974717855453,
-0.09051147103309631,
0.058224160224199295,
-0.06196149066090584,
-0.00958266295492649,
-0.015950877219438553,
-0.03604155406355858,
-0.017756333574652672,
-0.048121314495801926,
-0.01658078096807003,
-0.03209399804472923,
-0.05261336639523506,
-0.05513937771320343,
-0.010943652130663395,
0.022856630384922028,
0.027475234121084213,
-0.019587039947509766,
0.024837510660290718,
0.03388180956244469,
0.03713282570242882,
0.015122868120670319,
0.0026146627496927977,
0.03805917128920555,
-0.0004582563415169716,
0.014028140343725681,
-0.07720471173524857,
0.07565607875585556,
-0.020812485367059708,
0.018699783831834793,
0.05788617581129074,
-0.03649311512708664,
0.04195130988955498,
0.0987648293375969,
0.001958272885531187,
0.0523386150598526,
-0.12206980586051941,
0.057770393788814545,
-0.09733463823795319,
0.05863392353057861,
-0.02079812064766884,
-0.053384196013212204,
-0.07991074025630951,
-0.009632634930312634,
-0.055002886801958084,
0.006953842472285032,
-0.024232815951108932,
-0.12635162472724915,
0.017112616449594498,
-0.05039913207292557,
0.027283260598778725,
-0.03236289322376251,
-0.024891002103686333,
0.022227589040994644,
-0.0036160124000161886,
0.03864361345767975,
0.018580924719572067,
-0.020836958661675453,
-0.0028081745840609074,
0.0858008861541748,
-0.08074834197759628,
0.04679884389042854,
0.004762373398989439,
0.017308315262198448,
0.05708311125636101,
-0.036882009357213974,
-0.036709003150463104,
0.10102729499340057,
-0.03305558115243912,
-0.01786833070218563,
0.01220192201435566,
-0.06080182269215584,
-0.09115483611822128,
-0.03187490627169609,
-0.01690598763525486,
-5.3289994639271754e-8,
-0.031271494925022125,
0.023205764591693878,
-0.0077134971506893635,
0.06669142097234726,
0.06639094650745392,
0.021547658368945122,
0.04818939045071602,
0.06655150651931763,
-0.10278023034334183,
0.018374066799879074,
0.12290210276842117,
-0.03526103496551514,
0.0022492376156151295,
-0.03154574707150459,
0.05411536246538162,
0.014317075721919537,
0.011058966629207134,
-0.036497458815574646,
-0.056864891201257706,
-0.08889580518007278,
-0.06209916993975639,
0.06206673011183739,
0.0069760219193995,
0.014655080623924732,
-0.026260560378432274,
0.027683228254318237,
0.09703579545021057,
0.08761036396026611,
0.014018862508237362,
0.031705375760793686,
-0.02015182003378868,
-0.014300002716481686,
0.03219500929117203,
-0.029134955257177353,
0.053957123309373856,
0.03079693205654621,
-0.09785989671945572,
0.0025656127836555243,
0.055039383471012115,
0.09607579559087753,
-0.03088890202343464,
0.0077625964768230915,
0.012812756933271885,
0.057472553104162216,
-0.04046774283051491,
-0.02934831939637661,
-0.04412116855382919,
0.02784864977002144,
0.029225271195173264,
0.04284682869911194,
0.021669473499059677,
-0.04119144380092621,
-0.0394475944340229,
0.05553864687681198,
0.028375647962093353,
0.0010408171219751239,
0.010105365887284279,
-0.04829767346382141,
0.11003667861223221,
0.048971470445394516,
0.14796501398086548,
-0.08778686076402664,
-0.02906307391822338,
-0.06328912824392319
] | 0.080277
|
of the heap. This can be changed in the `config/elasticsearch.yml` file with: [source,yaml] -------------------------------- indices.requests.cache.size: 2% -------------------------------- Also, you can use the +indices.requests.cache.expire+ setting to specify a TTL for cached results, but there should be no reason to do so. Remember that stale results are automatically invalidated when the index is refreshed. This setting is provided for completeness' sake only. [float] ==== Monitoring cache usage The size of the cache (in bytes) and the number of evictions can be viewed by index, with the <> API: [source,js] ------------------------ GET /\_stats/request\_cache?human ------------------------ // CONSOLE or by node with the <> API: [source,js] ------------------------ GET /\_nodes/stats/indices/request\_cache?human ------------------------ // CONSOLE
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/indices/request_cache.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.0009760959073901176,
0.03878037631511688,
0.004422876052558422,
0.06136243790388107,
-0.021345632150769234,
-0.0868605375289917,
-0.017871243879199028,
-0.026362141594290733,
0.10090703517198563,
0.004808512516319752,
-0.04876124858856201,
0.032243888825178146,
-0.02648283541202545,
-0.06729208678007126,
-0.05739166587591171,
-0.04950902611017227,
-0.0428798571228981,
0.014528530649840832,
-0.025168413296341896,
-0.0525730662047863,
0.10463293641805649,
0.096610888838768,
0.03572104871273041,
-0.052989035844802856,
-0.03850393742322922,
-0.023951157927513123,
-0.08736694604158401,
-0.03183784335851669,
0.06539751589298248,
-0.0030864395666867495,
-0.06154443323612213,
0.03789491578936577,
-0.03937755897641182,
-0.001318513648584485,
0.04075522720813751,
0.05130104348063469,
-0.04160440340638161,
-0.06684572249650955,
-0.009038310497999191,
0.04533432051539421,
0.039353758096694946,
0.05670500546693802,
-0.00907073263078928,
-0.049462441354990005,
-0.044720012694597244,
-0.06702259927988052,
-0.0298872422426939,
-0.0013155735796317458,
-0.05809015408158302,
0.03355815261602402,
0.036055777221918106,
-0.0532892644405365,
-0.019250307232141495,
-0.003847442101687193,
-0.012528429739177227,
0.0018064385512843728,
-0.01648579351603985,
-0.021811937913298607,
-0.1296387016773224,
-0.000493194442242384,
0.046364400535821915,
-0.003334958106279373,
0.021023405715823174,
-0.08699432015419006,
-0.0030288291163742542,
0.017554420977830887,
0.1402178704738617,
-0.041360560804605484,
0.05587226524949074,
0.06868857145309448,
0.01718894951045513,
-0.008965983986854553,
-0.043436042964458466,
-0.030324894934892654,
0.010255450382828712,
0.037398383021354675,
0.006853119935840368,
-0.06866926699876785,
0.01675487495958805,
-0.05896882712841034,
-0.05236669257283211,
-0.1406521499156952,
0.00947615597397089,
-0.04252830147743225,
0.00023493179469369352,
-0.06619611382484436,
0.03983263298869133,
-0.046988874673843384,
0.08346015959978104,
-0.04456193745136261,
0.04383501410484314,
-0.00010946434485958889,
-0.026111697778105736,
-0.006960010621696711,
0.02382592298090458,
0.07559067755937576,
0.02186083234846592,
0.10687680542469025,
0.00200549210421741,
-0.0025386903434991837,
0.0011354516027495265,
0.04405354708433151,
-0.02317400835454464,
0.05031123384833336,
0.02531616762280464,
-0.009061397984623909,
-0.024351032450795174,
0.06544404476881027,
-0.0290665365755558,
0.03963463008403778,
0.006357857957482338,
0.02556801214814186,
0.028907079249620438,
0.029418541118502617,
-0.05683307349681854,
0.027687378227710724,
-0.010499292984604836,
-0.030836040154099464,
-0.001492861658334732,
0.07354986667633057,
0.0946791023015976,
0.05294489488005638,
-0.006093401927500963,
-0.010465797036886215,
0.04016004130244255,
0.038998089730739594,
0.007668399251997471,
-3.58055358855278e-33,
0.0017413969617336988,
-0.012674116529524326,
0.002543835435062647,
-0.03688106685876846,
-0.07583410292863846,
0.062057655304670334,
0.028359126299619675,
0.07860472053289413,
-0.0032592432107776403,
0.0021543921902775764,
-0.04449279233813286,
0.06355835497379303,
-0.053003642708063126,
-0.04329715296626091,
0.010869918391108513,
0.03397404029965401,
0.06060757488012314,
-0.0022956400644034147,
-0.0068365056067705154,
-0.015689387917518616,
0.02960170991718769,
-0.0002495140361133963,
0.0059493351727724075,
-0.07605358213186264,
-0.06738302111625671,
0.007714820094406605,
0.009607288986444473,
-0.02830527350306511,
-0.12683169543743134,
-0.013903997838497162,
0.028767192736268044,
0.0159868523478508,
0.00110999948810786,
0.0145783182233572,
0.031406816095113754,
-0.011998165398836136,
0.02612955868244171,
0.12676049768924713,
-0.035971689969301224,
0.03666210174560547,
0.03085431642830372,
0.03115725703537464,
0.024559088051319122,
-0.08913595229387283,
-0.10056109726428986,
-0.050404828041791916,
-0.009683405049145222,
0.007285633124411106,
0.06202569976449013,
0.0032091394532471895,
0.038903288543224335,
0.01727057434618473,
0.0065622515976428986,
0.06338489055633545,
0.06047304719686508,
-0.019116828218102455,
0.06171511113643646,
0.005287084262818098,
-0.031927384436130524,
0.06312013417482376,
0.011165006086230278,
-0.036074332892894745,
0.11052501201629639,
0.009059736505150795,
-0.013459479436278343,
0.08577613532543182,
0.07689540833234787,
0.04013793170452118,
-0.048736415803432465,
0.00909156072884798,
0.06906838715076447,
0.008188048377633095,
0.09622213989496231,
-0.029079105705022812,
-0.059297703206539154,
-0.06523384153842926,
0.006011642515659332,
-0.015896478667855263,
-0.055249735713005066,
0.020780349150300026,
0.08113653212785721,
-0.05985341593623161,
-0.05319826677441597,
0.041238464415073395,
-0.020361056551337242,
-0.014214729890227318,
0.022709921002388,
-0.03832275792956352,
0.016027575358748436,
0.01894434541463852,
-0.049865443259477615,
-0.008213626220822334,
0.0016430472023785114,
-0.115620456635952,
-0.08555344492197037,
-5.778584669380955e-34,
-0.009544586762785912,
-0.040848132222890854,
-0.06352323293685913,
0.09289045631885529,
-0.005456277169287205,
-0.0485372468829155,
0.03671999275684357,
0.06693457812070847,
-0.03499545156955719,
-0.04127931967377663,
0.01204569824039936,
-0.010195829905569553,
-0.04246619716286659,
-0.016138801351189613,
-0.00693698413670063,
0.07702203094959259,
-0.034326571971178055,
-0.10611249506473541,
-0.029047822579741478,
-0.012302713468670845,
-0.004341101739555597,
-0.050951775163412094,
-0.02438114956021309,
0.10385095328092575,
0.00143663608469069,
-0.048239629715681076,
0.02116350457072258,
-0.031256258487701416,
-0.06662382185459137,
-0.09747487306594849,
-0.007014913018792868,
-0.03705378249287605,
0.024904869496822357,
-0.08180702477693558,
-0.010987075045704842,
-0.0006162539939396083,
0.06940259784460068,
0.02641492523252964,
0.0018542318139225245,
0.08106066286563873,
0.04592040926218033,
0.06515651196241379,
-0.02721817046403885,
0.006118414457887411,
-0.00023440681979991496,
0.0003905275953002274,
-0.08424271643161774,
-0.011051272973418236,
0.024037279188632965,
-0.03690080717206001,
0.07485280185937881,
0.009125765413045883,
-0.06383094191551208,
0.03634802624583244,
0.005421466659754515,
0.004775401204824448,
-0.14061276614665985,
0.03938476741313934,
-0.056051451712846756,
0.06027534604072571,
0.0038913595490157604,
-0.03525073453783989,
-0.1106068342924118,
-0.05627332627773285,
-0.0005447245202958584,
-0.0014957867097109556,
-0.07811236381530762,
-0.12061561644077301,
-0.06850770860910416,
0.05951545014977455,
-0.006848494987934828,
-0.030857203528285027,
-0.001674206811003387,
0.020710954442620277,
-0.010709398426115513,
-0.01778418757021427,
0.007814127951860428,
-0.06732340902090073,
0.06872877478599548,
-0.029089173302054405,
-0.06527507305145264,
0.0804339274764061,
-0.00695825694128871,
0.011139831505715847,
-0.03246918320655823,
0.053472328931093216,
-0.07682320475578308,
0.08200366795063019,
-0.011519785970449448,
0.05491996556520462,
0.055344030261039734,
-0.09292253106832504,
-0.11895445734262466,
-0.020015031099319458,
0.0255836620926857,
-5.796069757479927e-8,
0.0014622228918597102,
0.030097689479589462,
0.004770386498421431,
0.09930689632892609,
0.03296497464179993,
0.019761892035603523,
0.08540980517864227,
0.1389646828174591,
0.03459543734788895,
-0.025150228291749954,
0.07922513037919998,
0.003911198582500219,
-0.042152728885412216,
-0.007766182534396648,
0.0021958977449685335,
-0.015544556081295013,
-0.03744446486234665,
-0.06904219835996628,
-0.037605781108140945,
-0.11641967296600342,
-0.06172173470258713,
0.0746627077460289,
-0.016172271221876144,
-0.014410081319510937,
0.03201774135231972,
-0.017170995473861694,
0.06723379343748093,
0.0697484239935875,
0.00718018040060997,
-0.07490649074316025,
-0.011414524167776108,
-0.028894467279314995,
0.019896917045116425,
-0.04188045486807823,
0.02601456828415394,
-0.00397986127063632,
-0.09499714523553848,
0.013141068629920483,
-0.02931160107254982,
0.1340058296918869,
-0.041759006679058075,
0.03397110104560852,
-0.024135708808898926,
0.015566839836537838,
0.019569156691432,
-0.015172730199992657,
-0.05219995230436325,
0.05852222442626953,
0.02570047229528427,
-0.03801899030804634,
0.032477572560310364,
-0.08086825162172318,
-0.09263289719820023,
0.09660465270280838,
-0.033962637186050415,
-0.05519649758934975,
0.03836981952190399,
-0.013423814438283443,
0.025762146338820457,
0.06596878170967102,
0.1025298535823822,
-0.08480019122362137,
-0.06357309222221375,
-0.023897910490632057
] | 0.018799
|
[[query-cache]] === Node Query Cache The query cache is responsible for caching the results of queries. There is one queries cache per node that is shared by all shards. The cache implements an LRU eviction policy: when a cache becomes full, the least recently used data is evicted to make way for new data. The query cache only caches queries which are being used in a filter context. The following setting is \_static\_ and must be configured on every data node in the cluster: `indices.queries.cache.size`:: Controls the memory size for the filter cache , defaults to `10%`. Accepts either a percentage value, like `5%`, or an exact value, like `512mb`. The following setting is an \_index\_ setting that can be configured on a per-index basis: `index.queries.cache.enabled`:: Controls whether to enable query caching. Accepts `true` (default) or `false`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/indices/query_cache.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.0847121849656105,
0.00829692929983139,
0.03574405610561371,
0.09245339781045914,
0.009735995903611183,
-0.06333009898662567,
0.0094812186434865,
-0.06451091170310974,
0.05249843746423721,
0.025292199105024338,
-0.02056903764605522,
0.042876631021499634,
-0.01100364699959755,
-0.05009845644235611,
-0.06356706470251083,
0.00872918963432312,
0.011411088518798351,
-0.025849724188447,
-0.029305437579751015,
-0.022381599992513657,
0.05703342705965042,
0.006531144957989454,
-0.0005704084178432822,
0.0011434300104156137,
-0.024120250716805458,
-0.037782587110996246,
-0.09526029974222183,
-0.04711608588695526,
0.0873306542634964,
0.01071293093264103,
-0.016780924052000046,
0.011344744823873043,
-0.03719458356499672,
0.03821028769016266,
-0.014782367274165154,
0.05469292029738426,
-0.0423949658870697,
-0.09919993579387665,
-0.08930587768554688,
-0.006026637740433216,
0.012592674233019352,
0.05566053465008736,
-0.08657374233007431,
-0.004772110842168331,
0.011861231178045273,
0.02924562245607376,
-0.016276922076940536,
0.010843928903341293,
-0.07900665700435638,
0.010453489609062672,
-0.03337583318352699,
-0.03382023423910141,
-0.06794699281454086,
0.026087557896971703,
-0.015828071162104607,
0.03947274759411812,
-0.047763194888830185,
0.03197918087244034,
-0.01840708777308464,
-0.05546325072646141,
0.05723419040441513,
-0.08676255494356155,
0.02398751676082611,
-0.021240683272480965,
-0.03259509801864624,
0.018400035798549652,
0.1328032910823822,
-0.03879675641655922,
0.06712967157363892,
-0.013751600868999958,
-0.025869084522128105,
0.02743840217590332,
-0.04291567578911781,
-0.02576879970729351,
-0.010373974218964577,
0.09638998657464981,
0.0011972726788371801,
-0.03756024315953255,
0.0105160903185606,
-0.03538120537996292,
-0.08757229894399643,
-0.0678640604019165,
0.03979216516017914,
-0.02697555162012577,
-0.009403384290635586,
-0.03946737200021744,
0.012749981135129929,
-0.08506409078836441,
0.07806344330310822,
-0.037866611033678055,
0.02394097112119198,
0.03423610329627991,
-0.005485240835696459,
-0.06794744729995728,
-0.03342454880475998,
0.01817130111157894,
0.04694264009594917,
0.12005875259637833,
0.022966871038079262,
-0.016673503443598747,
0.021200427785515785,
0.03345077484846115,
-0.022375572472810745,
0.04546971246600151,
0.0031493983697146177,
-0.009385626763105392,
0.0026722943875938654,
0.032707128673791885,
-0.03760765492916107,
0.058532021939754486,
0.024354562163352966,
0.08719232678413391,
0.03140198811888695,
-0.02010778896510601,
0.0332641527056694,
0.08788951486349106,
0.050359096378088,
-0.06058540940284729,
0.002833124715834856,
0.029652155935764313,
0.06917980313301086,
-0.003957299515604973,
-0.009011076763272285,
-0.04087241366505623,
-0.02724483609199524,
0.02807430550456047,
-0.07084160298109055,
4.827654279781361e-33,
0.09441398084163666,
-0.0276019349694252,
0.005764859262853861,
-0.028822220861911774,
-0.008266491815447807,
0.03549400344491005,
-0.012980083003640175,
0.05290236324071884,
-0.06824295967817307,
0.027584673836827278,
-0.03548545762896538,
0.025583092123270035,
0.03618011251091957,
-0.049906469881534576,
0.05428917706012726,
0.013434619642794132,
0.036965906620025635,
0.05148490145802498,
0.05429806932806969,
-0.029549598693847656,
0.04306402802467346,
0.017290761694312096,
0.0028840715531259775,
-0.01090275775641203,
-0.04536436125636101,
0.04241520166397095,
0.028989870101213455,
-0.0752255842089653,
-0.09847445040941238,
-0.006212445441633463,
-0.030962498858571053,
-0.002283197594806552,
0.017069879919290543,
0.017557406798005104,
0.006571190431714058,
0.05601395666599274,
0.013761430978775024,
0.03775618225336075,
-0.023861505091190338,
-0.07804234325885773,
0.049630384892225266,
0.038265641778707504,
0.09590435028076172,
-0.14030568301677704,
-0.12824293971061707,
-0.06699186563491821,
-0.027453789487481117,
0.007817110978066921,
0.0016811355017125607,
0.0019937825854867697,
0.019748754799365997,
-0.027770129963755608,
0.015810376033186913,
0.07819872349500656,
0.036474041640758514,
0.020247409120202065,
0.07059194147586823,
-0.005910742096602917,
0.024449115619063377,
0.0895671397447586,
0.003298543393611908,
-0.08533752709627151,
0.04996923729777336,
0.049600999802351,
-0.0008670808747410774,
0.07653353363275528,
0.05761180818080902,
0.12165088206529617,
0.027076127007603645,
0.06863604485988617,
0.004706468898802996,
0.05145978927612305,
0.020151738077402115,
-0.01470246072858572,
-0.06342769414186478,
-0.09697449207305908,
-0.05533672496676445,
-0.05860992521047592,
-0.11928120255470276,
0.06931554526090622,
-0.03620715066790581,
-0.05837544426321983,
-0.04428144916892052,
0.044268205761909485,
-0.10512445122003555,
-0.024056650698184967,
0.06753949820995331,
0.03220336139202118,
-0.007075632456690073,
-0.03394576162099838,
0.03880547359585762,
-0.03833579644560814,
0.1088457703590393,
-0.06496570259332657,
-0.1092667207121849,
-4.232087128201372e-33,
0.012147219851613045,
-0.06673583388328552,
-0.05671187490224838,
0.08153017610311508,
0.012430466711521149,
-0.020863324403762817,
0.02682933211326599,
0.019836796447634697,
-0.027313100174069405,
-0.047985147684812546,
-0.028025688603520393,
-0.025752723217010498,
0.051823027431964874,
-0.02580396644771099,
-0.04768897965550423,
0.08648569136857986,
0.02568666636943817,
-0.14084072411060333,
0.024195488542318344,
0.025416286662220955,
-0.060711536556482315,
-0.0017605016473680735,
-0.007028983905911446,
0.04317754879593849,
-0.01698167994618416,
-0.0040690661408007145,
-0.045266225934028625,
-0.044215958565473557,
-0.028613753616809845,
-0.047670040279626846,
-0.02333817072212696,
-0.03851982578635216,
-0.03681991994380951,
-0.0585898831486702,
-0.021832432597875595,
-0.04631749540567398,
-0.03996751084923744,
0.017441682517528534,
0.0287471991032362,
0.03185020387172699,
0.03905521705746651,
0.0285035353153944,
-0.053304146975278854,
0.07139363884925842,
0.04256882891058922,
-0.003618490183725953,
-0.03896651044487953,
-0.013777928426861763,
-0.003109333338215947,
-0.02095305360853672,
0.05289776995778084,
-0.028683312237262726,
0.02355777472257614,
0.10890831053256989,
0.02385857328772545,
0.059699248522520065,
-0.10571657121181488,
0.11477155983448029,
-0.0380108617246151,
0.019703319296240807,
0.05964311584830284,
-0.06318607181310654,
-0.10651158541440964,
-0.004603830631822348,
-0.04231845214962959,
0.04622536152601242,
-0.07482648640871048,
-0.08714640140533447,
-0.03962353989481926,
-0.011996760964393616,
-0.027004797011613846,
0.01374120730906725,
0.007230738177895546,
0.04846633970737457,
-0.04003217816352844,
-0.01828157529234886,
0.024215320125222206,
-0.021587220951914787,
0.0331493578851223,
0.07512116432189941,
-0.08006423711776733,
0.10404502600431442,
-0.0030561676248908043,
0.016008080914616585,
0.0014915624633431435,
-0.06875835359096527,
-0.047052811831235886,
0.08914663642644882,
-0.04226851090788841,
0.025508610531687737,
-0.027491720393300056,
-0.05815773829817772,
-0.10892903804779053,
-0.024302909150719643,
0.017686182633042336,
-4.833423972172568e-8,
-0.003400887595489621,
0.03950539231300354,
-0.0038048583082854748,
0.1137632355093956,
0.026774730533361435,
-0.006448051892220974,
0.07512803375720978,
0.12923525273799896,
-0.04704149067401886,
0.010268538258969784,
0.11361858993768692,
-0.0028881817124783993,
-0.06988202035427094,
-0.04544485732913017,
0.05481429025530815,
-0.006824636831879616,
0.020006421953439713,
0.03595982864499092,
-0.03329510986804962,
-0.024896521121263504,
-0.08298083394765854,
0.0043279556557536125,
-0.00911743938922882,
-0.014579743146896362,
0.017914200201630592,
0.022773513570427895,
0.08489049971103668,
0.03344593942165375,
0.049678925424814224,
-0.01588640920817852,
-0.05114142969250679,
-0.04610740765929222,
0.06212887167930603,
-0.04023165628314018,
0.028306297957897186,
0.08047695457935333,
-0.09374170750379562,
0.04839585721492767,
0.03285467252135277,
0.08270113915205002,
-0.02170635387301445,
0.04608770087361336,
-0.007974011823534966,
0.03706907108426094,
-0.03306850045919418,
0.014758081175386906,
-0.04327719658613205,
0.05981922522187233,
0.05379520356655121,
0.04490935057401657,
0.05483011156320572,
-0.05807477608323097,
0.01656091772019863,
0.01716165617108345,
-0.022336628288030624,
-0.02880471758544445,
0.029999885708093643,
-0.0194510780274868,
0.03350633755326271,
0.027951812371611595,
0.11716870963573456,
-0.05280669033527374,
-0.06621396541595459,
-0.1001170203089714
] | 0.101863
|
[[modules-scripting-security]] === Scripting and security While Elasticsearch contributors make every effort to prevent scripts from running amok, security is something best done in https://en.wikipedia.org/wiki/Defense\_in\_depth\_(computing)[layers] because all software has bugs and it is important to minimize the risk of failure in any security layer. Find below rules of thumb for how to keep Elasticsearch from being a vulnerability. [float] === Do not run as root First and foremost, never run Elasticsearch as the `root` user as this would allow any successful effort to circumvent the other security layers to do \*anything\* on your server. Elasticsearch will refuse to start if it detects that it is running as `root` but this is so important that it is worth double and triple checking. [float] === Do not expose Elasticsearch directly to users Do not expose Elasticsearch directly to users, instead have an application make requests on behalf of users. If this is not possible, have an application to sanitize requests from users. If \*that\* is not possible then have some mechanism to track which users did what. Understand that it is quite possible to write a <> that overwhelms Elasticsearch and brings down the cluster. All such searches should be considered bugs and the Elasticsearch contributors make an effort to prevent this but they are still possible. [float] === Do not expose Elasticsearch directly to the Internet Do not expose Elasticsearch to the Internet, instead have an application make requests on behalf of the Internet. Do not entertain the thought of having an application "sanitize" requests to Elasticsearch. Understand that it is possible for a sufficiently determined malicious user to write searches that overwhelm the Elasticsearch cluster and bring it down. For example: Good: \* Users type text into a search box and the text is sent directly to a <>, <>, <>, or any of the <>. \* Running a script with any of the above queries that was written as part of the application development process. \* Running a script with `params` provided by users. \* User actions makes documents with a fixed structure. Bad: \* Users can write arbitrary scripts, queries, `\_search` requests. \* User actions make documents with structure defined by users. [float] [[modules-scripting-other-layers]] === Other security layers In addition to user privileges and script sandboxing Elasticsearch uses the http://www.oracle.com/technetwork/java/seccodeguide-139067.html[Java Security Manager] and native security tools as additional layers of security. As part of its startup sequence Elasticsearch enables the Java Security Manager which limits the actions that can be taken by portions of the code. Painless uses this to limit the actions that generated Painless scripts can take, preventing them from being able to do things like write files and listen to sockets. Elasticsearch uses https://en.wikipedia.org/wiki/Seccomp[seccomp] in Linux, https://www.chromium.org/developers/design-documents/sandbox/osx-sandboxing-design[Seatbelt] in macOS, and https://msdn.microsoft.com/en-us/library/windows/desktop/ms684147[ActiveProcessLimit] on Windows to prevent Elasticsearch from forking or executing other processes. Below this we describe the security settings for scripts and how you can change from the defaults described above. You should be very, very careful when allowing more than the defaults. Any extra permissions weakens the total security of the Elasticsearch deployment. [[allowed-script-types-setting]] [float] === Allowed script types setting By default all script types are allowed to be executed. This can be modified using the setting `script.allowed\_types`. Only the types specified as part of the setting will be allowed to be executed. To specify no types are allowed, set `script.allowed\_types` to be `none`. [source,yaml] ---- script.allowed\_types: inline <1> ---- <1> This will allow only inline scripts to be executed but not stored scripts (or any other types). [[allowed-script-contexts-setting]] [float] === Allowed script contexts setting By default all script contexts are allowed to be executed.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/scripting/security.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.002473005559295416,
0.07521926611661911,
-0.0196547694504261,
0.025295736268162727,
0.011933799833059311,
-0.03049752302467823,
-0.0351317897439003,
0.045618388801813126,
0.03515208140015602,
0.05186337232589722,
-0.05505872517824173,
-0.0248273853212595,
0.050761882215738297,
0.0046144286170601845,
-0.045789774507284164,
-0.022526299580931664,
-0.022528138011693954,
-0.0010304772295057774,
-0.051484547555446625,
0.05765620619058609,
0.057112716138362885,
0.006748211104422808,
-0.035124171525239944,
-0.004890178330242634,
-0.11624568700790405,
-0.01633051037788391,
-0.051037002354860306,
-0.026501601561903954,
0.03896767273545265,
0.026934165507555008,
0.033653393387794495,
-0.11378159373998642,
0.04225144162774086,
0.06771831959486008,
-0.03310233727097511,
0.05357387289404869,
0.01169313583523035,
-0.08460166305303574,
-0.08343813568353653,
0.03927989676594734,
0.03169015422463417,
-0.0377064011991024,
-0.04098137468099594,
-0.058376431465148926,
-0.10127592086791992,
-0.11341212689876556,
0.04674038290977478,
-0.11923246085643768,
-0.07104507833719254,
0.037083569914102554,
0.038460664451122284,
-0.0285769272595644,
0.025183895602822304,
0.014338145963847637,
-0.04877226799726486,
-0.005044287536293268,
-0.05438799783587456,
-0.022564781829714775,
-0.0007168778101913631,
-0.019180143252015114,
0.08647696673870087,
0.01062287762761116,
0.05015353113412857,
-0.02827993407845497,
0.04693992808461189,
0.019034959375858307,
0.02302672527730465,
0.005153391510248184,
0.05208514258265495,
0.04266110435128212,
0.037528641521930695,
-0.025538502261042595,
-0.02614775113761425,
-0.006027588155120611,
0.13585934042930603,
0.02105647884309292,
-0.008321437984704971,
-0.04887346178293228,
0.06715605407953262,
-0.029131416231393814,
-0.024829544126987457,
-0.11422091722488403,
-0.051077548414468765,
0.021368559449911118,
-0.01949411630630493,
-0.017175868153572083,
0.0460323803126812,
-0.04601899906992912,
0.16212022304534912,
-0.008672501891851425,
0.009911068715155125,
-0.034319326281547546,
0.08789817243814468,
-0.027571406215429306,
0.09946920722723007,
0.0646425113081932,
-0.12870150804519653,
0.01810666359961033,
-0.025120239704847336,
-0.01718137226998806,
0.010076910257339478,
-0.07892294228076935,
-0.017144767567515373,
-0.02825358137488365,
0.08241735398769379,
0.0027542312163859606,
-0.014220244251191616,
0.03298395127058029,
0.01688498817384243,
-0.004635138437151909,
0.033618032932281494,
0.008192196488380432,
-0.0007656501838937402,
0.03429907560348511,
0.018873412162065506,
0.06490971893072128,
0.054666757583618164,
-0.0659472867846489,
-0.01909783110022545,
0.13483479619026184,
0.08977998793125153,
0.017588935792446136,
0.05852963402867317,
-0.003624642500653863,
0.09074628353118896,
0.04199136421084404,
-0.05022942274808884,
6.774303414127794e-33,
0.03333761915564537,
0.05449653044342995,
-0.04057271033525467,
-0.03051561489701271,
-0.045821648091077805,
0.09722694009542465,
0.019116368144750595,
0.0816119909286499,
-0.03227033466100693,
-0.025203879922628403,
-0.016387177631258965,
0.1168634444475174,
0.035721223801374435,
0.01809116266667843,
0.04000658914446831,
0.014835330657660961,
0.09762629866600037,
-0.0660911276936531,
0.025010963901877403,
-0.015259838663041592,
0.06902363151311874,
-0.0626935139298439,
-0.0468631349503994,
0.025182710960507393,
-0.02761531062424183,
-0.05731416866183281,
-0.10608996450901031,
-0.03367026522755623,
0.01232711412012577,
0.02600087597966194,
-0.0330386646091938,
-0.027482397854328156,
-0.02667952887713909,
-0.0005860688397660851,
-0.021254172548651695,
0.04307699203491211,
-0.04743008688092232,
0.05898530036211014,
-0.015432572923600674,
0.016457166522741318,
-0.0015581598272547126,
-0.02507350593805313,
0.013164200820028782,
0.003930575214326382,
0.04069317877292633,
-0.04272466525435448,
-0.08903617411851883,
0.05497165769338608,
0.0436735600233078,
-0.032387204468250275,
-0.034297406673431396,
0.035163845866918564,
0.1128278598189354,
-0.05435488745570183,
0.07711539417505264,
0.004962088540196419,
-0.047828495502471924,
-0.0023531669285148382,
-0.03209344297647476,
-0.027278749272227287,
0.0014079994289204478,
-0.07844286412000656,
0.06815976649522781,
0.030910655856132507,
-0.026455918326973915,
-0.06782684475183487,
0.055456582456827164,
0.013784194365143776,
-0.05221305787563324,
0.017181342467665672,
-0.06054449826478958,
0.06683516502380371,
0.02351231500506401,
0.041588425636291504,
-0.1271289736032486,
-0.054184895008802414,
0.07308651506900787,
0.048386916518211365,
0.041140131652355194,
0.033932872116565704,
-0.031230084598064423,
-0.024521468207240105,
0.01996271125972271,
0.05790797621011734,
-0.08753097802400589,
-0.003933542873710394,
-0.04064048454165459,
0.03338466212153435,
0.011797597631812096,
0.024179253727197647,
0.07320244610309601,
-0.022100074216723442,
-0.04597228020429611,
-0.062183819711208344,
-0.044438641518354416,
-8.60683959765823e-33,
-0.022154392674565315,
0.029115069657564163,
-0.08539586514234543,
0.007720096502453089,
-0.006211434490978718,
-0.0124808419495821,
0.03775043040513992,
-0.01817360147833824,
-0.03753338009119034,
-0.05905257537961006,
-0.03407023102045059,
-0.011312210001051426,
-0.016024192795157433,
-0.042460352182388306,
-0.060771480202674866,
0.04073166847229004,
-0.06880679726600647,
-0.03371834009885788,
0.01026430819183588,
-0.06130900979042053,
-0.0996207669377327,
0.0348304845392704,
-0.04369805380702019,
0.09446588903665543,
-0.049119189381599426,
-0.06326422840356827,
-0.01783415861427784,
0.0013141228118911386,
-0.09729278832674026,
0.04126181825995445,
-0.06941482424736023,
0.02936360612511635,
0.034662242978811264,
-0.04333623871207237,
-0.07635991275310516,
0.05669127032160759,
0.026449251919984818,
-0.01965291053056717,
-0.0021492240484803915,
-0.02250334620475769,
0.07291862368583679,
0.06799110025167465,
0.03692653030157089,
-0.022147297859191895,
-0.045338522642850876,
0.02688145823776722,
-0.007321493700146675,
-0.0017326647648587823,
-0.016817178577184677,
-0.03043324500322342,
-0.0783313512802124,
-0.06098117306828499,
0.05973935127258301,
0.011619653552770615,
-0.051832057535648346,
-0.02731669880449772,
-0.03139074519276619,
0.05779113620519638,
-0.06141401827335358,
0.10756582766771317,
-0.02254023402929306,
0.02944216877222061,
-0.006929019466042519,
0.024009238928556442,
-0.0965099111199379,
-0.048874564468860626,
-0.07429005205631256,
0.004204298369586468,
-0.07569635659456253,
-0.02358776330947876,
0.035506438463926315,
-0.08142252266407013,
0.047614723443984985,
0.03428348898887634,
0.012108396738767624,
0.03162091225385666,
0.029208317399024963,
-0.035224832594394684,
0.013110593892633915,
0.012339823879301548,
-0.028442388400435448,
0.03636839985847473,
-0.045296505093574524,
0.042806465178728104,
-0.033971477299928665,
0.013192703947424889,
0.010109036229550838,
0.019029716029763222,
-0.03695910796523094,
0.03847304731607437,
-0.05123839154839516,
-0.02496233396232128,
-0.10336904972791672,
-0.038749366998672485,
0.023697271943092346,
-5.487019905103807e-8,
0.08938207477331161,
0.02590489201247692,
0.01720757596194744,
0.04138706624507904,
0.03666304424405098,
0.05685720592737198,
-0.0008937565144151449,
0.019936705008149147,
-0.01581341028213501,
0.036910321563482285,
-0.02667360194027424,
-0.04339228942990303,
-0.013523283414542675,
0.0025361240841448307,
-0.00596705311909318,
0.05124512314796448,
-0.015220780856907368,
0.02788887731730938,
-0.08258035033941269,
-0.04093198850750923,
-0.12280909717082977,
0.019159531220793724,
-0.002603936707600951,
0.055953267961740494,
0.0766185075044632,
0.02656642720103264,
0.04255660995841026,
-0.01651412807404995,
0.020858487114310265,
0.037140727043151855,
-0.03656565397977829,
-0.03126323223114014,
0.001354363514110446,
0.06317093223333359,
-0.09586084634065628,
0.08688007295131683,
-0.032493021339178085,
-0.00158173858653754,
-0.09844541549682617,
0.14860126376152039,
0.006404711864888668,
0.07678017020225525,
-0.007327686529606581,
-0.022857297211885452,
-0.00629324559122324,
-0.000013512742043531034,
0.005319265648722649,
0.04244673252105713,
0.051245320588350296,
-0.052330538630485535,
0.010432266630232334,
-0.035391196608543396,
-0.05224934220314026,
0.15651604533195496,
0.011198379099369049,
-0.02146032638847828,
-0.018013710156083107,
-0.017782675102353096,
0.07682249695062637,
0.08680935949087143,
0.014218292199075222,
-0.04971133545041084,
-0.00933034997433424,
-0.05808143690228462
] | 0.114525
|
no types are allowed, set `script.allowed\_types` to be `none`. [source,yaml] ---- script.allowed\_types: inline <1> ---- <1> This will allow only inline scripts to be executed but not stored scripts (or any other types). [[allowed-script-contexts-setting]] [float] === Allowed script contexts setting By default all script contexts are allowed to be executed. This can be modified using the setting `script.allowed\_contexts`. Only the contexts specified as part of the setting will be allowed to be executed. To specify no contexts are allowed, set `script.allowed\_contexts` to be `none`. [source,yaml] ---- script.allowed\_contexts: search, update <1> ---- <1> This will allow only search and update scripts to be executed but not aggs or plugin scripts (or any other contexts).
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/scripting/security.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.06347271054983139,
-0.02583910897374153,
-0.07403375953435898,
0.07210582494735718,
0.018840033560991287,
-0.012630718760192394,
0.024415645748376846,
-0.045075856149196625,
-0.011787531897425652,
0.022255724295973778,
0.015662075951695442,
-0.024261370301246643,
0.026507439091801643,
-0.03646861016750336,
0.08880005031824112,
0.05914147570729256,
0.024631015956401825,
-0.02825106307864189,
-0.022673815488815308,
-0.018219413235783577,
-0.0037973159924149513,
0.01635710708796978,
0.03819061443209648,
-0.006573155522346497,
-0.043841470032930374,
-0.032418642193078995,
-0.08234214782714844,
-0.03919338807463646,
0.08264342695474625,
0.009983952157199383,
0.024561991915106773,
0.022465115413069725,
-0.014622623100876808,
0.020568516105413437,
0.05118900537490845,
0.14416106045246124,
0.04260499030351639,
-0.007644907105714083,
-0.0541682094335556,
0.031614918261766434,
0.04275745153427124,
0.022054588422179222,
-0.041931089013814926,
-0.05636601895093918,
-0.09776156395673752,
-0.0701352134346962,
-0.09015794098377228,
-0.07783222198486328,
-0.10481815040111542,
-0.06004452332854271,
-0.008627772331237793,
-0.04090116173028946,
-0.03483074530959129,
-0.036123573780059814,
0.026110626757144928,
-0.018631158396601677,
-0.021569615229964256,
0.04603322222828865,
0.026005323976278305,
-0.04753534495830536,
-0.04125119745731354,
0.007038068491965532,
0.012468380853533745,
-0.030388398095965385,
-0.019627563655376434,
0.03119485266506672,
-0.06258084625005722,
0.037847645580768585,
0.017550524324178696,
-0.002881616121158004,
-0.02911677397787571,
-0.0546165369451046,
-0.017848186194896698,
-0.01883251592516899,
0.0185967106372118,
-0.015134685672819614,
0.006427105516195297,
0.010413811542093754,
0.012885215692222118,
-0.08682040125131607,
-0.050484053790569305,
-0.06047671660780907,
0.06341393291950226,
0.07284311950206757,
-0.03474860638380051,
0.02287738397717476,
0.04794149100780487,
0.04078596830368042,
0.13065484166145325,
0.09031324833631516,
-0.006773832254111767,
-0.06847862154245377,
0.03538563475012779,
-0.03932932764291763,
0.08571448922157288,
0.038727518171072006,
-0.03644499555230141,
-0.04105699807405472,
0.012895749881863594,
0.032003965228796005,
0.06692690402269363,
0.016244273632764816,
0.048465438187122345,
0.02566455490887165,
0.013954294845461845,
0.06974830478429794,
-0.04416802152991295,
0.011207370087504387,
-0.00902711134403944,
-0.033752597868442535,
-0.058285970240831375,
0.07110431045293808,
0.004141685552895069,
-0.13118791580200195,
-0.05495096370577812,
-0.009252393618226051,
0.03954266011714935,
-0.03972944989800453,
-0.03072388656437397,
0.07440272718667984,
0.09973183274269104,
0.03989351913332939,
-0.012863222509622574,
0.006955113261938095,
0.044618669897317886,
-0.017463812604546547,
-0.08370786905288696,
-2.3814464031228536e-34,
0.057666778564453125,
-0.09865064173936844,
-0.024638742208480835,
-0.00011882676335517317,
0.02800770290195942,
0.08327683061361313,
0.004508576355874538,
0.061441607773303986,
-0.04693195968866348,
0.06199253350496292,
0.0101936599239707,
0.08547193557024002,
-0.1241762638092041,
0.03955542668700218,
0.06834425032138824,
0.03341158106923103,
0.04991068318486214,
-0.01160401850938797,
0.04985959827899933,
-0.06960185617208481,
0.022323206067085266,
-0.02124694548547268,
-0.08642460405826569,
0.031515344977378845,
-0.030012553557753563,
0.016169989481568336,
0.000553006015252322,
-0.0007902456563897431,
-0.022016841918230057,
0.0003144850779790431,
-0.05425264686346054,
-0.03911782056093216,
0.008102793246507645,
0.057499539107084274,
0.021280644461512566,
0.019936492666602135,
-0.12958446145057678,
0.02650560811161995,
-0.013294629752635956,
0.034210823476314545,
0.08067148178815842,
0.013586804270744324,
0.019562922418117523,
-0.025112928822636604,
0.016632698476314545,
-0.004403327591717243,
-0.07242190092802048,
0.09040861576795578,
-0.005016703624278307,
-0.0005383595707826316,
-0.0020233362447470427,
0.09912149608135223,
0.03211749345064163,
-0.03354320675134659,
0.08892226964235306,
0.07448988407850266,
-0.0886131301522255,
0.0447051003575325,
0.03148380294442177,
-0.07878746092319489,
0.0017709486419335008,
-0.027798689901828766,
0.006698006298393011,
0.010324377566576004,
-0.01469816267490387,
0.023422734811902046,
-0.02701825462281704,
0.009376013651490211,
-0.01124710962176323,
0.055750638246536255,
0.01263002585619688,
0.1072305217385292,
-0.06547678261995316,
0.13022162020206451,
0.016508281230926514,
-0.13505494594573975,
0.025274643674492836,
-0.014345024712383747,
-0.010731558315455914,
0.06828463822603226,
0.04449239745736122,
0.04884442314505577,
-0.07118519395589828,
0.04579116404056549,
0.018009735271334648,
-0.0032733094412833452,
-0.029453914612531662,
0.02958185225725174,
-0.013675224035978317,
-0.049180906265974045,
0.04271092265844345,
-0.08412379026412964,
-0.045623939484357834,
-0.15212997794151306,
-0.06535250693559647,
-4.054909640147729e-33,
0.04973232001066208,
0.0025590667501091957,
-0.1320657581090927,
0.013315735384821892,
-0.04364432767033577,
-0.07054977118968964,
0.06047854945063591,
0.006789845880120993,
0.0453496091067791,
-0.010736925527453423,
-0.028803987428545952,
0.02723001316189766,
0.04394989460706711,
-0.07471078634262085,
-0.023509565740823746,
0.009890287183225155,
-0.12939444184303284,
-0.014265858568251133,
0.0008335825987160206,
0.002227087039500475,
-0.06364257633686066,
0.00011960704432567582,
0.022463617846369743,
0.1550557017326355,
0.01190873235464096,
-0.06875816732645035,
-0.10617201030254364,
0.0660352036356926,
-0.09445745497941971,
0.0440208837389946,
-0.03259546682238579,
0.07570356875658035,
-0.1034722775220871,
0.012785350903868675,
-0.04863597825169563,
-0.07485312223434448,
0.008941001258790493,
0.03652843087911606,
-0.09144654124975204,
-0.020619843155145645,
0.05093732848763466,
0.03116404451429844,
0.019386859610676765,
0.03683948144316673,
0.01209922693669796,
0.054205480962991714,
-0.005090012215077877,
-0.03317403048276901,
0.01604423113167286,
-0.0670977234840393,
-0.11622423678636551,
-0.04526752978563309,
-0.043262653052806854,
-0.004833915736526251,
0.008869120851159096,
-0.06844568252563477,
0.018734026700258255,
0.00722588412463665,
-0.06560870260000229,
0.0011408941354602575,
-0.00923412200063467,
-0.060019832104444504,
-0.024007592350244522,
0.01908344030380249,
-0.0018355308566242456,
-0.04830131679773331,
-0.03116079978644848,
-0.02174057625234127,
-0.0033658279571682215,
-0.0851813405752182,
0.012507355771958828,
-0.11681974679231644,
0.016096167266368866,
-0.033472299575805664,
-0.053204648196697235,
0.022725477814674377,
0.0672602728009224,
-0.049730513244867325,
0.0340137705206871,
0.004179537296295166,
0.007251977454870939,
0.06141827628016472,
0.022236917167901993,
0.043726254254579544,
-0.044512875378131866,
0.029186034575104713,
-0.035298943519592285,
0.07812446355819702,
-0.032788656651973724,
0.023729806765913963,
-0.0296229999512434,
0.007000041659921408,
-0.008695682510733604,
0.0908132791519165,
0.004663238301873207,
-5.124853075244573e-8,
-0.04716504365205765,
0.0009417381952516735,
-0.08227083086967468,
0.02923414669930935,
-0.028620470315217972,
0.049382470548152924,
0.006828514393419027,
0.011269176378846169,
-0.0032486754935234785,
-0.020758919417858124,
-0.03369327262043953,
0.04999377578496933,
-0.011512327939271927,
0.028970912098884583,
-0.04480345547199249,
0.0024141317699104548,
-0.031163962557911873,
0.038752660155296326,
0.003992314450442791,
-0.07528997212648392,
-0.01819831319153309,
0.05415616184473038,
0.0013044700026512146,
0.05648619681596756,
0.04856899753212929,
0.015967020764946938,
-0.019464952871203423,
0.02430659905076027,
0.03699178993701935,
0.05473547428846359,
0.07714790850877762,
0.014387822709977627,
-0.03892534598708153,
0.0006114803836680949,
-0.0658847913146019,
-0.018954241648316383,
0.06265049427747726,
0.028783388435840607,
-0.018090222030878067,
-0.040280647575855255,
0.04863077029585838,
0.027654243633151054,
-0.0544874332845211,
-0.03508457541465759,
-0.013880042359232903,
0.04029111936688423,
0.06010589748620987,
0.03961857408285141,
0.019670747220516205,
0.055535174906253815,
0.042903441935777664,
0.07340297847986221,
0.0008928446914069355,
0.10628964006900787,
0.021837491542100906,
-0.021928464993834496,
0.05726147070527077,
-0.01557755284011364,
0.007221219129860401,
-0.03653302788734436,
-0.06477892398834229,
-0.09175866097211838,
0.09915405511856079,
-0.05034048482775688
] | 0.064819
|
[[modules-scripting-engine]] === Advanced scripts using script engines A `ScriptEngine` is a backend for implementing a scripting language. It may also be used to write scripts that need to use advanced internals of scripting. For example, a script that wants to use term frequencies while scoring. The plugin {plugins}/plugin-authors.html[documentation] has more information on how to write a plugin so that Elasticsearch will properly load it. To register the `ScriptEngine`, your plugin should implement the `ScriptPlugin` interface and override the `getScriptEngine(Settings settings)` method. The following is an example of a custom `ScriptEngine` which uses the language name `expert\_scripts`. It implements a single script called `pure\_df` which may be used as a search script to override each document's score as the document frequency of a provided term. ["source","java",subs="attributes,callouts,macros"] -------------------------------------------------- include-tagged::{plugins-examples-dir}/script-expert-scoring/src/main/java/org/elasticsearch/example/expertscript/ExpertScriptPlugin.java[expert\_engine] -------------------------------------------------- You can execute the script by specifying its `lang` as `expert\_scripts`, and the name of the script as the script source: [source,js] -------------------------------------------------- POST /\_search { "query": { "function\_score": { "query": { "match": { "body": "foo" } }, "functions": [ { "script\_score": { "script": { "source": "pure\_df", "lang" : "expert\_scripts", "params": { "field": "body", "term": "foo" } } } } ] } } } -------------------------------------------------- // CONSOLE // TEST[skip:we don't have an expert script plugin installed to test this]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/scripting/engine.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.03807922452688217,
-0.0034676066134124994,
-0.044692251831293106,
0.05093565210700035,
-0.05749494209885597,
0.05000123754143715,
-0.052688807249069214,
0.05547654628753662,
-0.00287619698792696,
0.021475274115800858,
-0.049941536039114,
-0.02838006429374218,
0.0262017659842968,
-0.0033280637580901384,
-0.016879593953490257,
-0.005547918379306793,
-0.05897935852408409,
-0.04532046616077423,
-0.01046617142856121,
-0.09360256046056747,
0.08763925731182098,
0.08471798151731491,
0.03568548336625099,
-0.0890224501490593,
-0.0849340632557869,
-0.029150180518627167,
-0.06715402752161026,
0.01342738326638937,
0.029894841834902763,
0.03939361497759819,
0.050269220024347305,
-0.012103765271604061,
0.006818058434873819,
0.026948895305395126,
-0.0504416897892952,
0.059399060904979706,
-0.03410971909761429,
-0.04967956617474556,
-0.06042775139212608,
0.043581705540418625,
0.035451456904411316,
-0.0015284386463463306,
-0.030150674283504486,
-0.07596773654222488,
-0.039876438677310944,
-0.10028856247663498,
-0.06937019526958466,
-0.07338638603687286,
-0.070620097219944,
0.022364972159266472,
-0.011404328048229218,
-0.02927372232079506,
0.03429923206567764,
-0.03622547164559364,
-0.0034711335320025682,
0.021003516390919685,
-0.08891648054122925,
0.009904769249260426,
-0.03156960383057594,
-0.08194730430841446,
0.017162151634693146,
-0.01639203168451786,
-0.009757647290825844,
-0.002964066108688712,
-0.051364507526159286,
0.06128304824233055,
0.040356773883104324,
0.0025115737225860357,
0.02381373941898346,
0.01459485199302435,
-0.06039420887827873,
-0.025691280141472816,
0.0025077934842556715,
-0.033765438944101334,
0.06416073441505432,
0.011199790984392166,
-0.0269148051738739,
0.010470319539308548,
0.05352265387773514,
-0.09659585356712341,
-0.03292132541537285,
-0.12732096016407013,
-0.0423823706805706,
0.07242204248905182,
0.001481733052060008,
0.03392152860760689,
0.07890930026769638,
-0.06496931612491608,
0.09925683587789536,
0.051995813846588135,
0.029577242210507393,
-0.1263463944196701,
0.029416169971227646,
-0.06685308367013931,
-0.03576085716485977,
0.09075672924518585,
-0.09021703898906708,
0.03740251809358597,
0.06104438379406929,
-0.0221271775662899,
-0.0038106152787804604,
-0.02293546311557293,
-0.03994544968008995,
-0.03473642095923424,
-0.044056497514247894,
-0.016918187960982323,
-0.06056749075651169,
0.07632801681756973,
0.03650323301553726,
0.028126610442996025,
-0.001389095326885581,
0.057077933102846146,
0.0684681236743927,
-0.046121612191200256,
0.022535275667905807,
0.035582657903432846,
0.05702155828475952,
-0.06271971762180328,
0.07831339538097382,
0.13618145883083344,
0.08925875276327133,
0.05825279653072357,
0.0034589446149766445,
-0.05200180411338806,
0.05579889193177223,
0.09518610686063766,
-0.009705739095807076,
1.9709745205687613e-33,
0.07396791130304337,
-0.06808792799711227,
-0.02699165977537632,
0.04213470220565796,
-0.0617203414440155,
0.04122554883360863,
0.039926595985889435,
0.14094969630241394,
-0.10477142035961151,
-0.023102860897779465,
-0.02573673613369465,
0.12311352789402008,
-0.02779090590775013,
0.07147520780563354,
-0.04327313229441643,
0.0016488215187564492,
0.046053558588027954,
-0.02814338542521,
0.05901237949728966,
-0.046911124140024185,
0.08164156973361969,
-0.02285548858344555,
0.011615211144089699,
0.01177985779941082,
-0.004416968673467636,
0.03711804747581482,
0.009137414395809174,
-0.01724829152226448,
-0.05879521742463112,
0.0035897893831133842,
-0.028056494891643524,
-0.030348727479577065,
-0.03386804088950157,
-0.017698107287287712,
-0.005370641127228737,
0.0008091786876320839,
-0.07449426501989365,
0.07143017649650574,
-0.01684863306581974,
0.08155839890241623,
-0.009733829647302628,
-0.03179275244474411,
-0.09837859123945236,
-0.07423358410596848,
-0.004263746552169323,
0.017229462042450905,
0.0021225367672741413,
0.01799594797194004,
0.12610167264938354,
0.010318580083549023,
-0.050635479390621185,
0.016894087195396423,
0.10295123606920242,
-0.008144623599946499,
0.12287799268960953,
0.0831756666302681,
-0.04036463424563408,
0.0445941686630249,
0.0001909671409521252,
-0.06429706513881683,
-0.01061878353357315,
-0.0006858720444142818,
0.05709604173898697,
0.07147341966629028,
0.07456708699464798,
-0.0050426060333848,
0.04664669558405876,
0.041487254202365875,
-0.032630059868097305,
0.04703092202544212,
0.06064674258232117,
0.026928694918751717,
0.03941269591450691,
0.03674660995602608,
0.05639657378196716,
-0.09292969852685928,
0.03786111995577812,
-0.015613246709108353,
-0.028532082214951515,
0.010670272633433342,
-0.007584554608911276,
-0.04476764798164368,
-0.008529207669198513,
-0.019782064482569695,
0.025488104671239853,
0.048006270080804825,
-0.0003057978465221822,
0.02400955557823181,
0.016746023669838905,
-0.050374481827020645,
0.0608757920563221,
-0.007742364890873432,
-0.08621774613857269,
-0.07202763855457306,
-0.012862146832048893,
-4.584848574779325e-33,
0.00929287075996399,
-0.008798039518296719,
-0.06361176818609238,
0.07783656567335129,
-0.0058806282468140125,
-0.028450967743992805,
-0.0004241943533997983,
0.03211456537246704,
0.03328981623053551,
0.009650717489421368,
0.02009822241961956,
-0.04426579922437668,
0.011761045083403587,
-0.06791792809963226,
-0.005550954956561327,
0.012907467782497406,
-0.1315833032131195,
-0.07146035879850388,
0.051386602222919464,
-0.00075268663931638,
-0.07483555376529694,
0.013532286509871483,
-0.022351117804646492,
0.07338795065879822,
0.007231329567730427,
-0.12360109388828278,
-0.09739690274000168,
0.041591912508010864,
-0.11872413009405136,
-0.049410730600357056,
-0.03833920508623123,
0.031544119119644165,
-0.0643228068947792,
0.0479765422642231,
-0.051646143198013306,
0.031493186950683594,
0.039375774562358856,
0.015013388358056545,
-0.006612883415073156,
0.06468905508518219,
0.018766431137919426,
0.037175439298152924,
-0.05021749064326286,
0.0019008705858141184,
0.02087588608264923,
-0.00673682289198041,
-0.10352379083633423,
-0.013485231436789036,
0.015155596658587456,
-0.0636906698346138,
-0.06309343129396439,
-0.033584583550691605,
0.018675215542316437,
-0.00013551002484746277,
-0.03965316340327263,
-0.030320771038532257,
0.00788990780711174,
-0.01509850937873125,
-0.0853121429681778,
0.09753531217575073,
0.01530458778142929,
-0.049386002123355865,
-0.0041003781370818615,
-0.0015083046164363623,
-0.04942883178591728,
-0.06764720380306244,
-0.013191282749176025,
-0.040113430470228195,
-0.06136114150285721,
-0.05315906181931496,
-0.015672553330659866,
-0.12766101956367493,
0.06708959490060806,
0.02087920904159546,
0.029936105012893677,
0.045509252697229385,
0.012197417207062244,
-0.030607139691710472,
-0.011937941424548626,
0.0043462347239255905,
0.00414903974160552,
0.03763476014137268,
-0.019188212230801582,
-0.01214831043034792,
-0.052255403250455856,
0.05415763333439827,
-0.024091755971312523,
0.07944491505622864,
-0.018910802900791168,
0.033170897513628006,
-0.004197539761662483,
0.007686388213187456,
-0.05011871084570885,
-0.002104101236909628,
-0.029465457424521446,
-5.778257872179893e-8,
-0.006850012112408876,
-0.01839318498969078,
-0.03536069020628929,
0.061515141278505325,
0.013933884911239147,
0.03812754154205322,
0.04645327478647232,
0.07604712247848511,
-0.0643453374505043,
-0.06026334688067436,
0.061284348368644714,
-0.02704188972711563,
-0.016581524163484573,
0.12480589002370834,
-0.005443044938147068,
0.029626967385411263,
-0.04308438301086426,
0.11494859308004379,
-0.02807340770959854,
0.0012043140595778823,
-0.011009583249688148,
0.03458334133028984,
0.0386640839278698,
0.030412422493100166,
0.051124103367328644,
0.031570978462696075,
-0.014439815655350685,
0.01263898890465498,
-0.035801809281110764,
0.0018175740260630846,
-0.03019273467361927,
-0.014583196491003036,
-0.0013742607552558184,
0.013724132440984249,
-0.047542281448841095,
0.059460222721099854,
-0.0006308006122708321,
-0.02989298291504383,
-0.13423222303390503,
0.09096842259168625,
0.09461423754692078,
0.04984666779637337,
-0.09922855347394943,
-0.021931951865553856,
0.04496411979198456,
0.002117868047207594,
-0.0059662191197276115,
0.03222069889307022,
0.06681176275014877,
-0.0282227024435997,
0.01719501055777073,
-0.01481437124311924,
0.014602376148104668,
0.04993988946080208,
-0.0013418248854577541,
-0.018275130540132523,
0.009839886799454689,
-0.008666858077049255,
0.011882646940648556,
0.04033740609884262,
-0.03387166187167168,
-0.012438437901437283,
0.07230444252490997,
-0.05408092960715294
] | 0.116664
|
[[modules-scripting-fields]] === Accessing document fields and special variables Depending on where a script is used, it will have access to certain special variables and document fields. [float] == Update scripts A script used in the <>, <>, or <> API will have access to the `ctx` variable which exposes: [horizontal] `ctx.\_source`:: Access to the document <>. `ctx.op`:: The operation that should be applied to the document: `index` or `delete`. `ctx.\_index` etc:: Access to <>, some of which may be read-only. [float] == Search and Aggregation scripts With the exception of <> which are executed once per search hit, scripts used in search and aggregations will be executed once for every document which might match a query or an aggregation. Depending on how many documents you have, this could mean millions or billions of executions: these scripts need to be fast! Field values can be accessed from a script using <>, or <>, which are explained below. [[scripting-score]] [float] === Accessing the score of a document within a script Scripts used in the <>, in <>, or in <> have access to the `\_score` variable which represents the current relevance score of a document. Here's an example of using a script in a <> to alter the relevance `\_score` of each document: [source,js] ------------------------------------- PUT my\_index/\_doc/1?refresh { "text": "quick brown fox", "popularity": 1 } PUT my\_index/\_doc/2?refresh { "text": "quick fox", "popularity": 5 } GET my\_index/\_search { "query": { "function\_score": { "query": { "match": { "text": "quick brown fox" } }, "script\_score": { "script": { "lang": "expression", "source": "\_score \* doc['popularity']" } } } } } ------------------------------------- // CONSOLE [float] [[modules-scripting-doc-vals]] === Doc Values By far the fastest most efficient way to access a field value from a script is to use the `doc['field\_name']` syntax, which retrieves the field value from <>. Doc values are a columnar field value store, enabled by default on all fields except for <>. [source,js] ------------------------------- PUT my\_index/\_doc/1?refresh { "cost\_price": 100 } GET my\_index/\_search { "script\_fields": { "sales\_price": { "script": { "lang": "expression", "source": "doc['cost\_price'] \* markup", "params": { "markup": 0.2 } } } } } ------------------------------- // CONSOLE Doc-values can only return "simple" field values like numbers, dates, geo- points, terms, etc, or arrays of these values if the field is multi-valued. It cannot return JSON objects. [NOTE] .Doc values and `text` fields =================================================== The `doc['field']` syntax can also be used for <> if <> is enabled, but \*BEWARE\*: enabling fielddata on a `text` field requires loading all of the terms into the JVM heap, which can be very expensive both in terms of memory and CPU. It seldom makes sense to access `text` fields from scripts. =================================================== [float] [[modules-scripting-stored]] === Stored Fields and `\_source` \_Stored fields\_ -- fields explicitly marked as <> -- can be accessed using the `\_fields['field\_name'].value` or `\_fields['field\_name'].values` syntax. The document <>, which is really just a special stored field, can be accessed using the `\_source.field\_name` syntax. The `\_source` is loaded as a map-of-maps, so properties within object fields can be accessed as, for example, `\_source.name.first`. [IMPORTANT] .Prefer doc-values to stored fields ========================================================= Stored fields (which includes the stored `\_source` field) are much slower than doc-values. They are optimised for returning several fields per result, while doc values are optimised for accessing the value of a specific field in many documents. It makes sense to use `\_source` or stored fields when generating a <> for the top ten hits from a search result but, for other search and aggregation use cases, always prefer using doc values. ========================================================= For instance: [source,js] ------------------------------- PUT my\_index { "mappings": { "\_doc": { "properties": { "title": {
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/scripting/fields.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.09013231843709946,
0.07497217506170273,
-0.08392836153507233,
0.10623392462730408,
0.010302100330591202,
-0.04992350563406944,
0.020256035029888153,
-0.010008075274527073,
0.0697920173406601,
0.0019922442734241486,
0.03602863475680351,
0.08228015899658203,
0.07107347249984741,
-0.1055566668510437,
0.009883677586913109,
0.05650976300239563,
-0.06117933243513107,
-0.023325277492403984,
-0.04401501268148422,
-0.02568197436630726,
-0.02350224368274212,
0.04764891043305397,
-0.0423688106238842,
0.007660246454179287,
-0.034423429518938065,
0.018065234646201134,
-0.08810952305793762,
-0.05716335400938988,
0.026853909716010094,
-0.006288188509643078,
-0.023186255246400833,
0.059359848499298096,
-0.00457729073241353,
0.05977211147546768,
0.011625434271991253,
0.1114436686038971,
0.0018808660097420216,
-0.06297721713781357,
-0.009793450124561787,
-0.020810745656490326,
0.015357754193246365,
-0.022129468619823456,
-0.04472794756293297,
-0.003293354297056794,
-0.019776612520217896,
-0.050625719130039215,
-0.07772234827280045,
-0.05307324230670929,
-0.06659460067749023,
0.014833648689091206,
-0.0690227746963501,
0.032042261213064194,
-0.01865946501493454,
0.05144378915429115,
-0.00820824783295393,
0.0218941830098629,
-0.041179925203323364,
-0.033941056579351425,
-0.03950478881597519,
-0.040422841906547546,
-0.07190626114606857,
0.043649617582559586,
0.022081373259425163,
0.035153958946466446,
0.05975835397839546,
-0.002187500474974513,
-0.04202456772327423,
-0.01716671697795391,
0.0668182373046875,
-0.03965179622173309,
-0.03582870215177536,
0.0747888833284378,
-0.03720191866159439,
-0.0017351267160847783,
0.0010265120072290301,
0.020444389432668686,
-0.03979242965579033,
-0.061450567096471786,
0.029046999290585518,
-0.10542746633291245,
-0.041118133813142776,
-0.05893221125006676,
0.00449743727222085,
0.032126422971487045,
0.018323712050914764,
-0.04027127847075462,
0.033383116126060486,
0.01928020268678665,
0.13441693782806396,
-0.002638516714796424,
0.025694556534290314,
-0.09402316063642502,
0.06484802812337875,
0.04906101152300835,
0.07947646081447601,
0.058408427983522415,
0.04579075798392296,
-0.011407911777496338,
0.02258450537919998,
0.041457511484622955,
0.053826916962862015,
0.04524853453040123,
0.011337551288306713,
0.00929686613380909,
-0.002770385704934597,
-0.0049774725921452045,
0.02972709760069847,
0.034737881273031235,
-0.04736781492829323,
-0.038939740508794785,
-0.028165411204099655,
0.004442070610821247,
-0.043759360909461975,
-0.06246752664446831,
-0.022309506312012672,
0.07014330476522446,
0.0318104550242424,
-0.03237852826714516,
0.02375306375324726,
0.08424583822488785,
0.08451339602470398,
0.0185534730553627,
-0.028047475963830948,
-0.03631198778748512,
0.05128860846161842,
0.010995741002261639,
-0.008428608067333698,
5.369010937979288e-33,
0.012652083300054073,
-0.04501001536846161,
-0.04383242502808571,
0.025932198390364647,
-0.02099388651549816,
0.05210417881608009,
0.0520300455391407,
0.06446303427219391,
-0.10397651046514511,
0.001551784691400826,
-0.022484056651592255,
0.18091405928134918,
-0.028425807133316994,
0.028775596991181374,
0.04969024285674095,
-0.0313141793012619,
0.0451037734746933,
0.0420006662607193,
0.039442069828510284,
-0.05746176466345787,
0.0939258560538292,
-0.02838907763361931,
-0.010001630522310734,
0.11506619304418564,
0.07669968158006668,
0.06512145698070526,
-0.07317008823156357,
0.004090660717338324,
-0.08882929384708405,
0.017294416204094887,
-0.028576789423823357,
0.021618418395519257,
-0.02318081073462963,
-0.03291327878832817,
0.028741903603076935,
0.03051205724477768,
-0.030816348269581795,
-0.026247495785355568,
-0.002640376565977931,
0.002141945995390415,
-0.0013114148750901222,
-0.05656662955880165,
0.0059293657541275024,
-0.0976024642586708,
-0.12453281879425049,
-0.014734236523509026,
-0.10778279602527618,
0.13383013010025024,
0.009317047894001007,
0.01690690591931343,
0.02301839552819729,
0.12885062396526337,
-0.017320286482572556,
-0.001590849831700325,
0.09358236938714981,
0.007746066898107529,
-0.04818339645862579,
0.0001733604003675282,
0.01826380006968975,
-0.01723126880824566,
0.04621429368853569,
-0.0035585907753556967,
-0.027268990874290466,
0.03944171592593193,
-0.039111778140068054,
0.014394581317901611,
0.05526431277394295,
0.0338977687060833,
0.06463706493377686,
0.07163538038730621,
-0.04529285803437233,
0.08254341781139374,
-0.03273221105337143,
0.008265846408903599,
0.03019476681947708,
-0.09752532839775085,
-0.010823135264217854,
-0.09162817895412445,
-0.03128929063677788,
0.03702538087964058,
0.023757319897413254,
0.013905983418226242,
-0.04969293624162674,
0.018594518303871155,
-0.008676998317241669,
-0.005705358926206827,
-0.030972076579928398,
-0.014225900173187256,
-0.07184991985559464,
-0.08907362818717957,
0.0826127678155899,
-0.01299325842410326,
-0.06491577625274658,
-0.13025030493736267,
-0.018275659531354904,
-8.109739199742808e-33,
0.03106946311891079,
-0.06932628154754639,
-0.07420411705970764,
0.016036828979849815,
-0.03199167177081108,
-0.05528814718127251,
-0.019646311178803444,
-0.010893536731600761,
0.09170043468475342,
-0.04229273647069931,
-0.08419342339038849,
0.03649712726473808,
-0.03396046906709671,
-0.05085877701640129,
0.026338065043091774,
0.08743584156036377,
-0.08869227021932602,
-0.06670253723859787,
-0.012361438013613224,
0.02411212958395481,
-0.09045510739088058,
0.06645654886960983,
0.05480492115020752,
0.09833110123872757,
-0.04999278858304024,
-0.043672312051057816,
-0.03921249136328697,
-0.03402329981327057,
-0.09039124846458435,
-0.019356291741132736,
-0.07790205627679825,
-0.008601565845310688,
-0.050976503640413284,
0.036683015525341034,
-0.018646057695150375,
0.021975446492433548,
0.03427063301205635,
0.060492441058158875,
-0.03482391685247421,
0.039159346371889114,
0.098516084253788,
0.037463292479515076,
0.034476231783628464,
-0.01830768957734108,
-0.02608257345855236,
0.03514031693339348,
-0.050225138664245605,
0.027439316734671593,
-0.002046691020950675,
-0.03173770010471344,
0.010246950201690197,
-0.08465063571929932,
0.006850970443338156,
-0.02706003747880459,
-0.040281686931848526,
-0.03117530420422554,
-0.02209186740219593,
-0.0547013022005558,
-0.027385395020246506,
0.0026202730368822813,
0.036379531025886536,
-0.019615476951003075,
-0.061736155301332474,
0.09804126620292664,
-0.045711055397987366,
-0.05015424266457558,
-0.07229702919721603,
-0.08704879134893417,
-0.028783012181520462,
-0.01897418685257435,
0.05016879364848137,
-0.10809466242790222,
0.03607850894331932,
0.02335815317928791,
-0.04724597930908203,
0.028779910877346992,
0.0011264109052717686,
0.017910534515976906,
-0.02474125847220421,
0.0329110212624073,
0.05757049471139908,
0.027634382247924805,
0.07384579628705978,
0.04092804715037346,
-0.09794245660305023,
-0.0021729771979153156,
-0.05530203878879547,
0.024075759574770927,
0.03481938689947128,
-0.015102153643965721,
-0.07822294533252716,
0.013314302079379559,
-0.033082906156778336,
0.009132816456258297,
-0.001745447050780058,
-5.3565884172712686e-8,
-0.031205305829644203,
-0.002617914928123355,
-0.06476256996393204,
0.05642174184322357,
0.01252509094774723,
0.04263295605778694,
-0.030655458569526672,
0.13336145877838135,
-0.018927456811070442,
-0.03162199258804321,
0.11323537677526474,
-0.023752909153699875,
-0.02921423688530922,
-0.013285129331052303,
-0.029639743268489838,
0.05504128709435463,
-0.0028082006610929966,
-0.04982874542474747,
-0.027563687413930893,
-0.06568074226379395,
-0.016628434881567955,
0.01976885460317135,
0.08337143063545227,
0.014775577001273632,
0.06779485940933228,
-0.017203787341713905,
0.007241680286824703,
0.08371639996767044,
0.02218599058687687,
-0.005923525430262089,
0.007936622947454453,
-0.002135962015017867,
0.030621549114584923,
0.047613516449928284,
0.02852698415517807,
0.01463643554598093,
0.02672785520553589,
-0.013046453706920147,
-0.04356306046247482,
0.09849711507558823,
0.004501534625887871,
0.06414227187633514,
-0.06295684725046158,
-0.020529091358184814,
-0.008970217779278755,
-0.014662809669971466,
-0.037209734320640564,
0.014518206007778645,
0.11611002683639526,
-0.07163776457309723,
-0.023058511316776276,
-0.014569959603250027,
-0.0592670738697052,
0.10862012207508087,
-0.046160392463207245,
0.007809899747371674,
0.042297907173633575,
0.0013179108500480652,
0.03618534654378891,
-0.025399211794137955,
-0.028020432218909264,
-0.012656169012188911,
0.01819586753845215,
-0.03187408670783043
] | 0.147274
|
makes sense to use `\_source` or stored fields when generating a <> for the top ten hits from a search result but, for other search and aggregation use cases, always prefer using doc values. ========================================================= For instance: [source,js] ------------------------------- PUT my\_index { "mappings": { "\_doc": { "properties": { "title": { <1> "type": "text" }, "first\_name": { "type": "text", "store": true }, "last\_name": { "type": "text", "store": true } } } } } PUT my\_index/\_doc/1?refresh { "title": "Mr", "first\_name": "Barry", "last\_name": "White" } GET my\_index/\_search { "script\_fields": { "source": { "script": { "lang": "painless", "source": "params.\_source.title + ' ' + params.\_source.first\_name + ' ' + params.\_source.last\_name" <2> } }, "stored\_fields": { "script": { "lang": "painless", "source": "params.\_fields['first\_name'].value + ' ' + params.\_fields['last\_name'].value" } } } } ------------------------------- // CONSOLE <1> The `title` field is not stored and so cannot be used with the `\_fields[]` syntax. <2> The `title` field can still be accessed from the `\_source`. [TIP] .Stored vs `\_source` ======================================================= The `\_source` field is just a special stored field, so the performance is similar to that of other stored fields. The `\_source` provides access to the original document body that was indexed (including the ability to distinguish `null` values from empty fields, single-value arrays from plain scalars, etc). The only time it really makes sense to use stored fields instead of the `\_source` field is when the `\_source` is very large and it is less costly to access a few small stored fields instead of the entire `\_source`. =======================================================
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/scripting/fields.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.07423783838748932,
0.03437172248959541,
0.08999990671873093,
0.08895070105791092,
-0.017613455653190613,
0.050181303173303604,
-0.019576193764805794,
0.032758865505456924,
0.11194019764661789,
0.007012810092419386,
-0.01943095400929451,
0.007169840391725302,
0.0692574679851532,
-0.03770788758993149,
-0.03311625123023987,
0.1040499210357666,
-0.023516260087490082,
0.08320873230695724,
-0.031177416443824768,
-0.05018966645002365,
0.04195127263665199,
0.0646805465221405,
0.0064780013635754585,
-0.054407794028520584,
0.002024020766839385,
0.008353040553629398,
-0.08468052744865417,
-0.009306250140070915,
0.03518427535891533,
0.026201041415333748,
-0.030427156016230583,
0.012414257973432541,
-0.024274006485939026,
0.05580778047442436,
-0.012919849716126919,
0.03890576213598251,
-0.017026826739311218,
-0.042573560029268265,
0.07324547320604324,
0.040110647678375244,
0.043795354664325714,
0.00419679144397378,
0.04115943983197212,
-0.08103259652853012,
-0.011929747648537159,
-0.0364302396774292,
0.006114678923040628,
-0.028691986575722694,
-0.030108889564871788,
0.03736499696969986,
-0.09581895172595978,
0.0171093437820673,
-0.019816691055893898,
-0.0011236174032092094,
0.07120131701231003,
0.048896674066782,
-0.05240005999803543,
-0.025954268872737885,
-0.024076281115412712,
-0.0782993882894516,
0.05467525124549866,
-0.05875563621520996,
0.00901334173977375,
-0.05693728104233742,
0.013385256752371788,
-0.04416443035006523,
-0.02790112793445587,
0.04862138628959656,
-0.0016715333331376314,
0.030799834057688713,
0.040214844048023224,
0.049144595861434937,
0.03254728764295578,
-0.07386630773544312,
0.0243515744805336,
0.03238709270954132,
-0.07658454030752182,
-0.03196721151471138,
0.024868566542863846,
-0.0066469693556427956,
-0.04265008121728897,
-0.08835786581039429,
-0.029238294810056686,
-0.03469149023294449,
-0.042797766625881195,
-0.06899408251047134,
0.05503218248486519,
-0.1044621542096138,
0.058589447289705276,
-0.035210080444812775,
-0.0633544996380806,
-0.07097123563289642,
0.10390108823776245,
-0.005610689986497164,
0.053182221949100494,
0.0745558962225914,
-0.017344698309898376,
-0.0018149487441405654,
0.10093488544225693,
-0.007041738368570805,
0.023155691102147102,
0.04142550379037857,
0.03363504260778427,
-0.05284036695957184,
-0.007165222428739071,
-0.02057521604001522,
-0.042413704097270966,
0.10318474471569061,
-0.06649144738912582,
-0.012126423418521881,
-0.009506422095000744,
0.08986186236143112,
-0.04858817532658577,
-0.03576245158910751,
-0.07304579764604568,
0.04688331484794617,
0.04522116854786873,
-0.04332693666219711,
0.05344362184405327,
0.04841708391904831,
0.11210109293460846,
0.04196152091026306,
0.009354292415082455,
-0.03570415824651718,
-0.004145669750869274,
0.03229587897658348,
0.019320396706461906,
4.399639154231704e-33,
0.06098618730902672,
-0.00007933274901006371,
-0.024176714941859245,
0.012733028270304203,
-0.04227878898382187,
0.017941966652870178,
0.02848164364695549,
0.04257545247673988,
-0.040599189698696136,
-0.005784160457551479,
-0.08491440117359161,
0.11569057404994965,
-0.07898737490177155,
-0.05659651383757591,
-0.05268506333231926,
-0.013295215554535389,
-0.015779389068484306,
0.05684449523687363,
-0.025353506207466125,
-0.0539059080183506,
0.046553902328014374,
-0.0038558372762054205,
-0.011052177287638187,
0.026118043810129166,
-0.027871131896972656,
-0.024214105680584908,
-0.07747866213321686,
0.012308175675570965,
-0.10929519683122635,
-0.04694829136133194,
0.02887819893658161,
0.015330870635807514,
0.03907740116119385,
-0.04083818197250366,
0.008401518687605858,
0.06008394435048103,
-0.006806141696870327,
0.022626535966992378,
-0.01388385146856308,
-0.036442071199417114,
0.006117686629295349,
0.011930850334465504,
0.027010703459382057,
-0.10862173140048981,
-0.03510909155011177,
0.004503697622567415,
-0.10600518435239792,
0.023389941081404686,
-0.013242917135357857,
0.0020170824136584997,
-0.02585613913834095,
0.04340100660920143,
-0.008093729615211487,
0.02671286277472973,
0.05533157289028168,
-0.01691560447216034,
-0.03765414282679558,
0.09998394548892975,
0.018272319808602333,
0.02405679039657116,
-0.07605136185884476,
0.009725154377520084,
0.06980689615011215,
0.06007867306470871,
0.03853558376431465,
0.06514438986778259,
0.0913555771112442,
0.08439333736896515,
0.027605589479207993,
0.04942041262984276,
0.06312192976474762,
0.0666927918791771,
0.001630874234251678,
-0.026080287992954254,
0.07685563713312149,
-0.12117160111665726,
-0.035543814301490784,
-0.028735782951116562,
-0.04897372052073479,
0.01916382648050785,
0.002108561573550105,
-0.02874474599957466,
-0.049016982316970825,
0.08073270320892334,
0.005807702895253897,
0.09071411192417145,
-0.04688223451375961,
-0.02437940053641796,
-0.031669702380895615,
-0.03589150682091713,
0.04390422999858856,
0.008731505833566189,
-0.042285025119781494,
-0.11423996090888977,
-0.0321698859333992,
-4.313954799606375e-33,
0.05693516135215759,
-0.11402533948421478,
0.056193362921476364,
0.023655308410525322,
-0.0045029460452497005,
-0.042780693620443344,
0.06543557345867157,
0.015291428193449974,
-0.0038856277242302895,
0.04114600270986557,
-0.006453702226281166,
-0.06256994605064392,
0.0002561728178989142,
-0.0487443171441555,
-0.036629222333431244,
0.05853909254074097,
-0.03342049941420555,
-0.1219293400645256,
0.013138717971742153,
-0.00609913794323802,
-0.0009041847661137581,
0.04729217290878296,
-0.054871171712875366,
0.15157340466976166,
-0.029215756803750992,
-0.0630878284573555,
-0.03956509754061699,
-0.010247964411973953,
-0.0827581062912941,
0.011852323077619076,
0.02281077578663826,
-0.01521466113626957,
-0.05938667804002762,
0.04018364101648331,
-0.05915702506899834,
-0.005005665123462677,
0.029369955882430077,
0.016238192096352577,
-0.035747136920690536,
0.12271488457918167,
-0.02640480175614357,
0.0404081791639328,
-0.02664150856435299,
-0.0012532967375591397,
0.021806269884109497,
0.01248776912689209,
0.0026930994354188442,
0.053885605186223984,
-0.004928078036755323,
-0.05239490419626236,
0.001463990076445043,
-0.01862313598394394,
-0.10335148125886917,
-0.012194817885756493,
-0.01739519275724888,
-0.047478511929512024,
-0.03546105697751045,
-0.024400942027568817,
-0.07831364870071411,
0.013015780597925186,
0.004104853142052889,
-0.013968524523079395,
-0.053671207278966904,
0.04001854360103607,
-0.02628508023917675,
-0.046290285885334015,
-0.05392402783036232,
-0.017834670841693878,
-0.027334697544574738,
-0.07593584060668945,
-0.030777372419834137,
-0.07737493515014648,
0.127424955368042,
0.010470300912857056,
0.0073897382244467735,
0.013447102159261703,
0.09351796656847,
-0.004137994721531868,
0.06223730742931366,
-0.02693580649793148,
-0.06837759912014008,
0.04104140028357506,
0.05322260409593582,
0.09239176660776138,
-0.012218649499118328,
0.02446725405752659,
-0.04979551210999489,
0.08020889014005661,
-0.056069422513246536,
-0.024449683725833893,
-0.040166519582271576,
-0.03492655232548714,
-0.049262885004282,
-0.032112885266542435,
0.021540367975831032,
-5.8215455567278696e-8,
-0.09502585977315903,
0.07026217132806778,
-0.02707991562783718,
0.04615277796983719,
-0.08513278514146805,
0.0476187989115715,
0.08419708907604218,
0.12373461574316025,
-0.037825871258974075,
-0.05014709383249283,
0.046007368713617325,
0.04077702760696411,
-0.05966953933238983,
-0.00846137572079897,
-0.03349021449685097,
-0.03644249215722084,
-0.03016403689980507,
-0.037420082837343216,
-0.0022546667605638504,
-0.012635141611099243,
0.004413099493831396,
0.06025371327996254,
0.0726657509803772,
-0.015913860872387886,
0.12458895891904831,
0.029511502012610435,
0.02296377159655094,
-0.0006982191698625684,
0.031179046258330345,
-0.016348998993635178,
0.053538549691438675,
0.023061761632561684,
-0.008697247132658958,
0.06923939287662506,
0.027325842529535294,
-0.020293915644288063,
0.05828338861465454,
0.009582212194800377,
-0.06440961360931396,
0.05476502701640129,
0.029488174244761467,
0.025977399200201035,
-0.07254815101623535,
0.038185153156518936,
0.017350561916828156,
0.002146846614778042,
-0.05057818815112114,
0.033452000468969345,
0.15599866211414337,
-0.08384152501821518,
-0.02002229169011116,
-0.09691332280635834,
0.03058459237217903,
-0.029732398688793182,
0.018333693966269493,
-0.04900442063808441,
0.04830742999911308,
0.044246889650821686,
0.050416115671396255,
-0.01818382926285267,
0.0659472644329071,
-0.01608182303607464,
-0.0005727240932174027,
-0.003847452811896801
] | 0.013498
|
[[modules-scripting-using]] === How to use scripts Wherever scripting is supported in the Elasticsearch API, the syntax follows the same pattern: [source,js] ------------------------------------- "script": { "lang": "...", <1> "source" | "id": "...", <2> "params": { ... } <3> } ------------------------------------- // NOTCONSOLE <1> The language the script is written in, which defaults to `painless`. <2> The script itself which may be specified as `source` for an inline script or `id` for a stored script. <3> Any named parameters that should be passed into the script. For example, the following script is used in a search request to return a <>: [source,js] ------------------------------------- PUT my\_index/\_doc/1 { "my\_field": 5 } GET my\_index/\_search { "script\_fields": { "my\_doubled\_field": { "script": { "lang": "expression", "source": "doc['my\_field'] \* multiplier", "params": { "multiplier": 2 } } } } } ------------------------------------- // CONSOLE [float] === Script Parameters `lang`:: Specifies the language the script is written in. Defaults to `painless`. `source`, `id`:: Specifies the source of the script. An `inline` script is specified `source` as in the example above. A `stored` script is specified `id` and is retrieved from the cluster state (see <>). `params`:: Specifies any named parameters that are passed into the script as variables. [IMPORTANT] [[prefer-params]] .Prefer parameters ======================================== The first time Elasticsearch sees a new script, it compiles it and stores the compiled version in a cache. Compilation can be a heavy process. If you need to pass variables into the script, you should pass them in as named `params` instead of hard-coding values into the script itself. For example, if you want to be able to multiply a field value by different multipliers, don't hard-code the multiplier into the script: [source,js] ---------------------- "source": "doc['my\_field'] \* 2" ---------------------- // NOTCONSOLE Instead, pass it in as a named parameter: [source,js] ---------------------- "source": "doc['my\_field'] \* multiplier", "params": { "multiplier": 2 } ---------------------- // NOTCONSOLE The first version has to be recompiled every time the multiplier changes. The second version is only compiled once. If you compile too many unique scripts within a small amount of time, Elasticsearch will reject the new dynamic scripts with a `circuit\_breaking\_exception` error. By default, up to 15 inline scripts per minute will be compiled. You can change this setting dynamically by setting `script.max\_compilations\_rate`. ======================================== [float] [[modules-scripting-short-script-form]] === Short Script Form A short script form can be used for brevity. In the short form, `script` is represented by a string instead of an object. This string contains the source of the script. Short form: [source,js] ---------------------- "script": "ctx.\_source.likes++" ---------------------- // NOTCONSOLE The same script in the normal form: [source,js] ---------------------- "script": { "source": "ctx.\_source.likes++" } ---------------------- // NOTCONSOLE [float] [[modules-scripting-stored-scripts]] === Stored Scripts Scripts may be stored in and retrieved from the cluster state using the `\_scripts` end-point. ==== Request Examples The following are examples of using a stored script that lives at `/\_scripts/{id}`. First, create the script called `calculate-score` in the cluster state: [source,js] ----------------------------------- POST \_scripts/calculate-score { "script": { "lang": "painless", "source": "Math.log(\_score \* 2) + params.my\_modifier" } } ----------------------------------- // CONSOLE This same script can be retrieved with: [source,js] ----------------------------------- GET \_scripts/calculate-score ----------------------------------- // CONSOLE // TEST[continued] Stored scripts can be used by specifying the `id` parameters as follows: [source,js] -------------------------------------------------- GET \_search { "query": { "script": { "script": { "id": "calculate-score", "params": { "my\_modifier": 2 } } } } } -------------------------------------------------- // CONSOLE // TEST[continued] And deleted with: [source,js] ----------------------------------- DELETE \_scripts/calculate-score ----------------------------------- // CONSOLE // TEST[continued] [float] [[modules-scripting-using-caching]] === Script Caching All scripts are cached by default so that they only need to be recompiled when updates occur. By default, scripts do not have a time-based expiration, but you
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/scripting/using.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.045676086097955704,
0.042292430996894836,
-0.013636196032166481,
0.059862084686756134,
0.0422782339155674,
0.03890809416770935,
-0.012694680131971836,
0.010346362367272377,
0.06369594484567642,
0.006241830997169018,
-0.03235289454460144,
-0.016075411811470985,
0.05315719544887543,
-0.033891938626766205,
0.027822906151413918,
0.03367187827825546,
-0.039261408150196075,
-0.00978772807866335,
-0.003938189707696438,
-0.04041820764541626,
0.0657019168138504,
0.08060960471630096,
0.01655747927725315,
-0.06267286092042923,
-0.04523774981498718,
-0.020368065685033798,
-0.04792457073926926,
-0.042464714497327805,
0.05767844244837761,
0.06644564867019653,
0.023110268637537956,
0.021864233538508415,
-0.06087455153465271,
0.03899257630109787,
0.025105822831392288,
0.14391586184501648,
-0.020105797797441483,
-0.027228595688939095,
-0.03353390097618103,
0.04331192374229431,
0.0368180125951767,
0.05285539850592613,
-0.06621519476175308,
-0.12065882980823517,
-0.04292318597435951,
-0.15918272733688354,
-0.06782618910074234,
-0.07544417679309845,
-0.13766677677631378,
0.0275274608284235,
-0.07433981448411942,
-0.048500388860702515,
-0.004990032408386469,
-0.04780353605747223,
-0.013290008530020714,
0.017001565545797348,
-0.08725681155920029,
0.01290894951671362,
-0.005626989994198084,
-0.04184972122311592,
0.07032226026058197,
-0.02761215902864933,
0.020314212888479233,
-0.008299901150166988,
0.032149091362953186,
0.023441310971975327,
0.023301927372813225,
0.008383327163755894,
0.02558455429971218,
0.005365671589970589,
-0.06435234844684601,
-0.048172224313020706,
-0.012246300466358662,
-0.021237704902887344,
0.053791847079992294,
-0.004815319553017616,
0.058939289301633835,
0.017683055251836777,
0.061267655342817307,
-0.06983435899019241,
-0.06162678450345993,
-0.11675015836954117,
-0.03522372618317604,
0.05467052012681961,
-0.019604433327913284,
0.05256861448287964,
0.025952063500881195,
0.0013619402889162302,
0.16920161247253418,
0.04358990117907524,
-0.03298605605959892,
-0.1114792749285698,
0.021124545484781265,
-0.038596585392951965,
0.051213014870882034,
0.03735296428203583,
-0.08212663978338242,
0.07484810054302216,
0.01196562685072422,
-0.014467226341366768,
0.0025962460786104202,
-0.006065211724489927,
0.010174961760640144,
-0.02736697345972061,
-0.03734905645251274,
-0.005967436358332634,
-0.050491973757743835,
0.03594250977039337,
0.02398538962006569,
0.0017441367963328958,
-0.029260598123073578,
0.09712664037942886,
0.013059638440608978,
-0.06634306907653809,
-0.011452602222561836,
0.02223457396030426,
0.08000808954238892,
-0.08094115555286407,
0.0660734549164772,
0.1107027605175972,
0.10139022767543793,
0.0031294161453843117,
-0.022185569629073143,
-0.024679457768797874,
0.031657155603170395,
0.02716802805662155,
-0.010985441505908966,
-3.926587901366168e-33,
0.09981823712587357,
-0.0008552337531000376,
-0.012297376990318298,
-0.02686307579278946,
-0.03382439911365509,
0.058710649609565735,
0.06786203384399414,
0.06797601282596588,
-0.13068924844264984,
-0.013434250839054585,
-0.05012268200516701,
0.08928243070840836,
-0.03274635598063469,
0.03548334911465645,
-0.07243528962135315,
0.003138617379590869,
0.05440577119588852,
0.01971653290092945,
0.010890054516494274,
-0.031672243028879166,
0.021345477551221848,
0.0023581560235470533,
-0.004489739425480366,
0.06328102201223373,
-0.02486986294388771,
0.017833130434155464,
0.010036679916083813,
-0.043905213475227356,
-0.05762903764843941,
0.012581288814544678,
-0.029929818585515022,
-0.05042383819818497,
-0.06214488297700882,
0.020415304228663445,
0.028656793758273125,
0.03010871820151806,
-0.09894920885562897,
0.05834970250725746,
-0.029309885576367378,
0.07932047545909882,
0.04349212348461151,
-0.009506712667644024,
-0.026262717321515083,
-0.020851073786616325,
-0.017468726262450218,
-0.05538821220397949,
-0.04349278286099434,
0.04687466099858284,
0.0815545842051506,
-0.020103750750422478,
-0.031048139557242393,
0.07026170194149017,
0.10486197471618652,
-0.049833085387945175,
0.14829111099243164,
0.03136947751045227,
-0.041403282433748245,
0.03666875511407852,
0.011025450192391872,
-0.024477239698171616,
-0.030879680067300797,
-0.04959513247013092,
0.04476066306233406,
0.07167981564998627,
0.07039172202348709,
-0.007066959049552679,
0.0018328763544559479,
0.022161053493618965,
-0.034431204199790955,
0.02762378565967083,
0.030849479138851166,
0.04400946944952011,
0.03867053985595703,
0.10416603833436966,
0.05627420172095299,
-0.12439462542533875,
-0.017064005136489868,
0.004686290863901377,
0.00573973823338747,
0.01594632677733898,
-0.012931905686855316,
-0.009523559361696243,
-0.07482245564460754,
0.044494785368442535,
-0.05113893002271652,
0.04430508241057396,
-0.04148256033658981,
-0.014252625405788422,
0.0005912401247769594,
-0.05952909588813782,
0.04642845690250397,
-0.040770694613456726,
-0.1146206185221672,
-0.11918286979198456,
0.011320340447127819,
-9.045399642218732e-34,
0.05865069478750229,
-0.017413904890418053,
-0.0739307850599289,
0.01772424392402172,
-0.06634345650672913,
-0.06136108189821243,
0.06721339374780655,
-0.007202025968581438,
0.039897605776786804,
0.035774946212768555,
0.004645125474780798,
-0.04591986536979675,
-0.028352297842502594,
-0.07661879062652588,
-0.01538675557821989,
0.04552752897143364,
-0.06744930148124695,
-0.04599915072321892,
0.038377344608306885,
-0.033804040402173996,
-0.03705047816038132,
0.042703092098236084,
-0.03967031091451645,
0.06999082863330841,
-0.025388356298208237,
-0.10671229660511017,
-0.05034877359867096,
0.035015616565942764,
-0.14480169117450714,
-0.004881998989731073,
-0.053606439381837845,
0.023286517709493637,
-0.03362004831433296,
0.024506114423274994,
-0.08880242705345154,
0.02807135134935379,
-0.0019416346913203597,
0.03555307909846306,
0.010634426958858967,
0.004331745207309723,
0.010081149637699127,
0.04801756888628006,
-0.009938699193298817,
0.051096364855766296,
0.0075111123733222485,
0.010310535319149494,
-0.052619751542806625,
0.01521660853177309,
-0.01741846092045307,
-0.054520878940820694,
-0.04103310778737068,
-0.0501701794564724,
-0.03408929705619812,
-0.033374205231666565,
-0.05439871549606323,
-0.051865920424461365,
-0.054864007979631424,
-0.018215864896774292,
-0.0855538472533226,
0.035047221928834915,
-0.0033741542138159275,
-0.004753931891173124,
0.0476364940404892,
-0.02068699337542057,
0.0025502589996904135,
-0.10608217865228653,
-0.030110910534858704,
-0.004033481236547232,
-0.03879588842391968,
-0.10868187993764877,
0.009074695408344269,
-0.11473419517278671,
0.09549834579229355,
0.06281080096960068,
0.011051074601709843,
0.013762230053544044,
0.03122403472661972,
-0.005554892122745514,
0.042406510561704636,
-0.005139440298080444,
0.011759885586798191,
0.0218263678252697,
0.0426684245467186,
0.042895615100860596,
-0.01985042169690132,
0.046955157071352005,
-0.03318849578499794,
0.11320177465677261,
-0.041916877031326294,
0.02581782080233097,
-0.0008703866042196751,
-0.0367824025452137,
-0.00003111588375759311,
0.023020733147859573,
0.019482281059026718,
-5.859773466454499e-8,
-0.0455021895468235,
0.023458030074834824,
-0.06222187355160713,
-0.013115600682795048,
-0.020187100395560265,
0.07090979069471359,
0.019520670175552368,
0.07662543654441833,
-0.025511395186185837,
-0.03176664188504219,
0.00994404312223196,
0.010676532983779907,
-0.02761436626315117,
0.05363258719444275,
-0.05670623108744621,
0.02830047346651554,
-0.03305032476782799,
0.08771583437919617,
-0.047329917550086975,
0.0009379725088365376,
-0.03608853369951248,
0.05012273043394089,
-0.0007184915593825281,
0.03234567120671272,
0.10541275143623352,
0.0386044904589653,
0.020227786153554916,
0.027109650894999504,
0.0028370593208819628,
-0.03752622380852699,
-0.07486475259065628,
0.0011119722621515393,
0.007227694615721703,
-0.04658283665776253,
-0.07144995033740997,
0.05486094579100609,
0.06988900154829025,
-0.040497586131095886,
-0.07893772423267365,
0.0666525587439537,
0.05912823975086212,
0.03744812309741974,
-0.09125334769487381,
-0.02425532042980194,
-0.015414324589073658,
-0.005542002152651548,
-0.018011057749390602,
0.007586502470076084,
-0.0012829445768147707,
-0.041434187442064285,
0.010223825462162495,
-0.062114644795656204,
-0.02086031250655651,
0.05145680904388428,
-0.0383995957672596,
-0.03269938752055168,
-0.015868788585066795,
-0.05001368001103401,
0.05872578173875809,
0.011756747029721737,
0.01262605655938387,
0.02092023380100727,
0.06694167852401733,
-0.046805597841739655
] | 0.125759
|
-------------------------------------------------- // CONSOLE // TEST[continued] And deleted with: [source,js] ----------------------------------- DELETE \_scripts/calculate-score ----------------------------------- // CONSOLE // TEST[continued] [float] [[modules-scripting-using-caching]] === Script Caching All scripts are cached by default so that they only need to be recompiled when updates occur. By default, scripts do not have a time-based expiration, but you can change this behavior by using the `script.cache.expire` setting. You can configure the size of this cache by using the `script.cache.max\_size` setting. By default, the cache size is `100`. NOTE: The size of stored scripts is limited to 65,535 bytes. This can be changed by setting `script.max\_size\_in\_bytes` setting to increase that soft limit, but if scripts are really large then a <> should be considered.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/scripting/using.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.059693749994039536,
0.007421700283885002,
-0.06091389060020447,
0.053844600915908813,
0.058757588267326355,
-0.016048163175582886,
-0.02453184500336647,
-0.0008452155161648989,
0.09190767258405685,
0.03222130611538887,
0.028953509405255318,
0.06762617826461792,
-0.010334175080060959,
-0.02327798493206501,
-0.01801135390996933,
0.003902277210727334,
-0.1273554563522339,
-0.06415668874979019,
-0.005856246687471867,
-0.0966266393661499,
-0.020806172862648964,
-0.027533315122127533,
0.03258255496621132,
0.05183366313576698,
0.04737698659300804,
0.006451718509197235,
-0.03423935920000076,
-0.061277542263269424,
-0.007803299929946661,
0.014358023181557655,
-0.010999863035976887,
0.020678061991930008,
-0.011545561254024506,
-0.06275197863578796,
0.07816573977470398,
0.08205585181713104,
-0.061580412089824677,
0.0020163278095424175,
-0.01642119325697422,
-0.012168779037892818,
-0.005262839142233133,
0.04189259558916092,
-0.011012271977961063,
-0.03855103626847267,
-0.006584912538528442,
-0.050251249223947525,
-0.16384927928447723,
-0.0806381031870842,
-0.10025481879711151,
0.07357817888259888,
-0.0074983867816627026,
0.0007789329974912107,
-0.016650736331939697,
-0.06346436589956284,
-0.012545508332550526,
0.03499745577573776,
0.01998668536543846,
0.05360227823257446,
-0.004285195842385292,
0.019759487360715866,
-0.015022537671029568,
0.03334665670990944,
-0.03423857316374779,
-0.022068096324801445,
0.04367872327566147,
0.0023330016992986202,
0.05196075886487961,
-0.04602239653468132,
0.013956200331449509,
0.08059996366500854,
-0.04906328767538071,
0.051003359258174896,
0.0013121223310008645,
-0.035938702523708344,
-0.023884780704975128,
0.006778436247259378,
-0.027141153812408447,
-0.041555844247341156,
0.03173185512423515,
-0.019298400729894638,
-0.10188207030296326,
-0.16155534982681274,
-0.00809437409043312,
0.02617007866501808,
0.014699210412800312,
0.046452514827251434,
0.08804871886968613,
0.034073349088430405,
0.0657353326678276,
-0.010457569733262062,
-0.024274852126836777,
0.009297472424805164,
0.021941348910331726,
0.07254206389188766,
-0.02516656368970871,
0.04427017271518707,
-0.032614387571811676,
0.06061584874987602,
0.028408925980329514,
0.06012411415576935,
-0.012642270885407925,
0.020510876551270485,
-0.01941552199423313,
0.04321780428290367,
0.036880962550640106,
0.007988126017153263,
0.017088839784264565,
0.04764019697904587,
-0.005809803958982229,
0.013261768966913223,
-0.005026036407798529,
0.013675028458237648,
0.02622978202998638,
0.00874464400112629,
0.02202128805220127,
0.07130739837884903,
0.0019235577201470733,
0.010959917679429054,
0.028087662532925606,
0.14548400044441223,
0.1918776035308838,
0.08696754276752472,
-0.03442196547985077,
-0.05388093739748001,
0.049228016287088394,
0.05061718076467514,
0.12560062110424042,
-6.744722098789351e-33,
-0.03367588669061661,
-0.1394134759902954,
-0.009978335350751877,
0.02856678143143654,
0.08254817128181458,
0.05403297394514084,
0.015184609219431877,
0.12053637206554413,
-0.05671526491641998,
0.031114250421524048,
0.004017936531454325,
0.08153600245714188,
-0.09093743562698364,
-0.03993074968457222,
-0.0019663504790514708,
-0.006884428672492504,
0.11935713142156601,
0.03709094598889351,
0.021325288340449333,
-0.04717668145895004,
0.06506338715553284,
-0.04682857543230057,
-0.01961664669215679,
-0.015096841380000114,
0.017680080607533455,
0.04477803781628609,
0.007997531443834305,
0.0773979052901268,
-0.1360328495502472,
-0.03527499735355377,
0.03032512031495571,
0.07358688116073608,
-0.1069444939494133,
0.017835406586527824,
0.013582425191998482,
-0.004927697125822306,
-0.00905381515622139,
0.018410222604870796,
0.009116819128394127,
0.07984355837106705,
0.008313653990626335,
0.013370689004659653,
-0.039573248475790024,
-0.08078911900520325,
-0.02595379576086998,
-0.0988692194223404,
-0.0030075747054070234,
0.026239488273859024,
0.01653979904949665,
0.053701043128967285,
-0.0008624348556622863,
0.10500294715166092,
0.00503578782081604,
-0.07374509423971176,
-0.027802709490060806,
-0.013871236704289913,
0.006646307650953531,
-0.038887716829776764,
0.017234914004802704,
0.008324342779815197,
0.07306884229183197,
0.014777544885873795,
-0.03547592833638191,
-0.018195470795035362,
-0.03756537660956383,
0.07917747646570206,
-0.009005173109471798,
-0.012893873266875744,
-0.008025381714105606,
0.024913279339671135,
0.03423271328210831,
-0.006787995807826519,
0.03763147443532944,
-0.017957182601094246,
-0.004325533285737038,
-0.11841155588626862,
-0.03759518265724182,
-0.04559192433953285,
-0.07612325996160507,
-0.019677264615893364,
0.14203719794750214,
-0.02434375323355198,
-0.11393990367650986,
-0.0331762321293354,
0.05703015625476837,
-0.04996533691883087,
-0.02850833721458912,
-0.024929119274020195,
-0.02354951947927475,
-0.008460643701255322,
-0.019587142392992973,
-0.08528274297714233,
0.02682517096400261,
-0.07398338615894318,
0.011662029661238194,
1.49911997605366e-33,
0.01789763756096363,
0.04405384138226509,
-0.093498095870018,
0.065950907766819,
0.04999297112226486,
-0.0685749426484108,
-0.05616851523518562,
0.09204352647066116,
-0.0031911691185086966,
-0.01647735759615898,
-0.010370248928666115,
0.005904272198677063,
-0.02746810019016266,
0.015076100826263428,
-0.02959885075688362,
0.11458761990070343,
-0.05210686847567558,
-0.073014996945858,
-0.03748980164527893,
-0.09087273478507996,
0.029351815581321716,
0.039900749921798706,
0.0008050852920860052,
0.03971166908740997,
-0.02992841973900795,
-0.04334164410829544,
-0.02481047436594963,
-0.020586835220456123,
-0.033280130475759506,
-0.007485000882297754,
-0.07685182243585587,
0.007722906768321991,
-0.04511029273271561,
-0.021667039021849632,
0.053342439234256744,
-0.04303567484021187,
0.0360727459192276,
-0.015024838037788868,
-0.04448452591896057,
0.08675508946180344,
0.04513184726238251,
0.0024751254823058844,
-0.010021289810538292,
0.004169723484665155,
0.047094088047742844,
0.08584631979465485,
0.036868736147880554,
-0.0120396101847291,
0.06715095788240433,
-0.040238164365291595,
0.007349982392042875,
-0.07347673177719116,
-0.020145408809185028,
-0.03746204823255539,
-0.03413496911525726,
-0.03371411934494972,
-0.05780592933297157,
-0.00003281434692326002,
-0.06560627371072769,
0.021494196727871895,
0.02796241268515587,
-0.0072746858932077885,
-0.06229930743575096,
0.009764841757714748,
0.001428108778782189,
-0.004071738105267286,
-0.026344170793890953,
0.02354000322520733,
0.042485013604164124,
-0.0243928711861372,
-0.022856319323182106,
-0.022835906594991684,
0.059176910668611526,
0.017603207379579544,
-0.10039886087179184,
0.005493375472724438,
-0.007464331574738026,
-0.0017020134255290031,
0.03234267234802246,
-0.012239476665854454,
-0.022577937692403793,
-0.021191101521253586,
-0.03676009923219681,
-0.017080357298254967,
-0.0731133446097374,
-0.019366420805454254,
-0.0650310292840004,
0.022134002298116684,
0.012428490445017815,
0.039161939173936844,
-0.00497803557664156,
-0.0023230076767504215,
0.0033410380128771067,
0.007514887489378452,
0.012159603647887707,
-5.222675980576241e-8,
0.012114136479794979,
-0.013568556867539883,
-0.08520953357219696,
0.07890943437814713,
0.022661279886960983,
-0.01648796536028385,
0.05817011371254921,
0.061586759984493256,
0.044452596455812454,
-0.06180886924266815,
0.10504301637411118,
0.022457458078861237,
0.023041972890496254,
-0.01447891816496849,
-0.05623997375369072,
-0.023854529485106468,
-0.06827724725008011,
-0.005636280868202448,
0.016693826764822006,
-0.04933058097958565,
-0.061168283224105835,
-0.043287843465805054,
0.09502097964286804,
-0.0047791944816708565,
-0.06652839481830597,
-0.058161113411188126,
0.08054577559232712,
0.09702128171920776,
0.028190305456519127,
0.049581173807382584,
-0.023920757696032524,
0.019423075020313263,
0.06055353581905365,
-0.08045966923236847,
-0.00015142715710680932,
-0.03126827999949455,
0.02375175803899765,
-0.0038803594652563334,
-0.00001066191998688737,
0.10021571815013885,
-0.05220964923501015,
0.045606181025505066,
-0.053269755095243454,
0.011332723312079906,
-0.004664627369493246,
-0.08868633210659027,
-0.06988035887479782,
0.014033820480108261,
-0.006209902465343475,
-0.07252024859189987,
-0.004992315080016851,
0.00045295219752006233,
-0.11870481073856354,
0.026195967569947243,
0.027527563273906708,
-0.055634982883930206,
0.041047196835279465,
0.01814276911318302,
-0.07343211024999619,
-0.024245085194706917,
0.014258233830332756,
-0.042885396629571915,
0.008349865674972534,
-0.06756959855556488
] | 0.024365
|
[[modules-scripting-expression]] === Lucene Expressions Language Lucene's expressions compile a `javascript` expression to bytecode. They are designed for high-performance custom ranking and sorting functions and are enabled for `inline` and `stored` scripting by default. [float] === Performance Expressions were designed to have competitive performance with custom Lucene code. This performance is due to having low per-document overhead as opposed to other scripting engines: expressions do more "up-front". This allows for very fast execution, even faster than if you had written a `native` script. [float] === Syntax Expressions support a subset of javascript syntax: a single expression. See the link:http://lucene.apache.org/core/6\_0\_0/expressions/index.html?org/apache/lucene/expressions/js/package-summary.html[expressions module documentation] for details on what operators and functions are available. Variables in `expression` scripts are available to access: \* document fields, e.g. `doc['myfield'].value` \* variables and methods that the field supports, e.g. `doc['myfield'].empty` \* Parameters passed into the script, e.g. `mymodifier` \* The current document's score, `\_score` (only available when used in a `script\_score`) You can use Expressions scripts for `script\_score`, `script\_fields`, sort scripts, and numeric aggregation scripts, simply set the `lang` parameter to `expression`. [float] === Numeric field API [cols="<,<",options="header",] |======================================================================= |Expression |Description |`doc['field\_name'].value` |The value of the field, as a `double` |`doc['field\_name'].empty` |A boolean indicating if the field has no values within the doc. |`doc['field\_name'].length` |The number of values in this document. |`doc['field\_name'].min()` |The minimum value of the field in this document. |`doc['field\_name'].max()` |The maximum value of the field in this document. |`doc['field\_name'].median()` |The median value of the field in this document. |`doc['field\_name'].avg()` |The average of the values in this document. |`doc['field\_name'].sum()` |The sum of the values in this document. |======================================================================= When a document is missing the field completely, by default the value will be treated as `0`. You can treat it as another value instead, e.g. `doc['myfield'].empty ? 100 : doc['myfield'].value` When a document has multiple values for the field, by default the minimum value is returned. You can choose a different value instead, e.g. `doc['myfield'].sum()`. When a document is missing the field completely, by default the value will be treated as `0`. Boolean fields are exposed as numerics, with `true` mapped to `1` and `false` mapped to `0`. For example: `doc['on\_sale'].value ? doc['price'].value \* 0.5 : doc['price'].value` [float] === Date field API Date fields are treated as the number of milliseconds since January 1, 1970 and support the Numeric Fields API above, plus access to some date-specific fields: [cols="<,<",options="header",] |======================================================================= |Expression |Description |`doc['field\_name'].date.centuryOfEra`|Century (1-2920000) |`doc['field\_name'].date.dayOfMonth`|Day (1-31), e.g. `1` for the first of the month. |`doc['field\_name'].date.dayOfWeek`|Day of the week (1-7), e.g. `1` for Monday. |`doc['field\_name'].date.dayOfYear`|Day of the year, e.g. `1` for January 1. |`doc['field\_name'].date.era`|Era: `0` for BC, `1` for AD. |`doc['field\_name'].date.hourOfDay`|Hour (0-23). |`doc['field\_name'].date.millisOfDay`|Milliseconds within the day (0-86399999). |`doc['field\_name'].date.millisOfSecond`|Milliseconds within the second (0-999). |`doc['field\_name'].date.minuteOfDay`|Minute within the day (0-1439). |`doc['field\_name'].date.minuteOfHour`|Minute within the hour (0-59). |`doc['field\_name'].date.monthOfYear`|Month within the year (1-12), e.g. `1` for January. |`doc['field\_name'].date.secondOfDay`|Second within the day (0-86399). |`doc['field\_name'].date.secondOfMinute`|Second within the minute (0-59). |`doc['field\_name'].date.year`|Year (-292000000 - 292000000). |`doc['field\_name'].date.yearOfCentury`|Year within the century (1-100). |`doc['field\_name'].date.yearOfEra`|Year within the era (1-292000000). |======================================================================= The following example shows the difference in years between the `date` fields date0 and date1: `doc['date1'].date.year - doc['date0'].date.year` [float] [[geo-point-field-api]] === `geo\_point` field API [cols="<,<",options="header",] |======================================================================= |Expression |Description |`doc['field\_name'].empty` |A boolean indicating if the field has no values within the doc. |`doc['field\_name'].lat` |The latitude of the geo point. |`doc['field\_name'].lon` |The longitude of the geo point. |======================================================================= The following example computes distance in kilometers from Washington, DC: `haversin(38.9072, 77.0369, doc['field\_name'].lat, doc['field\_name'].lon)` In this example the coordinates could have been passed as parameters to the script, e.g. based on geolocation of the user. [float] === Limitations There are a few limitations relative to other script languages: \* Only numeric, boolean, date, and geo\_point fields
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/scripting/expression.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.05209869146347046,
0.03367701172828674,
0.03300289809703827,
0.08570265024900436,
-0.025309577584266663,
0.0007700822898186743,
-0.012373280711472034,
0.042069707065820694,
0.02736343815922737,
0.024185139685869217,
-0.052910856902599335,
0.015342691913247108,
-0.04330254718661308,
0.009242973290383816,
-0.01786007545888424,
0.012194294482469559,
-0.05626298114657402,
0.02443571947515011,
-0.07645270973443985,
-0.03614073246717453,
0.06573369354009628,
-0.03193044662475586,
-0.017959071323275566,
-0.008249806240200996,
0.02572421357035637,
-0.02223307080566883,
-0.10088605433702469,
-0.05207633972167969,
0.0812920406460762,
0.04831806570291519,
-0.026597503572702408,
0.037066735327243805,
0.018627377226948738,
0.02828000672161579,
-0.07196599245071411,
0.08958043903112411,
-0.007642225828021765,
-0.01834232732653618,
-0.015377153642475605,
-0.03450164571404457,
-0.02357729896903038,
-0.0367291234433651,
-0.006145597901195288,
-0.007174896541982889,
0.012432309798896313,
-0.04042382538318634,
-0.039823081344366074,
-0.02974008210003376,
-0.06582412123680115,
0.02328944392502308,
-0.07773932814598083,
0.05609462782740593,
-0.10658103227615356,
-0.010676865465939045,
0.038409870117902756,
0.06565146148204803,
-0.06082800030708313,
-0.011076287366449833,
-0.013434797525405884,
-0.032551418989896774,
-0.043284155428409576,
-0.01366096269339323,
0.018566710874438286,
0.012174905277788639,
0.05500778183341026,
-0.07776622474193573,
0.040901511907577515,
-0.07175910472869873,
0.00824389886111021,
-0.00814435537904501,
-0.03152638301253319,
0.04668736830353737,
0.04038740321993828,
0.03385355696082115,
0.006902102846652269,
-0.006963152904063463,
0.06449998170137405,
0.009792789816856384,
0.07980584353208542,
0.016881173476576805,
-0.03336157277226448,
-0.10889986157417297,
0.0060923839919269085,
0.08243360370397568,
0.03350304812192917,
-0.057155463844537735,
0.045844029635190964,
-0.043254368007183075,
0.1207122728228569,
0.04161766543984413,
0.0013688895851373672,
-0.09758512675762177,
-0.014722317457199097,
-0.018608346581459045,
0.05211874097585678,
0.05188296362757683,
-0.050223927944898605,
0.053616248071193695,
0.03877678140997887,
0.0022651697508990765,
0.03694188967347145,
0.03458547592163086,
-0.03716196119785309,
-0.05655219405889511,
-0.048442255705595016,
-0.03874994441866875,
0.07208671420812607,
0.027559395879507065,
-0.017973246052861214,
-0.04809099808335304,
0.00459389528259635,
0.04471486434340477,
-0.013308019377291203,
-0.07150010764598846,
-0.061064381152391434,
0.04658516123890877,
0.089080810546875,
-0.06918958574533463,
0.11786315590143204,
0.0866198018193245,
0.02731824852526188,
0.07369337230920792,
0.02411304973065853,
-0.0494198314845562,
0.06669557094573975,
0.05565672367811203,
-0.015735803171992302,
2.0226150894263383e-33,
0.03391330689191818,
-0.0005586360348388553,
-0.04024151712656021,
-0.04677654057741165,
-0.13668498396873474,
0.04664041846990585,
-0.00890363473445177,
0.053966980427503586,
-0.12705887854099274,
-0.010133910924196243,
-0.026997867971658707,
0.1200978010892868,
-0.04377469792962074,
0.012341813184320927,
0.035436585545539856,
-0.0461280457675457,
0.05497952923178673,
0.00007236975943669677,
-0.03649434447288513,
-0.04948439449071884,
0.03797166794538498,
-0.02544083073735237,
0.005683736875653267,
0.07521611452102661,
0.041459448635578156,
0.013233724981546402,
-0.04541291669011116,
-0.02524137683212757,
-0.07413699477910995,
0.03650544583797455,
-0.02848958969116211,
-0.07894709706306458,
-0.005221033003181219,
-0.023971352726221085,
0.0737333819270134,
0.03754255548119545,
-0.07501626759767532,
-0.03028755448758602,
0.07473046332597733,
0.04079076275229454,
-0.08130291849374771,
-0.009583383798599243,
0.026948679238557816,
-0.09341831505298615,
-0.05752583593130112,
-0.0068975817412137985,
-0.09848353266716003,
0.11926404386758804,
0.06629133969545364,
0.03280578553676605,
0.0066033317707479,
0.09416080266237259,
0.016796376556158066,
0.045579053461551666,
0.09357935190200806,
0.07649827748537064,
0.041706860065460205,
0.013690831139683723,
-0.040798526257276535,
0.024188242852687836,
-0.023528296500444412,
-0.02228992059826851,
-0.017538554966449738,
-0.010671259835362434,
-0.009807871654629707,
-0.031588759273290634,
0.04483570531010628,
0.09171486645936966,
-0.0002095896052196622,
0.027155188843607903,
-0.020020971074700356,
0.030034732073545456,
0.004027999937534332,
0.017232155427336693,
0.04413916543126106,
-0.06995529681444168,
0.050530146807432175,
-0.055960752069950104,
-0.039102647453546524,
-0.0687016174197197,
-0.06171661242842674,
0.06061511114239693,
0.009641462005674839,
-0.03024904988706112,
0.016542159020900726,
0.029359087347984314,
-0.06953762471675873,
0.009344669058918953,
-0.027741441503167152,
-0.06863286346197128,
0.10143160820007324,
0.013973883353173733,
-0.051292963325977325,
-0.07552110403776169,
-0.03547919914126396,
-4.219542032084206e-33,
-0.09014073014259338,
0.001706265495158732,
-0.07371245324611664,
0.05081988498568535,
-0.05983176454901695,
-0.04058833047747612,
0.00005550855348701589,
-0.08814699947834015,
0.10491994023323059,
-0.014672829769551754,
-0.05170920863747597,
-0.017135240137577057,
-0.05972253531217575,
-0.04500053822994232,
-0.032242149114608765,
0.05495337396860123,
-0.08736629039049149,
-0.030076200142502785,
0.05079360678792,
0.004998657386749983,
-0.0028556252364069223,
0.1040252074599266,
0.01685686782002449,
0.038076695054769516,
-0.03972255811095238,
-0.04017070680856705,
-0.009954790584743023,
0.012811080552637577,
-0.08856459707021713,
0.01998051069676876,
-0.041130173951387405,
-0.05132243037223816,
-0.03255565091967583,
-0.020601438358426094,
-0.0382915697991848,
-0.05665968358516693,
0.06477048993110657,
-0.06093672662973404,
-0.009534756653010845,
0.024094779044389725,
0.009550997987389565,
-0.0070406608283519745,
0.08255792409181595,
0.03194291144609451,
0.036233775317668915,
0.022847453132271767,
-0.06865528970956802,
0.025194484740495682,
0.08179189264774323,
-0.05380414053797722,
-0.040928587317466736,
-0.033716849982738495,
-0.04039846733212471,
0.038957588374614716,
-0.12714827060699463,
-0.08839190006256104,
-0.08191810548305511,
0.02108614705502987,
-0.05532720685005188,
0.08499563485383987,
-0.013407295569777489,
0.0012447646586224437,
0.05482342466711998,
0.04185863211750984,
-0.04431701451539993,
0.014328530058264732,
-0.057096149772405624,
0.03238687291741371,
-0.05047047510743141,
-0.07692798972129822,
-0.007300074677914381,
-0.1320187896490097,
0.0372106172144413,
0.061817191541194916,
-0.12367473542690277,
0.01578141376376152,
0.08448631316423416,
0.05178147554397583,
0.03437981382012367,
0.0613153837621212,
0.0718856006860733,
0.1268904209136963,
0.006353319156914949,
-0.04760270565748215,
-0.06937730312347412,
0.004886572249233723,
0.013118346221745014,
0.06307688355445862,
-0.10202058404684067,
-0.0037338673137128353,
-0.002207189565524459,
0.054627932608127594,
-0.008100617676973343,
-0.013120442628860474,
-0.027131173759698868,
-5.108678635679098e-8,
-0.019863849505782127,
0.01844128780066967,
-0.07410415261983871,
-0.02092081680893898,
-0.013704370707273483,
0.05468593165278435,
0.0219771396368742,
0.052462972700595856,
-0.025492828339338303,
-0.028176892548799515,
0.10047005116939545,
0.022646820172667503,
-0.022805439308285713,
-0.03363901749253273,
0.038942281156778336,
0.007781108375638723,
-0.060157764703035355,
-0.03385821357369423,
-0.07717125117778778,
-0.0030928882770240307,
-0.013640846125781536,
0.011812171898782253,
-0.021815922111272812,
0.03316718712449074,
0.03304421901702881,
0.026976488530635834,
0.019600646570324898,
0.02363891713321209,
0.05790156498551369,
0.042783137410879135,
-0.016283823177218437,
0.10923714935779572,
0.0653262510895729,
0.023261191323399544,
-0.016891058534383774,
0.07461927086114883,
0.01993512362241745,
-0.03943876177072525,
-0.007519997656345367,
0.1405148059129715,
0.029419930651783943,
0.04960097745060921,
0.006351394113153219,
0.012075504288077354,
0.034762319177389145,
0.05210556834936142,
-0.0028615312185138464,
-0.015563789755105972,
0.04703310877084732,
-0.039780206978321075,
0.02431592158973217,
-0.003286118386313319,
-0.056749626994132996,
0.04057300090789795,
-0.02957596816122532,
0.002376600168645382,
-0.029241202399134636,
-0.025629127398133278,
0.037902384996414185,
0.01355487760156393,
-0.005236889235675335,
-0.013304383493959904,
0.06519278138875961,
-0.00371128274127841
] | 0.152023
|
kilometers from Washington, DC: `haversin(38.9072, 77.0369, doc['field\_name'].lat, doc['field\_name'].lon)` In this example the coordinates could have been passed as parameters to the script, e.g. based on geolocation of the user. [float] === Limitations There are a few limitations relative to other script languages: \* Only numeric, boolean, date, and geo\_point fields may be accessed \* Stored fields are not available
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/scripting/expression.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.025533761829137802,
0.07176826894283295,
-0.0174395889043808,
-0.019666939973831177,
0.0024780158419162035,
-0.06095978617668152,
0.020711738616228104,
0.06206992641091347,
0.008604183793067932,
-0.02438277006149292,
0.018314668908715248,
-0.020128710195422173,
0.01574673503637314,
-0.050580669194459915,
-0.00802262406796217,
0.012945767492055893,
-0.10801643133163452,
-0.0690375417470932,
-0.016532892361283302,
-0.017472948879003525,
-0.0034695533104240894,
0.03644591197371483,
-0.047340117394924164,
0.08296135812997818,
0.08699680864810944,
-0.030520590022206306,
0.0025126778054982424,
-0.0021603472996503115,
-0.03698711842298508,
0.07005555927753448,
0.011565400287508965,
-0.003865924198180437,
-0.0628754049539566,
0.05391978472471237,
0.04268450662493706,
0.07737423479557037,
0.04347556456923485,
-0.019355667755007744,
0.0007151321042329073,
0.06732485443353653,
0.04397939145565033,
-0.0510084368288517,
0.06167878210544586,
0.05312327668070793,
-0.03236022964119911,
-0.0008773135486990213,
-0.022467046976089478,
0.08642928302288055,
0.004682261496782303,
0.07329804450273514,
-0.05485238879919052,
0.014653476886451244,
0.02861914224922657,
-0.042448487132787704,
-0.003995560109615326,
0.03706471621990204,
-0.04229992628097534,
0.08807702362537384,
-0.0020261299796402454,
-0.08454479277133942,
-0.0615900382399559,
-0.014171727932989597,
-0.009649689309298992,
0.00224969070404768,
-0.010935509577393532,
-0.062345243990421295,
-0.08977148681879044,
-0.023476874455809593,
-0.02236511930823326,
-0.020855683833360672,
0.008397545665502548,
0.05595098435878754,
-0.03813096135854721,
-0.004007743205875158,
0.0653979629278183,
-0.03912633657455444,
-0.07990682125091553,
0.011523522436618805,
0.02302553504705429,
-0.059470850974321365,
0.03136714920401573,
-0.038204461336135864,
-0.00013581120583694428,
0.07510296255350113,
-0.03133692219853401,
-0.049724116921424866,
0.025533262640237808,
0.04512970894575119,
0.13622961938381195,
-0.0810551866889,
0.08100595325231552,
-0.0846744030714035,
-0.045673735439777374,
0.02856806479394436,
-0.025786271318793297,
0.04650299996137619,
0.024693654850125313,
-0.025504784658551216,
-0.021400820463895798,
0.0025384321343153715,
0.05971204489469528,
-0.01901972107589245,
0.01202310249209404,
0.000924846448469907,
0.05699022486805916,
0.009577707387506962,
-0.06795651465654373,
-0.0466570146381855,
0.032517578452825546,
0.008638179861009121,
-0.002447795821353793,
0.0026310032699257135,
-0.05036764591932297,
-0.03144055977463722,
-0.015409176237881184,
0.046370524913072586,
0.016519809141755104,
-0.06431521475315094,
-0.05627208575606346,
-0.005981366615742445,
-0.027470873668789864,
-0.05786179006099701,
-0.04501563683152199,
0.027677254751324654,
-0.020735321566462517,
-0.026058394461870193,
0.1310795396566391,
2.1772811259777654e-33,
-0.00927574373781681,
-0.04778306558728218,
0.08653944730758667,
0.03912139683961868,
-0.0729604959487915,
0.01361269410699606,
-0.04959667846560478,
0.09895357489585876,
-0.02372780255973339,
-0.005461631342768669,
-0.05663234740495682,
0.020389769226312637,
0.07024635374546051,
-0.03776455298066139,
0.022474955767393112,
0.015843860805034637,
0.08098633587360382,
-0.00730829406529665,
-0.0008423496037721634,
0.0455673411488533,
0.060784757137298584,
-0.048934515565633774,
-0.029575064778327942,
0.023731738328933716,
-0.012114998884499073,
0.08779487013816833,
-0.09273280203342438,
0.06170018017292023,
-0.03393978253006935,
-0.010002040304243565,
-0.045284204185009,
-0.038363102823495865,
-0.015296347439289093,
-0.002217467874288559,
0.09027108550071716,
0.02318893000483513,
0.001964402152225375,
-0.04571867361664772,
0.01826762780547142,
0.02638349123299122,
0.012511851266026497,
-0.0055533465929329395,
0.009791471064090729,
0.007287236861884594,
-0.003722371766343713,
0.021116387099027634,
-0.044155411422252655,
0.03828085586428642,
0.02762768045067787,
0.07703646272420883,
-0.0954381600022316,
0.09869664162397385,
-0.03998315706849098,
-0.04706740006804466,
0.11518803983926773,
-0.031932707875967026,
-0.0735398679971695,
0.008756987750530243,
-0.013070324435830116,
-0.03977087512612343,
0.06616430729627609,
0.03604293242096901,
0.029900845140218735,
-0.017770329490303993,
0.025777392089366913,
-0.17604020237922668,
-0.010518747381865978,
0.021979833021759987,
0.006337469909340143,
0.03545492887496948,
0.05979318171739578,
0.014783958904445171,
0.03410132974386215,
0.08661900460720062,
0.02650272101163864,
-0.021345283836126328,
0.027051478624343872,
-0.04036480188369751,
0.007356439717113972,
-0.0037516667507588863,
-0.018209178000688553,
0.006281728856265545,
-0.05318387970328331,
0.0301591157913208,
-0.019345592707395554,
-0.014208360575139523,
0.02495974861085415,
-0.01286381296813488,
-0.04206032305955887,
-0.05029787868261337,
0.012280107475817204,
-0.042621735483407974,
-0.1262572854757309,
-0.08739633113145828,
-0.056769099086523056,
-5.227064852329712e-33,
-0.017943916842341423,
-0.04521173611283302,
-0.03007453680038452,
0.019169170409440994,
-0.08770319819450378,
-0.05967453867197037,
0.053661689162254333,
0.07474341988563538,
0.05266342684626579,
0.014249891974031925,
-0.09354963898658752,
-0.07916247099637985,
0.014602985233068466,
0.006859715562313795,
0.16577932238578796,
0.08400557190179825,
-0.03207213804125786,
-0.004316696431487799,
-0.05503607913851738,
0.007614837493747473,
-0.049436938017606735,
-0.01616053842008114,
-0.03679651394486427,
0.05595572665333748,
-0.01848704181611538,
-0.051659997552633286,
-0.004409779794514179,
-0.06300877034664154,
-0.11002888530492783,
0.022168835625052452,
-0.09229733049869537,
0.03242771327495575,
-0.047564797103405,
0.14717762172222137,
-0.046899355947971344,
0.021546998992562294,
0.03781597688794136,
0.08996053040027618,
0.013686374761164188,
-0.042808666825294495,
0.008783900178968906,
0.01574716530740261,
0.03484663367271423,
0.023039016872644424,
-0.03835490345954895,
0.0323970653116703,
0.03105642832815647,
0.04308672249317169,
0.004937650635838509,
-0.013192332349717617,
0.018877889961004257,
-0.02931310422718525,
-0.022622087970376015,
0.037295207381248474,
-0.0401020273566246,
-0.0036033010110259056,
-0.07938038557767868,
-0.035662077367305756,
-0.007432864047586918,
-0.06215573102235794,
-0.023623570799827576,
-0.05823518708348274,
0.014341806061565876,
0.03288467228412628,
-0.058547861874103546,
-0.006011666264384985,
-0.05186095088720322,
0.01995234377682209,
0.004100097808986902,
-0.06776836514472961,
0.05303284525871277,
-0.0779556930065155,
-0.005611312109977007,
0.025177763774991035,
-0.10490690171718597,
0.08598104119300842,
0.041366588324308395,
0.015016078017652035,
-0.07124614715576172,
0.023932090029120445,
0.08883830904960632,
0.024216214194893837,
0.008311742916703224,
0.03446028754115105,
0.026538658887147903,
0.059269778430461884,
-0.0026644649915397167,
-0.023553695529699326,
-0.06600344926118851,
0.011118733324110508,
-0.05115838721394539,
0.14488114416599274,
-0.09454292804002762,
0.0668688714504242,
-0.06650769710540771,
-4.678888387843472e-8,
-0.08769599348306656,
0.043045639991760254,
-0.10065007954835892,
0.009065794758498669,
-0.10590912401676178,
0.03480582311749458,
0.09677810966968536,
0.017292063683271408,
-0.02632693015038967,
0.04910873621702194,
0.003013100242242217,
-0.0106643782928586,
0.0034122818615287542,
-0.011462344788014889,
0.005067832302302122,
0.0014580102870240808,
-0.024413414299488068,
0.015081276185810566,
-0.004497136455029249,
0.04839843139052391,
0.006984322797507048,
0.003711369587108493,
-0.014619647525250912,
-0.006399457808583975,
0.045120254158973694,
0.03891095891594887,
-0.05717049539089203,
0.09453462064266205,
0.07572899013757706,
-0.03354036435484886,
0.10723903775215149,
-0.003067631972953677,
0.024696022272109985,
0.06008477881550789,
-0.018140053376555443,
-0.006692670751363039,
-0.014601613394916058,
0.08498493582010269,
-0.013888050802052021,
0.01737207919359207,
-0.030259590595960617,
0.02900322899222374,
-0.12049485743045807,
0.00655941478908062,
0.045891717076301575,
-0.04333334416151047,
0.018310314044356346,
0.024428151547908783,
0.05411019176244736,
-0.051276400685310364,
-0.08075374364852905,
-0.006495659705251455,
-0.01432487927377224,
0.01013426948338747,
0.07552985846996307,
-0.05209586024284363,
-0.024543672800064087,
-0.012729406356811523,
-0.006131783593446016,
0.04669640213251114,
-0.16655941307544708,
0.07431145012378693,
-0.07316476106643677,
-0.019491668790578842
] | 0.06368
|
[[modules-discovery-zen]] === Zen Discovery The zen discovery is the built in discovery module for Elasticsearch and the default. It provides unicast discovery, but can be extended to support cloud environments and other forms of discovery. The zen discovery is integrated with other modules, for example, all communication between nodes is done using the <> module. It is separated into several sub modules, which are explained below: [float] [[ping]] ==== Ping This is the process where a node uses the discovery mechanisms to find other nodes. [float] [[unicast]] ===== Unicast Unicast discovery requires a list of hosts to use that will act as gossip routers. These hosts can be specified as hostnames or IP addresses; hosts specified as hostnames are resolved to IP addresses during each round of pinging. Note that if you are in an environment where DNS resolutions vary with time, you might need to adjust your <>. It is recommended that the unicast hosts list be maintained as the list of master-eligible nodes in the cluster. Unicast discovery provides the following settings with the `discovery.zen.ping.unicast` prefix: [cols="<,<",options="header",] |======================================================================= |Setting |Description |`hosts` |Either an array setting or a comma delimited setting. Each value should be in the form of `host:port` or `host` (where `port` defaults to the setting `transport.profiles.default.port` falling back to `transport.tcp.port` if not set). Note that IPv6 hosts must be bracketed. Defaults to `127.0.0.1, [::1]` |`hosts.resolve\_timeout` |The amount of time to wait for DNS lookups on each round of pinging. Specified as <>. Defaults to 5s. |======================================================================= The unicast discovery uses the <> module to perform the discovery. [float] [[master-election]] ==== Master Election As part of the ping process a master of the cluster is either elected or joined to. This is done automatically. The `discovery.zen.ping\_timeout` (which defaults to `3s`) determines how long the node will wait before deciding on starting an election or joining an existing cluster. Three pings will be sent over this timeout interval. In case where no decision can be reached after the timeout, the pinging process restarts. In slow or congested networks, three seconds might not be enough for a node to become aware of the other nodes in its environment before making an election decision. Increasing the timeout should be done with care in that case, as it will slow down the election process. Once a node decides to join an existing formed cluster, it will send a join request to the master (`discovery.zen.join\_timeout`) with a timeout defaulting at 20 times the ping timeout. When the master node stops or has encountered a problem, the cluster nodes start pinging again and will elect a new master. This pinging round also serves as a protection against (partial) network failures where a node may unjustly think that the master has failed. In this case the node will simply hear from other nodes about the currently active master. If `discovery.zen.master\_election.ignore\_non\_master\_pings` is `true`, pings from nodes that are not master eligible (nodes where `node.master` is `false`) are ignored during master election; the default value is `false`. Nodes can be excluded from becoming a master by setting `node.master` to `false`. The `discovery.zen.minimum\_master\_nodes` sets the minimum number of master eligible nodes that need to join a newly elected master in order for an election to complete and for the elected node to accept its mastership. The same setting controls the minimum number of active master eligible nodes that should be a part of any active cluster. If this requirement is not met the active master node will step down and a new master election will begin. This setting must be set to a <> of your master
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/discovery/zen.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.0541355162858963,
-0.00672753294929862,
-0.07054033130407333,
0.04814991354942322,
0.048403315246105194,
-0.021246707066893578,
0.05541897192597389,
-0.11007876694202423,
0.029369179159402847,
0.012354433536529541,
-0.03866749256849289,
-0.0011403979733586311,
-0.0021765355486422777,
0.017057405784726143,
-0.03200424090027809,
-0.033168282359838486,
-0.0012669472489506006,
-0.08557412028312683,
0.04017190262675285,
-0.06560685485601425,
-0.012369690462946892,
0.0834636464715004,
0.05818627402186394,
-0.013744378462433815,
-0.08889853209257126,
-0.008500640280544758,
0.008832339197397232,
-0.005925872828811407,
0.08460499346256256,
0.01351550780236721,
0.06129923462867737,
0.05253056436777115,
0.023209191858768463,
0.029908230528235435,
-0.00308915670029819,
0.030333755537867546,
-0.01007245946675539,
-0.007331962697207928,
-0.12327492982149124,
-0.030452745035290718,
0.1297227144241333,
-0.006359167397022247,
-0.0405011847615242,
-0.08195827901363373,
-0.059142135083675385,
-0.03106321394443512,
-0.010926236398518085,
0.004999804776161909,
-0.039531923830509186,
-0.07422258704900742,
0.00633620098233223,
-0.012493359856307507,
-0.012117680162191391,
0.10067690908908844,
0.0034615800250321627,
0.14211738109588623,
-0.04859396815299988,
0.002226805780082941,
-0.0768674984574318,
-0.06566359847784042,
-0.003821610240265727,
-0.07114307582378387,
-0.027940761297941208,
-0.024549923837184906,
0.02023562602698803,
-0.028637198731303215,
0.019366489723324776,
0.036493077874183655,
0.07224281877279282,
-0.013715800829231739,
0.020728586241602898,
0.0536905936896801,
-0.011893581598997116,
0.059554290026426315,
0.04921235889196396,
0.03233031556010246,
0.07339830696582794,
0.019630450755357742,
0.003098128130659461,
0.001784567371942103,
-0.03846725448966026,
0.019734423607587814,
0.015078652650117874,
0.023906638845801353,
0.001053522457368672,
0.004852618556469679,
-0.027195867151021957,
-0.018555359914898872,
0.10837356001138687,
0.031238336116075516,
0.017999788746237755,
-0.023997090756893158,
-0.07699547708034515,
0.004628192167729139,
-0.012933112680912018,
0.04080783203244209,
0.0867161825299263,
0.0020912843756377697,
0.034424010664224625,
0.05218188464641571,
0.04652539640665054,
-0.002521846443414688,
0.0408281534910202,
-0.03211984038352966,
-0.04170140624046326,
0.008448800072073936,
-0.02428893744945526,
0.007664917968213558,
0.06500311195850372,
0.11003005504608154,
-0.02645472064614296,
-0.003836746560409665,
0.06093035638332367,
-0.03476410359144211,
-0.026424111798405647,
-0.036659132689237595,
0.07115386426448822,
0.029027627781033516,
-0.03134717047214508,
0.03529088944196701,
0.016970280557870865,
-0.0846165344119072,
0.03194686397910118,
-0.010015411302447319,
-0.0211075060069561,
0.12232661247253418,
-0.12408974021673203,
5.732042531763581e-33,
0.07036399841308594,
0.015101258642971516,
-0.04721609130501747,
-0.012437636032700539,
-0.056988928467035294,
0.09656228870153427,
-0.0023495028726756573,
0.01140839047729969,
-0.07287902384996414,
-0.014599930495023727,
-0.05807919800281525,
0.06401834636926651,
0.07326669245958328,
0.01085025817155838,
-0.04333525896072388,
0.014866643585264683,
0.07172787189483643,
0.0593947134912014,
0.07265780866146088,
-0.014316537417471409,
0.020280687138438225,
0.0058473097160458565,
-0.0595543272793293,
-0.06455336511135101,
0.04889241233468056,
0.03687473013997078,
-0.032503917813301086,
-0.08313872665166855,
-0.036156609654426575,
-0.007032925728708506,
0.034606605768203735,
0.03166781738400459,
-0.045957401394844055,
0.056716348975896835,
0.0567750446498394,
0.07385921478271484,
-0.052681148052215576,
-0.03266684338450432,
-0.04682277888059616,
-0.07143212854862213,
0.05266980826854706,
-0.035552240908145905,
-0.055331047624349594,
-0.025255652144551277,
-0.01404363289475441,
-0.026984356343746185,
-0.01723545603454113,
-0.015943709760904312,
0.0834851861000061,
-0.00547997048124671,
-0.06720772385597229,
-0.048320021480321884,
0.03172921761870384,
-0.04012960195541382,
0.037818145006895065,
0.028769463300704956,
0.031204042956233025,
-0.026427607983350754,
0.01829787902534008,
-0.023499634116888046,
-0.06073659285902977,
-0.09328533709049225,
-0.013641406781971455,
0.028872400522232056,
0.030303489416837692,
0.047503478825092316,
-0.07727675139904022,
0.03435816988348961,
0.07070590555667877,
0.06721781939268112,
0.03773045167326927,
0.058070458471775055,
0.029842980206012726,
0.04700496047735214,
-0.025536946952342987,
-0.08755649626255035,
-0.05672753229737282,
-0.051658160984516144,
0.07528366893529892,
0.018020598217844963,
-0.09011992067098618,
0.053547341376543045,
-0.04979625716805458,
0.08616360276937485,
-0.06361040472984314,
-0.03754530847072601,
0.010650980286300182,
0.011951989494264126,
-0.0030627609230577946,
-0.021408867090940475,
0.028024153783917427,
0.04038676247000694,
0.032125215977430344,
-0.00703557999804616,
-0.05804155766963959,
-5.6198379225577475e-33,
-0.04947854205965996,
0.04496854543685913,
-0.08209478110074997,
-0.013506541028618813,
0.016890743747353554,
-0.05654238164424896,
-0.0146867036819458,
0.08908738195896149,
-0.03347766026854515,
-0.045100461691617966,
0.03455996513366699,
-0.051534466445446014,
-0.048197098076343536,
-0.060367219150066376,
0.002856919076293707,
0.08999943733215332,
0.03947962448000908,
-0.13049718737602234,
0.07388265430927277,
0.04225441440939903,
-0.11577081680297852,
-0.036011263728141785,
-0.1255413442850113,
-0.039941705763339996,
-0.024039506912231445,
-0.04287352040410042,
0.11858315020799637,
-0.0214148610830307,
-0.05760945379734039,
-0.02735290676355362,
0.03345431387424469,
0.005802623461931944,
-0.07081098109483719,
-0.014906404539942741,
0.009480269625782967,
0.08244359493255615,
0.01643802411854267,
0.02442752756178379,
-0.062403641641139984,
-0.07390175014734268,
0.056263215839862823,
0.05542939156293869,
-0.04917313531041145,
0.09145879000425339,
-0.00014725209621246904,
-0.03305327519774437,
0.03238295763731003,
0.10015855729579926,
-0.05732882395386696,
0.010459045879542828,
0.025209076702594757,
-0.10550253838300705,
-0.04408302158117294,
0.03278897702693939,
-0.004341800697147846,
0.05920053645968437,
-0.012630794197320938,
0.06488394737243652,
-0.03966283053159714,
0.020827002823352814,
0.0469275638461113,
-0.06016969308257103,
-0.09355025738477707,
0.15396420657634735,
0.0176154226064682,
-0.06995046138763428,
0.009540672414004803,
0.046775978058576584,
-0.04898946359753609,
-0.037245217710733414,
-0.034954920411109924,
0.012937010265886784,
0.046341169625520706,
-0.0432647243142128,
0.027187447994947433,
-0.02571699023246765,
0.03353758528828621,
0.009048109874129295,
-0.04317606985569,
0.01901177130639553,
-0.06485404819250107,
0.047589611262083054,
-0.028070347383618355,
-0.027625758200883865,
0.00943424180150032,
0.015666576102375984,
0.021134279668331146,
0.07318507879972458,
-0.08871736377477646,
0.07855784147977829,
0.009140366688370705,
-0.03232399374246597,
-0.06238317862153053,
0.04699992015957832,
-0.07232537865638733,
-5.106240408281337e-8,
-0.023979397490620613,
-0.04547802731394768,
-0.06475739181041718,
-0.0371372252702713,
0.042870137840509415,
0.07345275580883026,
0.088271364569664,
0.0181001927703619,
-0.08459877222776413,
0.06759018450975418,
-0.014511623419821262,
-0.035248082131147385,
0.00003772266427404247,
0.06677163392305374,
0.06420101970434189,
0.025562502443790436,
0.02862400934100151,
0.004553907085210085,
-0.07396972924470901,
-0.017091965302824974,
-0.05224029719829559,
0.010756520554423332,
-0.008928066119551659,
0.054558683186769485,
0.019933214411139488,
-0.013368147425353527,
-0.02257801592350006,
-0.0011308372486382723,
-0.007906174287199974,
-0.018470026552677155,
-0.10447262972593307,
-0.02494638040661812,
0.06994624435901642,
0.061026930809020996,
0.046384040266275406,
0.08997651189565659,
-0.03727782517671585,
-0.060244638472795486,
-0.04031999409198761,
0.029782602563500404,
0.016289589926600456,
0.05377012491226196,
0.056476399302482605,
-0.014106187969446182,
0.01608213782310486,
-0.04552338644862175,
-0.02547295391559601,
-0.05377388000488281,
0.06898138672113419,
0.010655087418854237,
0.005806175991892815,
-0.05043793097138405,
0.04613902047276497,
-0.042197976261377335,
0.05163663998246193,
0.0354587659239769,
-0.061164844781160355,
-0.055250875651836395,
0.053956471383571625,
0.06302407383918762,
-0.011118550784885883,
0.004577684681862593,
-0.04958983138203621,
-0.01033711340278387
] | 0.163289
|
setting controls the minimum number of active master eligible nodes that should be a part of any active cluster. If this requirement is not met the active master node will step down and a new master election will begin. This setting must be set to a <> of your master eligible nodes. It is recommended to avoid having only two master eligible nodes, since a quorum of two is two. Therefore, a loss of either master eligible node will result in an inoperable cluster. [float] [[fault-detection]] ==== Fault Detection There are two fault detection processes running. The first is by the master, to ping all the other nodes in the cluster and verify that they are alive. And on the other end, each node pings to master to verify if its still alive or an election process needs to be initiated. The following settings control the fault detection process using the `discovery.zen.fd` prefix: [cols="<,<",options="header",] |======================================================================= |Setting |Description |`ping\_interval` |How often a node gets pinged. Defaults to `1s`. |`ping\_timeout` |How long to wait for a ping response, defaults to `30s`. |`ping\_retries` |How many ping failures / timeouts cause a node to be considered failed. Defaults to `3`. |======================================================================= [float] ==== Cluster state updates The master node is the only node in a cluster that can make changes to the cluster state. The master node processes one cluster state update at a time, applies the required changes and publishes the updated cluster state to all the other nodes in the cluster. Each node receives the publish message, acknowledges it, but does \*not\* yet apply it. If the master does not receive acknowledgement from at least `discovery.zen.minimum\_master\_nodes` nodes within a certain time (controlled by the `discovery.zen.commit\_timeout` setting and defaults to 30 seconds) the cluster state change is rejected. Once enough nodes have responded, the cluster state is committed and a message will be sent to all the nodes. The nodes then proceed to apply the new cluster state to their internal state. The master node waits for all nodes to respond, up to a timeout, before going ahead processing the next updates in the queue. The `discovery.zen.publish\_timeout` is set by default to 30 seconds and is measured from the moment the publishing started. Both timeout settings can be changed dynamically through the <> [float] [[no-master-block]] ==== No master block For the cluster to be fully operational, it must have an active master and the number of running master eligible nodes must satisfy the `discovery.zen.minimum\_master\_nodes` setting if set. The `discovery.zen.no\_master\_block` settings controls what operations should be rejected when there is no active master. The `discovery.zen.no\_master\_block` setting has two valid options: [horizontal] `all`:: All operations on the node--i.e. both read & writes--will be rejected. This also applies for api cluster state read or write operations, like the get index settings, put mapping and cluster state api. `write`:: (default) Write operations will be rejected. Read operations will succeed, based on the last known cluster configuration. This may result in partial reads of stale data as this node may be isolated from the rest of the cluster. The `discovery.zen.no\_master\_block` setting doesn't apply to nodes-based apis (for example cluster stats, node info and node stats apis). Requests to these apis will not be blocked and can run on any available node.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/modules/discovery/zen.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.00411389721557498,
-0.030309248715639114,
-0.048428867012262344,
0.022441359236836433,
0.03707512840628624,
0.021284954622387886,
-0.02434549480676651,
-0.011167029850184917,
-0.046551890671253204,
0.053641095757484436,
-0.041797276586294174,
-0.04054025560617447,
0.05094904825091362,
-0.0009407951729372144,
-0.04354041814804077,
0.005062648095190525,
0.00025846826611086726,
-0.058641090989112854,
0.014711993746459484,
-0.025710925459861755,
-0.034483615309000015,
0.009469354525208473,
0.04329441487789154,
0.0069864303804934025,
-0.11840695142745972,
-0.028253521770238876,
-0.04031563550233841,
0.014939786866307259,
0.058514729142189026,
0.004734497517347336,
0.0543922521173954,
0.01755349338054657,
0.04605065658688545,
-0.01023444626480341,
0.09742181748151779,
0.007822830229997635,
0.00837951060384512,
-0.05478305369615555,
-0.0702296569943428,
-0.05644118785858154,
0.09096279740333557,
0.02290940470993519,
-0.06172950193285942,
-0.09288379549980164,
-0.02357550337910652,
0.011065391823649406,
-0.05143832415342331,
0.07616168260574341,
-0.04087066277861595,
-0.06183943897485733,
0.02594933845102787,
0.016613855957984924,
0.03252296894788742,
0.08107376098632812,
0.0355045422911644,
0.1402793526649475,
0.024441508576273918,
-0.0678953006863594,
-0.033885616809129715,
-0.020080843940377235,
0.009907125495374203,
-0.0033283191733062267,
-0.1024893969297409,
-0.05227367952466011,
0.07461416721343994,
0.05615377426147461,
-0.008941317908465862,
0.0178306233137846,
0.016558164730668068,
0.07527343183755875,
0.09147308766841888,
-0.01703699119389057,
-0.027576789259910583,
-0.030478203669190407,
-0.026181111112236977,
-0.014367055147886276,
0.024519259110093117,
-0.024696562439203262,
0.015262489207088947,
-0.024648796766996384,
-0.08789801597595215,
0.0237935371696949,
0.02800716646015644,
-0.03922281786799431,
0.05114556476473808,
0.01860334351658821,
-0.030272899195551872,
-0.05714331939816475,
0.05513524264097214,
-0.0013841792242601514,
-0.06883835047483444,
0.0944061353802681,
0.02733701467514038,
0.05879906564950943,
0.05026579648256302,
0.06346938014030457,
0.052646711468696594,
0.021203620359301567,
0.06246501952409744,
0.06830190867185593,
-0.0019109953427687287,
-0.05819563940167427,
-0.03432450816035271,
-0.0525820329785347,
-0.005715121515095234,
-0.018156660720705986,
-0.004626983776688576,
0.05385233461856842,
0.010740217752754688,
0.042868729680776596,
0.06075700744986534,
0.019153015688061714,
0.09653802961111069,
-0.002907056361436844,
0.00560888322070241,
0.055312059819698334,
0.06445135176181793,
0.04784783348441124,
-0.05122968927025795,
0.031673531979322433,
-0.011230936273932457,
-0.0870601087808609,
0.02065073512494564,
-0.03143983706831932,
0.052786197513341904,
0.05521658807992935,
-0.1078978031873703,
1.0246244263400471e-32,
0.041143856942653656,
-0.047494076192379,
-0.02460673451423645,
-0.0170134324580431,
-0.07055223733186722,
0.05878407135605812,
-0.05853961035609245,
-0.07661080360412598,
-0.03206619247794151,
-0.058115217834711075,
0.05315650999546051,
0.0011770337587222457,
0.03440529853105545,
-0.09583543986082077,
0.005284746643155813,
-0.13454782962799072,
0.0625806674361229,
0.04376578330993652,
0.004759976640343666,
-0.0489502027630806,
0.006135559640824795,
-0.016541391611099243,
-0.019856063649058342,
-0.05638263374567032,
0.043735746294260025,
0.07678480446338654,
-0.007689132820814848,
-0.01720595732331276,
-0.014773832634091377,
0.023983953520655632,
0.0015760608948767185,
0.025421278551220894,
-0.06609119474887848,
0.020548909902572632,
-0.026401421055197716,
0.07352284342050552,
-0.010127884335815907,
-0.040429312735795975,
-0.13564391434192657,
-0.08867574483156204,
-0.030394533649086952,
-0.04263083636760712,
0.01363563071936369,
0.02077849581837654,
0.032260626554489136,
-0.04230298846960068,
0.00469388160854578,
-0.013153539970517159,
0.046689532697200775,
0.047887999564409256,
-0.05136094242334366,
-0.02845330350100994,
0.06388073414564133,
0.01087909284979105,
-0.04208310693502426,
-0.040412578731775284,
-0.02757422626018524,
-0.06522201001644135,
0.023251470178365707,
-0.004259953740984201,
-0.04609835520386696,
-0.16181066632270813,
-0.05419308319687843,
0.023652663454413414,
0.03326522186398506,
0.054761260747909546,
-0.07433203607797623,
-0.042390432208776474,
0.06481403112411499,
0.011174585670232773,
-0.022050146013498306,
0.025915222242474556,
0.023652156814932823,
0.026622438803315163,
-0.008253400214016438,
-0.1037440374493599,
-0.0070598977617919445,
-0.037139665335416794,
-0.03915352374315262,
0.014832726679742336,
-0.03381628543138504,
0.005202328320592642,
-0.040037091821432114,
0.01137610338628292,
0.06362063437700272,
-0.06853975355625153,
0.0003987751842942089,
0.04452159255743027,
-0.04950493201613426,
0.019655486568808556,
0.029836220666766167,
0.008248329162597656,
0.06489863246679306,
0.08477480709552765,
-0.051621563732624054,
-9.295735857905723e-33,
-0.11588339507579803,
0.014531277120113373,
-0.022878730669617653,
0.025365261361002922,
0.08093645423650742,
-0.03745078667998314,
-0.043030619621276855,
0.021160360425710678,
-0.03179009258747101,
-0.02776414155960083,
-0.011952470056712627,
-0.07244233787059784,
-0.022791337221860886,
0.031613320112228394,
-0.08979464322328568,
0.0007614172645844519,
0.04945998266339302,
-0.06984103471040726,
0.10934973508119583,
0.06949321925640106,
0.029237797483801842,
-0.010225689969956875,
-0.05064357444643974,
0.05117221549153328,
0.014733124524354935,
0.06713391095399857,
-0.024564417079091072,
-0.019350579008460045,
-0.013901591300964355,
-0.008164760656654835,
0.042900778353214264,
-0.02562386728823185,
-0.07835300266742706,
0.07040000706911087,
0.100721575319767,
0.03331006318330765,
0.02567373588681221,
0.0062650106847286224,
-0.04999721795320511,
-0.008628351613879204,
0.0020093454513698816,
0.04664263129234314,
-0.027621375396847725,
0.05208220332860947,
0.0004741735465358943,
0.04794104024767876,
0.07689813524484634,
0.08114107698202133,
-0.13161449134349823,
0.04005396366119385,
-0.04613278806209564,
-0.07131992280483246,
-0.048816531896591187,
0.09187902510166168,
-0.02914983592927456,
0.0038573797792196274,
0.04804026708006859,
0.06097057834267616,
-0.045856501907110214,
0.10547187924385071,
0.0409516878426075,
-0.037291865795850754,
-0.02603713423013687,
0.13202866911888123,
0.060889437794685364,
-0.03614785149693489,
0.0757909044623375,
0.055878620594739914,
0.027690846472978592,
0.09297654777765274,
-0.06738008558750153,
0.08978360146284103,
0.008734200149774551,
-0.03213943541049957,
0.015610599890351295,
-0.039828624576330185,
-0.05602160096168518,
0.006088265683501959,
-0.05257944017648697,
-0.010631725192070007,
-0.08246129751205444,
-0.012032875791192055,
-0.05906974524259567,
-0.0010296847904101014,
-0.00701085664331913,
-0.018108030781149864,
0.08370485156774521,
0.02541339211165905,
-0.02608034573495388,
0.06037227809429169,
-0.056956466287374496,
-0.024475492537021637,
0.04031149297952652,
-0.01334124244749546,
-0.11036177724599838,
-6.410441955040369e-8,
0.02297368086874485,
-0.027285734191536903,
-0.08414538949728012,
-0.05423273518681526,
0.07881194353103638,
0.036588720977306366,
-0.009144042618572712,
-0.10752847045660019,
-0.05340706557035446,
0.02059957943856716,
0.08744461089372635,
-0.0003144287329632789,
0.008623548783361912,
0.005115736275911331,
0.020763274282217026,
-0.06565191596746445,
-0.03596346452832222,
0.0435456819832325,
-0.07733666151762009,
-0.015873590484261513,
-0.004534534644335508,
0.007561171427369118,
-0.04616367071866989,
0.12254171818494797,
-0.032112762331962585,
-0.0309635940939188,
-0.007535470183938742,
0.03535391017794609,
-0.04329944774508476,
-0.04926588758826256,
-0.0827096626162529,
0.022292571142315865,
0.05463137477636337,
0.08790281414985657,
-0.05885038524866104,
0.1171242967247963,
0.014337287284433842,
0.017094481736421585,
0.010347103700041771,
-0.007172208279371262,
-0.008938396349549294,
0.05687819421291351,
0.0076498896814882755,
-0.02240804024040699,
-0.012918542139232159,
-0.017940470948815346,
-0.011148893274366856,
-0.04546269029378891,
0.10972808301448822,
-0.03447183966636658,
-0.018409958109259605,
-0.04310973361134529,
0.041685041040182114,
-0.031453363597393036,
0.03197014331817627,
0.018740881234407425,
-0.004355123266577721,
-0.008648636750876904,
0.09946807473897934,
0.035968855023384094,
-0.02015129290521145,
-0.014112305827438831,
-0.0534156896173954,
-0.028810061514377594
] | 0.103173
|
[[search-aggregations-pipeline]] == Pipeline Aggregations Pipeline aggregations work on the outputs produced from other aggregations rather than from document sets, adding information to the output tree. There are many different types of pipeline aggregation, each computing different information from other aggregations, but these types can be broken down into two families: \_Parent\_:: A family of pipeline aggregations that is provided with the output of its parent aggregation and is able to compute new buckets or new aggregations to add to existing buckets. \_Sibling\_:: Pipeline aggregations that are provided with the output of a sibling aggregation and are able to compute a new aggregation which will be at the same level as the sibling aggregation. Pipeline aggregations can reference the aggregations they need to perform their computation by using the `buckets\_path` parameter to indicate the paths to the required metrics. The syntax for defining these paths can be found in the <> section below. Pipeline aggregations cannot have sub-aggregations but depending on the type it can reference another pipeline in the `buckets\_path` allowing pipeline aggregations to be chained. For example, you can chain together two derivatives to calculate the second derivative (i.e. a derivative of a derivative). NOTE: Because pipeline aggregations only add to the output, when chaining pipeline aggregations the output of each pipeline aggregation will be included in the final output. [[buckets-path-syntax]] [float] === `buckets\_path` Syntax Most pipeline aggregations require another aggregation as their input. The input aggregation is defined via the `buckets\_path` parameter, which follows a specific format: // https://en.wikipedia.org/wiki/Extended\_Backus%E2%80%93Naur\_Form [source,ebnf] -------------------------------------------------- AGG\_SEPARATOR = '>' ; METRIC\_SEPARATOR = '.' ; AGG\_NAME = ; METRIC = ; PATH = [ , ]\* [ , ] ; -------------------------------------------------- For example, the path `"my\_bucket>my\_stats.avg"` will path to the `avg` value in the `"my\_stats"` metric, which is contained in the `"my\_bucket"` bucket aggregation. Paths are relative from the position of the pipeline aggregation; they are not absolute paths, and the path cannot go back "up" the aggregation tree. For example, this moving average is embedded inside a date\_histogram and refers to a "sibling" metric `"the\_sum"`: [source,js] -------------------------------------------------- POST /\_search { "aggs": { "my\_date\_histo":{ "date\_histogram":{ "field":"timestamp", "interval":"day" }, "aggs":{ "the\_sum":{ "sum":{ "field": "lemmings" } <1> }, "the\_movavg":{ "moving\_avg":{ "buckets\_path": "the\_sum" } <2> } } } } } -------------------------------------------------- // CONSOLE <1> The metric is called `"the\_sum"` <2> The `buckets\_path` refers to the metric via a relative path `"the\_sum"` `buckets\_path` is also used for Sibling pipeline aggregations, where the aggregation is "next" to a series of buckets instead of embedded "inside" them. For example, the `max\_bucket` aggregation uses the `buckets\_path` to specify a metric embedded inside a sibling aggregation: [source,js] -------------------------------------------------- POST /\_search { "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } } } }, "max\_monthly\_sales": { "max\_bucket": { "buckets\_path": "sales\_per\_month>sales" <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `buckets\_path` instructs this max\_bucket aggregation that we want the maximum value of the `sales` aggregation in the `sales\_per\_month` date histogram. [float] === Special Paths Instead of pathing to a metric, `buckets\_path` can use a special `"\_count"` path. This instructs the pipeline aggregation to use the document count as its input. For example, a moving average can be calculated on the document count of each bucket, instead of a specific metric: [source,js] -------------------------------------------------- POST /\_search { "aggs": { "my\_date\_histo": { "date\_histogram": { "field":"timestamp", "interval":"day" }, "aggs": { "the\_movavg": { "moving\_avg": { "buckets\_path": "\_count" } <1> } } } } } -------------------------------------------------- // CONSOLE <1> By using `\_count` instead of a metric name, we can calculate the moving
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.052708178758621216,
-0.021257489919662476,
0.03972255066037178,
0.047850701957941055,
-0.05803442373871803,
-0.026326507329940796,
-0.06119988113641739,
0.02728833071887493,
0.06599851697683334,
-0.05751394107937813,
-0.05976339429616928,
-0.03562818840146065,
0.04482078179717064,
-0.02440022863447666,
-0.04610360413789749,
0.050334058701992035,
-0.050489868968725204,
0.0749121829867363,
-0.10924607515335083,
-0.12345954030752182,
0.03914480656385422,
0.0154775595292449,
-0.02323947288095951,
-0.03728632628917694,
0.000005455693099065684,
0.039002399891614914,
-0.12481305003166199,
-0.0379648357629776,
0.02892780862748623,
0.011497998610138893,
0.018364330753684044,
0.04204756021499634,
0.030637918040156364,
0.05205336958169937,
0.010557074099779129,
0.029750488698482513,
0.0524740107357502,
-0.025178294628858566,
0.00925604347139597,
-0.03732352703809738,
0.06010653078556061,
-0.0013517902698367834,
-0.0011041435645893216,
-0.07503769546747208,
0.0064484295435249805,
-0.034471623599529266,
-0.06617441028356552,
-0.056704532355070114,
-0.09238958358764648,
0.029009737074375153,
-0.02555144391953945,
-0.04286492243409157,
-0.05771110951900482,
0.06749331951141357,
0.04017068073153496,
0.13379690051078796,
-0.024441445246338844,
-0.06031298637390137,
-0.026928463950753212,
-0.044087544083595276,
-0.06042267382144928,
-0.051288049668073654,
-0.019807448610663414,
-0.02119651809334755,
0.024729745462536812,
0.0033062268048524857,
0.025117479264736176,
0.016866842284798622,
0.03554384782910347,
0.05452544614672661,
-0.00998547300696373,
0.0373825877904892,
-0.007653352804481983,
-0.053936492651700974,
0.07155169546604156,
0.07773711532354355,
0.05358076095581055,
0.03925618901848793,
0.026965420693159103,
-0.06907593458890915,
-0.08802404999732971,
-0.005602280143648386,
0.01551068015396595,
0.0063031259924173355,
-0.015408611856400967,
-0.03953048586845398,
-0.010461065918207169,
-0.07242371141910553,
0.0533604770898819,
-0.014530166052281857,
-0.080511175096035,
-0.0844929963350296,
0.03086666390299797,
-0.013214082457125187,
0.021092940121889114,
0.007351506967097521,
0.01652483642101288,
-0.044183503836393356,
0.16147756576538086,
-0.005386563949286938,
-0.04778105020523071,
0.0619937963783741,
0.08286989480257034,
-0.11052453517913818,
-0.07304885238409042,
0.026949485763907433,
-0.1040806919336319,
0.03584541007876396,
-0.0158756822347641,
-0.046021342277526855,
-0.0021890513598918915,
-0.08574219793081284,
0.005691213998943567,
0.0015615805750712752,
0.001828629756346345,
-0.0006953345728106797,
0.02268187142908573,
-0.0623023584485054,
0.017567599192261696,
0.00189192162360996,
0.02475093863904476,
-0.04281997308135033,
0.01972324028611183,
-0.06288708001375198,
0.04800678789615631,
0.0564754493534565,
-0.07005439698696136,
4.938691843502019e-33,
0.01880401186645031,
-0.1050814837217331,
0.03306962922215462,
0.0006544336210936308,
0.03295303136110306,
0.0863066241145134,
0.014901815913617611,
0.033215612173080444,
-0.12356021255254745,
0.054959945380687714,
-0.0565459243953228,
0.13064312934875488,
-0.09688353538513184,
0.002908367430791259,
-0.0037864106707274914,
0.01316160149872303,
0.019178280606865883,
0.03567016124725342,
-0.004126447718590498,
-0.01275941077619791,
0.021916590631008148,
0.04531203210353851,
-0.010631540790200233,
0.030093124136328697,
0.04366639629006386,
-0.030015243217349052,
0.0035400616470724344,
-0.06327790021896362,
-0.06713880598545074,
-0.00356470444239676,
-0.027415109798312187,
0.013541207648813725,
0.01714951917529106,
-0.0561043806374073,
-0.009392050094902515,
0.01349998265504837,
0.0311513040214777,
-0.023876836523413658,
-0.026275979354977608,
-0.021214274689555168,
0.029344968497753143,
-0.014717587269842625,
0.0061555770225822926,
-0.07909506559371948,
-0.07079055160284042,
0.026236029341816902,
-0.027532722800970078,
-0.005406127776950598,
0.06574073433876038,
-0.004171626642346382,
-0.010775835253298283,
0.029334818944334984,
0.07223373651504517,
0.048925358802080154,
0.03483051061630249,
0.014208484441041946,
-0.03325881436467171,
0.07306431233882904,
0.031090958043932915,
0.0036161530297249556,
-0.0061667305417358875,
-0.0011923214187845588,
-0.0124422088265419,
0.05640065670013428,
0.0067406450398266315,
0.03191547095775604,
0.046086039394140244,
0.1303928792476654,
0.11799637973308563,
0.08557114750146866,
-0.015560374595224857,
0.10022635012865067,
-0.04548770934343338,
0.026151558384299278,
0.0916997641324997,
-0.05504667013883591,
0.05628800392150879,
-0.037975262850522995,
-0.009883455000817776,
0.04512400180101395,
-0.08419947326183319,
0.030294714495539665,
0.07396818697452545,
0.0009025713661685586,
0.0024083126336336136,
0.04404157027602196,
-0.021105708554387093,
0.014655287377536297,
-0.06375577300786972,
-0.07940472662448883,
-0.08163831382989883,
0.012298926711082458,
-0.09407784044742584,
0.00690615875646472,
0.03830917924642563,
-8.679633554700838e-33,
0.04966682940721512,
0.03832197189331055,
-0.01708165369927883,
0.023142002522945404,
0.019724886864423752,
-0.03773845359683037,
0.04049837589263916,
-0.10876161605119705,
0.058410923928022385,
-0.023380780592560768,
-0.08663997054100037,
0.060540638864040375,
0.030713632702827454,
-0.05964569002389908,
-0.004848136566579342,
-0.016186576336622238,
-0.10493878275156021,
-0.1347285360097885,
0.04906389117240906,
0.04845160245895386,
-0.017566299065947533,
0.021133730188012123,
0.010702002793550491,
0.11841888725757599,
0.00892692618072033,
-0.06456492096185684,
-0.04268695041537285,
-0.02026842162013054,
-0.01523564849048853,
0.025484051555395126,
0.038793906569480896,
-0.0378476120531559,
0.0004976521013304591,
-0.05723026394844055,
-0.047502029687166214,
-0.08336843550205231,
0.0005727696698158979,
-0.03712982311844826,
0.010896092280745506,
-0.001296810107305646,
-0.00272333063185215,
0.013866502791643143,
0.010098487138748169,
-0.025224119424819946,
0.032479945570230484,
0.03147866949439049,
0.07575634866952896,
0.023259401321411133,
-0.026132673025131226,
-0.06442339718341827,
0.011012429371476173,
0.02517874725162983,
-0.08310358226299286,
0.10016325861215591,
-0.038442641496658325,
0.013129006139934063,
0.025829879567027092,
-0.016805650666356087,
-0.06079670786857605,
-0.027326490730047226,
-0.028344932943582535,
-0.024335844442248344,
-0.025193952023983,
0.004860845394432545,
-0.07403040677309036,
-0.022968554869294167,
-0.04206887260079384,
-0.11642640829086304,
-0.01718779467046261,
0.016924789175391197,
-0.015209131874144077,
-0.04677900671958923,
0.06247179955244064,
0.04348478466272354,
0.00943322665989399,
0.008795483969151974,
-0.0191249568015337,
-0.04722371697425842,
0.03571448475122452,
0.004522846546024084,
-0.11908858269453049,
0.054064974188804626,
0.06061165779829025,
0.09204510599374771,
0.024671237915754318,
-0.05009730905294418,
0.06072722747921944,
0.08780469000339508,
0.029917985200881958,
0.011295451782643795,
-0.023579420521855354,
-0.023867907002568245,
-0.06966422498226166,
-0.01655489020049572,
-0.038690946996212006,
-5.8955738069244035e-8,
-0.07473858445882797,
0.0038899569772183895,
-0.07691968977451324,
0.040748197585344315,
-0.0016692066565155983,
-0.02166793867945671,
0.05429475009441376,
0.17262177169322968,
-0.06493327021598816,
-0.005370030645281076,
0.030769238248467445,
-0.0009067453793250024,
-0.1002126932144165,
0.012216159142553806,
0.026405254378914833,
0.010635539889335632,
0.06046724319458008,
0.010542504489421844,
-0.03049442172050476,
-0.06632255762815475,
-0.038726069033145905,
-0.005511567462235689,
0.036796245723962784,
0.04122575744986534,
-0.05420447885990143,
-0.03569202125072479,
0.013547717593610287,
-0.0010533167514950037,
-0.016961991786956787,
-0.0630706176161766,
0.05810001119971275,
-0.001111433608457446,
-0.019994497299194336,
0.04193814843893051,
0.08537813276052475,
0.022290678694844246,
-0.013715818524360657,
0.0356949158012867,
-0.041830021888017654,
0.048333145678043365,
0.042603470385074615,
0.005098721478134394,
-0.02249034494161606,
0.02057061530649662,
-0.04008368402719498,
0.014048024080693722,
-0.08418052643537521,
0.06395842880010605,
0.024752981960773468,
0.04124835878610611,
0.028970375657081604,
-0.049447786062955856,
-0.07386135309934616,
0.015361632220447063,
0.030822906643152237,
-0.03531534969806671,
0.022206323221325874,
-0.07353441417217255,
0.0647553876042366,
0.02068076655268669,
0.06852275878190994,
-0.07568079233169556,
0.04657736048102379,
-0.09045445173978806
] | 0.037431
|
of a specific metric: [source,js] -------------------------------------------------- POST /\_search { "aggs": { "my\_date\_histo": { "date\_histogram": { "field":"timestamp", "interval":"day" }, "aggs": { "the\_movavg": { "moving\_avg": { "buckets\_path": "\_count" } <1> } } } } } -------------------------------------------------- // CONSOLE <1> By using `\_count` instead of a metric name, we can calculate the moving average of document counts in the histogram The `buckets\_path` can also use `"\_bucket\_count"` and path to a multi-bucket aggregation to use the number of buckets returned by that aggregation in the pipeline aggregation instead of a metric. for example a `bucket\_selector` can be used here to filter out buckets which contain no buckets for an inner terms aggregation: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs": { "histo": { "date\_histogram": { "field": "date", "interval": "day" }, "aggs": { "categories": { "terms": { "field": "category" } }, "min\_bucket\_selector": { "bucket\_selector": { "buckets\_path": { "count": "categories.\_bucket\_count" <1> }, "script": { "source": "params.count != 0" } } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> By using `\_bucket\_count` instead of a metric name, we can filter out `histo` buckets where they contain no buckets for the `categories` aggregation [[dots-in-agg-names]] [float] === Dealing with dots in agg names An alternate syntax is supported to cope with aggregations or metrics which have dots in the name, such as the ++99.9++th <>. This metric may be referred to as: [source,js] --------------- "buckets\_path": "my\_percentile[99.9]" --------------- // NOTCONSOLE [[gap-policy]] [float] === Dealing with gaps in the data Data in the real world is often noisy and sometimes contains \*gaps\* -- places where data simply doesn't exist. This can occur for a variety of reasons, the most common being: \* Documents falling into a bucket do not contain a required field \* There are no documents matching the query for one or more buckets \* The metric being calculated is unable to generate a value, likely because another dependent bucket is missing a value. Some pipeline aggregations have specific requirements that must be met (e.g. a derivative cannot calculate a metric for the first value because there is no previous value, HoltWinters moving average need "warmup" data to begin calculating, etc) Gap policies are a mechanism to inform the pipeline aggregation about the desired behavior when "gappy" or missing data is encountered. All pipeline aggregations accept the `gap\_policy` parameter. There are currently two gap policies to choose from: \_skip\_:: This option treats missing data as if the bucket does not exist. It will skip the bucket and continue calculating using the next available value. \_insert\_zeros\_:: This option will replace missing values with a zero (`0`) and pipeline aggregation computation will proceed as normal. include::pipeline/avg-bucket-aggregation.asciidoc[] include::pipeline/derivative-aggregation.asciidoc[] include::pipeline/max-bucket-aggregation.asciidoc[] include::pipeline/min-bucket-aggregation.asciidoc[] include::pipeline/sum-bucket-aggregation.asciidoc[] include::pipeline/stats-bucket-aggregation.asciidoc[] include::pipeline/extended-stats-bucket-aggregation.asciidoc[] include::pipeline/percentiles-bucket-aggregation.asciidoc[] include::pipeline/movavg-aggregation.asciidoc[] include::pipeline/cumulative-sum-aggregation.asciidoc[] include::pipeline/bucket-script-aggregation.asciidoc[] include::pipeline/bucket-selector-aggregation.asciidoc[] include::pipeline/bucket-sort-aggregation.asciidoc[] include::pipeline/serial-diff-aggregation.asciidoc[]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.008762672543525696,
0.001811985275708139,
0.014470215886831284,
0.06925699859857559,
-0.04368012398481369,
0.031955938786268234,
0.008491628803312778,
0.043216459453105927,
0.07813213765621185,
-0.04138598591089249,
-0.02955402061343193,
-0.05679063871502876,
0.02603103779256344,
-0.00413188710808754,
-0.08207593113183975,
-0.008348432369530201,
-0.05660371854901314,
-0.017448386177420616,
-0.03605857118964195,
-0.10617338120937347,
0.012238290160894394,
0.026390569284558296,
0.0553390309214592,
-0.06983811408281326,
0.04469256475567818,
0.05137215182185173,
-0.10182088613510132,
-0.013793676160275936,
0.02379593439400196,
0.03770550712943077,
-0.0497116856276989,
-0.01941632106900215,
0.03651303052902222,
0.08508460968732834,
-0.04292575269937515,
0.004290047101676464,
-0.009542776271700859,
-0.010431589558720589,
0.006443869788199663,
-0.03407151997089386,
0.0019517341861501336,
0.020694004371762276,
-0.005354210734367371,
-0.04630766436457634,
0.0020553709473460913,
-0.01602405495941639,
-0.09002143889665604,
-0.041669368743896484,
-0.04307728260755539,
0.09384487569332123,
-0.09882286936044693,
-0.02075907215476036,
-0.04747004806995392,
-0.011455077677965164,
0.01722833886742592,
0.08647491782903671,
-0.013316713273525238,
-0.04212575778365135,
0.055032286792993546,
-0.0903087928891182,
-0.021788666024804115,
-0.06349442899227142,
-0.016245903447270393,
-0.03307479992508888,
0.02127690240740776,
-0.038528166711330414,
0.03210991993546486,
0.03359752148389816,
-0.03266749158501625,
0.07697734981775284,
0.03231044113636017,
0.03822030872106552,
0.02567625790834427,
-0.034705113619565964,
-0.02605261467397213,
-0.007168626878410578,
-0.06109427660703659,
0.07758115977048874,
0.04351959004998207,
-0.0648082047700882,
-0.015680396929383278,
-0.07276561856269836,
-0.00041584213613532484,
0.028477462008595467,
-0.0006950024981051683,
-0.0246952585875988,
0.02988775074481964,
-0.020231055095791817,
0.06402523815631866,
-0.05278003588318825,
-0.0433427095413208,
-0.05674855038523674,
-0.0436616949737072,
-0.048302121460437775,
-0.0009770269971340895,
0.0317026749253273,
-0.027129974216222763,
0.04745340719819069,
0.12690426409244537,
0.03441008925437927,
0.07139743864536285,
0.047850072383880615,
-0.05688370019197464,
0.003999737557023764,
0.04004337638616562,
0.04639334976673126,
-0.03916511312127113,
0.04238232597708702,
-0.05795292928814888,
0.06149977818131447,
0.03054705820977688,
0.05329127609729767,
0.013452163897454739,
-0.029154283925890923,
-0.01799355074763298,
0.03765920549631119,
0.005283970385789871,
-0.007353855762630701,
0.016384568065404892,
0.08457322418689728,
0.08334945887327194,
0.025177067145705223,
0.007385267410427332,
-0.019429942592978477,
-0.0182600449770689,
0.009289273992180824,
0.08365289866924286,
-1.3054278943969175e-33,
0.01998644508421421,
-0.13048559427261353,
0.05628165602684021,
-0.06749911606311798,
0.005893400404602289,
0.022364549338817596,
-0.05304555967450142,
0.12395083904266357,
0.038598205894231796,
-0.033013470470905304,
-0.05798608437180519,
0.10078442096710205,
-0.005424328614026308,
-0.08738838136196136,
-0.008487834595143795,
0.007397934328764677,
-0.007701747119426727,
-0.009759851731359959,
0.03309616446495056,
-0.05223441869020462,
0.03937561437487602,
-0.08892270922660828,
0.019456498324871063,
0.05077885091304779,
0.043261412531137466,
-0.02655130811035633,
0.005289940163493156,
-0.036551788449287415,
-0.09129764139652252,
-0.0036518280394375324,
0.017776459455490112,
0.015223735943436623,
-0.05320800095796585,
-0.020685911178588867,
0.03379426151514053,
-0.038285695016384125,
-0.07453183084726334,
0.036873709410429,
0.016611499711871147,
0.0003658295318018645,
0.039885688573122025,
-0.04068697243928909,
-0.06445390731096268,
-0.11149522662162781,
-0.1683843433856964,
0.034768495708703995,
0.02002285234630108,
-0.016622250899672508,
0.03440309688448906,
0.05086121708154678,
-0.012472775764763355,
-0.0030916344840079546,
-0.022810783237218857,
-0.042247336357831955,
0.03627289459109306,
0.033993981778621674,
0.030868133530020714,
0.06938590109348297,
0.0021247181575745344,
0.0322347916662693,
-0.0054352255538105965,
0.07236603647470474,
0.10855530947446823,
0.006763669196516275,
0.007913132198154926,
-0.003833927446976304,
-0.008423915132880211,
0.15108099579811096,
0.017938654869794846,
0.0964004322886467,
0.08104949444532394,
0.0665808692574501,
-0.03747429698705673,
0.010353735648095608,
0.05412210524082184,
-0.09404785186052322,
0.009980014525353909,
-0.016960984095931053,
-0.08727331459522247,
0.0017498674569651484,
0.0016906586242839694,
-0.05868896096944809,
-0.0006565249641425908,
-0.010168829932808876,
0.01195273082703352,
0.08535607904195786,
0.02173815481364727,
-0.004185930825769901,
-0.13491585850715637,
-0.08232835680246353,
-0.01181845460087061,
-0.01439596340060234,
-0.10359594970941544,
-0.05390867218375206,
-0.04490652307868004,
-2.9166615625152147e-33,
0.013514072634279728,
0.05093194544315338,
0.07378451526165009,
0.05407016724348068,
0.029915040358901024,
-0.01911317929625511,
0.04523441940546036,
0.09499722719192505,
0.04086349904537201,
0.06994276493787766,
-0.09295527637004852,
0.011610079556703568,
0.0072336141020059586,
-0.03422912582755089,
0.000917671772185713,
0.03872055932879448,
-0.06834874302148819,
-0.10348404198884964,
-0.05334813520312309,
0.0009841092396527529,
-0.047671958804130554,
0.019912829622626305,
-0.02609601989388466,
0.06764498353004456,
-0.022137021645903587,
-0.03850472345948219,
0.030294809490442276,
-0.04336084797978401,
-0.07086583971977234,
-0.0276858638972044,
0.03137877583503723,
-0.020010769367218018,
-0.05914294719696045,
0.0024946839548647404,
-0.05062644183635712,
-0.09069432318210602,
0.07736238837242126,
0.007511565461754799,
-0.037242814898490906,
0.08558777719736099,
0.00264265900477767,
0.041330140084028244,
-0.04233641177415848,
-0.03819490596652031,
0.03336043283343315,
0.10429346561431885,
-0.017115453258156776,
0.04982708767056465,
0.0046019116416573524,
-0.0897107869386673,
0.0022033837158232927,
0.03584820404648781,
-0.0995570495724678,
0.09909422695636749,
-0.030619988217949867,
0.036076657474040985,
-0.025711840018630028,
-0.09549610316753387,
-0.08687026798725128,
0.010959317907691002,
0.0007515993202105165,
-0.08630301803350449,
0.0001947802520589903,
-0.03278876096010208,
0.03939167410135269,
-0.03725285083055496,
0.022588755935430527,
-0.07930923253297806,
-0.07493835687637329,
0.017851384356617928,
0.01695163920521736,
-0.03985501080751419,
0.015975140035152435,
-0.027471520006656647,
-0.0030615143477916718,
0.0601959265768528,
0.10607995092868805,
-0.02867787331342697,
-0.008462355472147465,
-0.04724324494600296,
-0.01133536733686924,
-0.022183135151863098,
0.0496215857565403,
0.047064159065485,
-0.09153232723474503,
0.021833056584000587,
-0.02093130722641945,
0.029978595674037933,
-0.056198958307504654,
0.09172804653644562,
-0.08400673419237137,
0.002872702432796359,
-0.04849644750356674,
-0.015751168131828308,
-0.014957740902900696,
-4.964191546719121e-8,
-0.07257308065891266,
-0.011576150543987751,
-0.038118936121463776,
0.055615656077861786,
0.023900657892227173,
0.07273546606302261,
0.00403632503002882,
0.1087268516421318,
0.008293300867080688,
-0.0350835882127285,
0.07338442653417587,
-0.051833949983119965,
-0.05235687270760536,
0.06906722486019135,
-0.10239533334970474,
-0.05661306530237198,
-0.008399457670748234,
0.017724856734275818,
0.004850173369050026,
-0.05986155942082405,
0.027646619826555252,
-0.00902088824659586,
0.09186646342277527,
0.006476254668086767,
-0.02670801430940628,
-0.01973472535610199,
-0.027876611799001694,
0.05322635918855667,
0.04538394510746002,
-0.09119895845651627,
-0.01776845194399357,
0.013353724963963032,
0.005331285763531923,
0.005398285575211048,
-0.03136621043086052,
-0.06922633200883865,
-0.02155095338821411,
0.0017352491850033402,
-0.01692422293126583,
0.08576910197734833,
0.040350791066884995,
0.01612888276576996,
-0.05591394007205963,
0.06078753247857094,
0.02593839541077614,
0.029755152761936188,
0.004481852985918522,
0.005960405804216862,
0.028557388111948967,
-0.016106316819787025,
0.05824768543243408,
-0.09590362757444382,
-0.022379981353878975,
0.0032854191958904266,
0.007342510856688023,
-0.06779316067695618,
0.05997489020228386,
-0.04566819593310356,
0.04355395585298538,
0.03463653102517128,
-0.003199454862624407,
-0.07305647432804108,
-0.07085877656936646,
-0.01874551549553871
] | 0.040487
|
[[search-aggregations-metrics]] == Metrics Aggregations The aggregations in this family compute metrics based on values extracted in one way or another from the documents that are being aggregated. The values are typically extracted from the fields of the document (using the field data), but can also be generated using scripts. Numeric metrics aggregations are a special type of metrics aggregation which output numeric values. Some aggregations output a single numeric metric (e.g. `avg`) and are called `single-value numeric metrics aggregation`, others generate multiple metrics (e.g. `stats`) and are called `multi-value numeric metrics aggregation`. The distinction between single-value and multi-value numeric metrics aggregations plays a role when these aggregations serve as direct sub-aggregations of some bucket aggregations (some bucket aggregations enable you to sort the returned buckets based on the numeric metrics in each bucket). include::metrics/avg-aggregation.asciidoc[] include::metrics/cardinality-aggregation.asciidoc[] include::metrics/extendedstats-aggregation.asciidoc[] include::metrics/geobounds-aggregation.asciidoc[] include::metrics/geocentroid-aggregation.asciidoc[] include::metrics/max-aggregation.asciidoc[] include::metrics/min-aggregation.asciidoc[] include::metrics/percentile-aggregation.asciidoc[] include::metrics/percentile-rank-aggregation.asciidoc[] include::metrics/scripted-metric-aggregation.asciidoc[] include::metrics/stats-aggregation.asciidoc[] include::metrics/sum-aggregation.asciidoc[] include::metrics/tophits-aggregation.asciidoc[] include::metrics/valuecount-aggregation.asciidoc[]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.030361559242010117,
-0.02368297427892685,
-0.09404699504375458,
0.041580718010663986,
-0.03835370019078255,
-0.005205116700381041,
0.02179928869009018,
0.03259969875216484,
0.13071149587631226,
-0.06316686421632767,
0.005381138529628515,
-0.0713004544377327,
0.0358881950378418,
-0.0069529288448393345,
-0.023823752999305725,
-0.03420567885041237,
-0.016114680096507072,
-0.011765850707888603,
-0.06338346749544144,
-0.0820087268948555,
0.04957397282123566,
0.05879531055688858,
-0.005039962474256754,
0.018539559096097946,
0.011291985400021076,
0.005181617569178343,
-0.142658993601799,
0.027000436559319496,
-0.021234950050711632,
0.00029733634437434375,
0.0007241375860758126,
0.10967680811882019,
0.08498714864253998,
0.06657988578081131,
-0.03977826237678528,
0.03815411031246185,
0.024347253143787384,
0.006285279523581266,
-0.05765916779637337,
-0.023923754692077637,
-0.037119414657354355,
-0.007744002155959606,
0.023960117250680923,
0.006229002960026264,
-0.061354488134384155,
0.014655466191470623,
-0.11465290933847427,
-0.015816105529665947,
-0.008566971868276596,
0.018680449575185776,
-0.02599017322063446,
0.06760833412408829,
-0.050335291773080826,
0.08821180462837219,
0.08984601497650146,
0.07770760357379913,
-0.09982867538928986,
-0.06193562597036362,
-0.03181682899594307,
-0.0910799503326416,
-0.07538636028766632,
-0.011070397682487965,
-0.03412961959838867,
0.0038191936910152435,
0.026884736493229866,
-0.03132306784391403,
-0.01506507396697998,
-0.013566061854362488,
-0.02958068996667862,
0.056411948055028915,
-0.005704870913177729,
-0.04404447227716446,
-0.002362411469221115,
0.05341367796063423,
0.005025713238865137,
0.1021747812628746,
-0.0029488285072147846,
0.0016883504576981068,
0.006254590582102537,
-0.04176357388496399,
-0.0594463050365448,
0.006893874611705542,
0.03436028212308884,
0.002355089643970132,
0.0639096349477768,
-0.032067589461803436,
0.06643324345350266,
-0.041179198771715164,
0.08170855045318604,
0.00685164425522089,
-0.029797635972499847,
-0.01332599762827158,
0.0225036833435297,
-0.0014998078113421798,
0.03126867860555649,
-0.0017813434824347496,
-0.004282190464437008,
0.008159982040524483,
0.07944632321596146,
-0.009200194850564003,
0.0021282753441482782,
0.05917041003704071,
0.036434344947338104,
-0.03910866007208824,
0.024689998477697372,
-0.015511480160057545,
-0.011669039726257324,
0.009992650710046291,
0.009374999441206455,
-0.022849297150969505,
-0.002693664049729705,
-0.06981271505355835,
-0.002026570262387395,
-0.002306966809555888,
0.013428673148155212,
0.04354320093989372,
-0.008835142478346825,
-0.0012303792173042893,
0.03236568346619606,
0.028273316100239754,
0.0005453637568280101,
-0.04224524646997452,
0.0526319220662117,
-0.0013412021799013019,
0.01727541908621788,
0.07024788856506348,
0.007270964328199625,
2.951880842633789e-33,
-0.0018115396378561854,
-0.07359769195318222,
0.007668601348996162,
-0.022075694054365158,
-0.05821865051984787,
0.06509742140769958,
-0.07148347049951553,
0.08302973210811615,
-0.04228948801755905,
0.032162752002477646,
-0.021654365584254265,
0.1831960529088974,
-0.00667807599529624,
0.09067365527153015,
0.08006270229816437,
0.04005886986851692,
0.0027350541204214096,
0.014791171997785568,
0.03379553183913231,
-0.03707132115960121,
0.03748549148440361,
0.02135123312473297,
0.01378166489303112,
0.11302155256271362,
0.06181938946247101,
0.031011147424578667,
-0.017193786799907684,
-0.03956735506653786,
-0.08823980391025543,
0.017797483131289482,
-0.044005196541547775,
0.0618809349834919,
-0.002630037721246481,
-0.05765560269355774,
0.06816915422677994,
-0.003256018040701747,
-0.02800084836781025,
0.02866998501121998,
-0.05150340497493744,
-0.008712522685527802,
-0.05344237759709358,
-0.03500819206237793,
-0.07473558187484741,
-0.14210264384746552,
-0.08834856748580933,
0.012147135101258755,
-0.05375328287482262,
0.01296103186905384,
0.07067316770553589,
-0.033476702868938446,
-0.004974783398211002,
-0.0010425334330648184,
0.09570568799972534,
0.02188066765666008,
-0.026117980480194092,
0.034851983189582825,
0.04259500280022621,
0.035723213106393814,
-0.08220477402210236,
-0.0471712090075016,
-0.06957457214593887,
0.007687492296099663,
0.01876889541745186,
-0.05023518577218056,
-0.0032379666808992624,
0.011389226652681828,
0.02574753947556019,
0.12577804923057556,
0.08980284631252289,
0.09535732120275497,
0.016400359570980072,
0.046397123485803604,
-0.032444439828395844,
0.03546895086765289,
-0.009250215254724026,
-0.02042458951473236,
0.10934171825647354,
-0.053953468799591064,
-0.019774023443460464,
0.04814950004220009,
-0.07957559823989868,
0.04148878529667854,
0.03457672521471977,
-0.07384978979825974,
-0.012521027587354183,
0.05589228868484497,
0.04638170078396797,
0.01668403670191765,
-0.09705908596515656,
-0.10869100689888,
-0.04028519243001938,
0.05120837688446045,
-0.09522008895874023,
-0.036709174513816833,
-0.10746558010578156,
-6.459220234913541e-33,
-0.021823080256581306,
0.017635516822338104,
-0.05332472175359726,
0.043323829770088196,
0.020124517381191254,
-0.017170758917927742,
0.055154211819171906,
-0.02364775352180004,
0.043039023876190186,
-0.06971262395381927,
-0.03766181692481041,
-0.01333933137357235,
0.02283165417611599,
-0.04184696823358536,
0.01794261671602726,
0.015183341689407825,
-0.1094408705830574,
-0.09716850519180298,
-0.026699572801589966,
0.07205569744110107,
-0.03714083880186081,
0.004691935610026121,
0.02667204476892948,
0.09655004739761353,
-0.0018519734730944037,
-0.029875867068767548,
0.022234026342630386,
-0.06385381519794464,
-0.0373530350625515,
-0.03200048580765724,
0.0752498060464859,
-0.042574916034936905,
0.004481329116970301,
-0.014892718754708767,
-0.07150521874427795,
-0.07600061595439911,
0.06606536358594894,
-0.05395662039518356,
-0.053385600447654724,
0.016526399180293083,
-0.009724527597427368,
0.03454096242785454,
-0.008511551655828953,
0.008649085648357868,
0.0464605875313282,
0.04402611404657364,
0.00634822016581893,
0.0034352175425738096,
-0.056509535759687424,
-0.1220899224281311,
0.044481709599494934,
-0.014182939194142818,
-0.03775983303785324,
0.09126678109169006,
-0.04483485221862793,
-0.02624717727303505,
-0.008384855464100838,
0.007333496119827032,
-0.07503318041563034,
-0.01452222652733326,
0.0397537499666214,
-0.0058667599223554134,
-0.017554471269249916,
0.034021273255348206,
-0.034895267337560654,
-0.0057428330183029175,
0.0019856567960232496,
-0.1324682980775833,
-0.10130691528320312,
0.030649060383439064,
0.03276984766125679,
-0.004938953556120396,
0.012612973339855671,
0.022526085376739502,
-0.07629101723432541,
0.03284921869635582,
0.018727784976363182,
-0.04323882982134819,
-0.0006728949374519289,
-0.006559690460562706,
-0.04651685059070587,
0.003074879990890622,
0.06588707119226456,
0.06984210014343262,
-0.07023651897907257,
-0.0635642483830452,
0.06529507786035538,
0.12320886552333832,
0.016883743926882744,
0.05513443052768707,
-0.03047487512230873,
0.06335216760635376,
-0.07505837082862854,
0.04247735068202019,
-0.028753599151968956,
-4.9654399703058516e-8,
0.022193802520632744,
-0.03446396067738533,
-0.0516505129635334,
0.011336584575474262,
-0.035032715648412704,
0.021198639646172523,
0.018673360347747803,
0.07384283095598221,
-0.011580292135477066,
-0.024227706715464592,
0.03692532703280449,
-0.0545019805431366,
-0.14862185716629028,
0.02592996507883072,
0.025191891938447952,
-0.03851103410124779,
0.0039528729394078255,
0.029276717454195023,
-0.017425881698727608,
-0.027477413415908813,
-0.01145373284816742,
0.052322205156087875,
-0.014994191005825996,
-0.06707242876291275,
-0.012430975213646889,
-0.010441641323268414,
-0.03990623354911804,
0.04848460853099823,
-0.012703911401331425,
-0.1147867813706398,
0.07202179729938507,
0.002520828740671277,
0.07440550625324249,
-0.05532997101545334,
0.011706718243658543,
0.05950956046581268,
-0.0016080121276900172,
0.0309140682220459,
-0.0019037360325455666,
0.04770824685692787,
-0.00646714074537158,
0.04152499884366989,
-0.016829004511237144,
0.0209216121584177,
-0.037641316652297974,
0.002792124869301915,
-0.06651098281145096,
0.10922867804765701,
0.03369202837347984,
0.01735949143767357,
0.009895908646285534,
-0.050152234733104706,
-0.026637684553861618,
0.03951488807797432,
0.0012453498784452677,
-0.06003724783658981,
0.005070040468126535,
-0.04394374415278435,
0.08958782255649567,
-0.024331673979759216,
0.049868516623973846,
-0.12748153507709503,
-0.035589199513196945,
-0.01466833334416151
] | 0.167676
|
[[search-aggregations-bucket]] == Bucket Aggregations Bucket aggregations don't calculate metrics over fields like the metrics aggregations do, but instead, they create buckets of documents. Each bucket is associated with a criterion (depending on the aggregation type) which determines whether or not a document in the current context "falls" into it. In other words, the buckets effectively define document sets. In addition to the buckets themselves, the `bucket` aggregations also compute and return the number of documents that "fell into" each bucket. Bucket aggregations, as opposed to `metrics` aggregations, can hold sub-aggregations. These sub-aggregations will be aggregated for the buckets created by their "parent" bucket aggregation. There are different bucket aggregators, each with a different "bucketing" strategy. Some define a single bucket, some define fixed number of multiple buckets, and others dynamically create the buckets during the aggregation process. NOTE: The maximum number of buckets allowed in a single response is limited by a dynamic cluster setting named `search.max\_buckets`. It is disabled by default (-1) but requests that try to return more than 10,000 buckets (the default value for future versions) will log a deprecation warning. include::bucket/adjacency-matrix-aggregation.asciidoc[] include::bucket/children-aggregation.asciidoc[] include::bucket/composite-aggregation.asciidoc[] include::bucket/datehistogram-aggregation.asciidoc[] include::bucket/daterange-aggregation.asciidoc[] include::bucket/diversified-sampler-aggregation.asciidoc[] include::bucket/filter-aggregation.asciidoc[] include::bucket/filters-aggregation.asciidoc[] include::bucket/geodistance-aggregation.asciidoc[] include::bucket/geohashgrid-aggregation.asciidoc[] include::bucket/global-aggregation.asciidoc[] include::bucket/histogram-aggregation.asciidoc[] include::bucket/iprange-aggregation.asciidoc[] include::bucket/missing-aggregation.asciidoc[] include::bucket/nested-aggregation.asciidoc[] include::bucket/range-aggregation.asciidoc[] include::bucket/reverse-nested-aggregation.asciidoc[] include::bucket/sampler-aggregation.asciidoc[] include::bucket/significantterms-aggregation.asciidoc[] include::bucket/significanttext-aggregation.asciidoc[] include::bucket/terms-aggregation.asciidoc[]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.06334234774112701,
-0.022795097902417183,
0.011901023797690868,
0.07171045988798141,
-0.030207600444555283,
0.0054851556196808815,
-0.0368301086127758,
0.054911501705646515,
0.14186203479766846,
-0.023237410932779312,
-0.05197323486208916,
-0.006074861623346806,
0.07460711151361465,
-0.00717522157356143,
-0.059467215090990067,
-0.023063087835907936,
0.018158629536628723,
-0.03622254729270935,
-0.09428194910287857,
-0.0682564377784729,
0.015575309284031391,
0.003980208653956652,
0.0436454713344574,
-0.05796615406870842,
-0.029092831537127495,
0.04880404472351074,
-0.13702863454818726,
-0.05653887614607811,
0.02793901599943638,
0.03148374706506729,
0.016973482444882393,
0.07529027760028839,
0.035014793276786804,
0.09367477148771286,
-0.03264366835355759,
0.05734458565711975,
0.021932808682322502,
-0.003876575268805027,
-0.031132789328694344,
-0.022259220480918884,
-0.012911291792988777,
-0.028133073821663857,
-0.04068649932742119,
-0.05652019754052162,
0.036117006093263626,
-0.014664601534605026,
-0.06783691048622131,
-0.02662927843630314,
-0.02405768260359764,
0.025273650884628296,
-0.04674379527568817,
0.023785725235939026,
-0.004949940834194422,
0.07666929811239243,
0.02996344305574894,
0.08095767349004745,
-0.051043108105659485,
-0.00101830018684268,
-0.044215358793735504,
-0.08508060872554779,
-0.06421399116516113,
-0.0958128497004509,
-0.021890437230467796,
-0.03274937719106674,
0.09345119446516037,
-0.0116807222366333,
0.027424469590187073,
-0.024070365354418755,
0.011583664454519749,
0.01589764654636383,
0.055263109505176544,
0.03479206562042236,
-0.023449929431080818,
0.021219193935394287,
0.04014799743890762,
0.06720391660928726,
0.013619355857372284,
0.02870984748005867,
0.034240201115608215,
-0.02441485784947872,
-0.049825336784124374,
0.017956633120775223,
0.04667243734002113,
0.00807946640998125,
-0.010654034093022346,
-0.09380509704351425,
0.028726380318403244,
-0.10171718895435333,
0.05825256556272507,
-0.026440173387527466,
-0.017750289291143417,
-0.0800359919667244,
0.036524489521980286,
-0.01542778592556715,
-0.0159782525151968,
-0.012611300684511662,
-0.006444757338613272,
-0.01590348407626152,
0.14073702692985535,
-0.042208872735500336,
0.030387209728360176,
0.04079219698905945,
0.04392380267381668,
-0.11130235344171524,
0.0049302238039672375,
0.009649866260588169,
-0.06448499113321304,
0.0532495342195034,
-0.006160832941532135,
0.016460862010717392,
0.028039967641234398,
-0.04090667515993118,
0.02341942861676216,
0.025103315711021423,
-0.013985340483486652,
0.026613639667630196,
0.020890239626169205,
0.0006317161023616791,
-0.01384452823549509,
0.022023363038897514,
0.0150876734405756,
0.020933857187628746,
0.07594189792871475,
-0.10874729603528976,
-0.019996795803308487,
0.08328716456890106,
-0.06575164198875427,
3.5719643982681154e-33,
0.026679646223783493,
-0.1133604347705841,
0.025980183854699135,
-0.0010076439939439297,
-0.03898745775222778,
0.047749172896146774,
-0.016699519008398056,
0.11278697848320007,
-0.053853537887334824,
0.0033583324402570724,
-0.04505195841193199,
0.16549943387508392,
-0.007608979009091854,
0.013097618706524372,
0.06477299332618713,
0.06331351399421692,
-0.008832789026200771,
0.026641611009836197,
0.011563469655811787,
-0.03290677070617676,
0.019247500225901604,
-0.02220669761300087,
0.0637340173125267,
0.02368858829140663,
0.023590506985783577,
-0.005944856442511082,
-0.01918582059442997,
-0.05006815120577812,
-0.08997686207294464,
0.0084691746160388,
-0.05444943532347679,
0.030272813513875008,
-0.03973878547549248,
-0.05432611331343651,
0.023672476410865784,
0.050090353935956955,
-0.033820584416389465,
0.02507820352911949,
-0.051997970789670944,
-0.05705494433641434,
-0.037520814687013626,
-0.020169375464320183,
-0.011820611543953419,
-0.12247119098901749,
-0.11324919760227203,
0.005198346916586161,
0.006168110761791468,
-0.029924245551228523,
0.08118272572755814,
0.05038624629378319,
0.007970660924911499,
-0.009595364332199097,
0.0445733517408371,
0.048454370349645615,
0.06135312095284462,
0.05500984564423561,
-0.002807079115882516,
0.01282421126961708,
-0.0168767087161541,
0.0006693944451399148,
0.008472071029245853,
-0.0476546436548233,
0.019813746213912964,
0.00989909190684557,
0.004336290527135134,
0.03697310760617256,
0.059110477566719055,
0.15389610826969147,
0.08443233370780945,
0.0819685310125351,
0.0579289048910141,
0.06560879200696945,
-0.0086434381082654,
0.01131184957921505,
0.021168645471334457,
-0.06831540167331696,
0.12167179584503174,
-0.029299583286046982,
0.006446050945669413,
0.023540107533335686,
-0.03739762306213379,
-0.010103992186486721,
0.05029981583356857,
0.010484850965440273,
-0.04997742921113968,
0.09445344656705856,
0.031214401125907898,
0.0035801290068775415,
-0.08419080078601837,
-0.09006085246801376,
-0.029016807675361633,
-0.018710022792220116,
-0.10109493136405945,
-0.03489803150296211,
-0.045737650245428085,
-5.410821802670098e-33,
0.014057726599276066,
0.0008225133060477674,
-0.06791272014379501,
0.034236304461956024,
0.016176413744688034,
-0.048808805644512177,
0.03554781898856163,
0.00723661994561553,
0.010439966805279255,
-0.030914384871721268,
-0.05114450678229332,
0.005794019438326359,
0.015226772055029869,
-0.010902429930865765,
-0.018414292484521866,
0.024010097607970238,
-0.05046044662594795,
-0.14970989525318146,
-0.0016250667395070195,
0.011805829592049122,
-0.02706865593791008,
-0.04097091034054756,
0.006157704629004002,
0.09113779664039612,
-0.017912650480866432,
-0.02973240613937378,
-0.049536772072315216,
-0.08611783385276794,
-0.008183111436665058,
-0.0017348801484331489,
0.07992926985025406,
-0.050300803035497665,
-0.04964959993958473,
-0.0201705489307642,
-0.005697332322597504,
-0.11231211572885513,
0.028094196692109108,
-0.01008848287165165,
-0.01640012487769127,
0.011151052080094814,
-0.009972276166081429,
0.0006240452639758587,
-0.004819969180971384,
-0.0038818265311419964,
0.046420950442552567,
0.015277331694960594,
0.02150181122124195,
0.05548035725951195,
-0.006816968787461519,
-0.06860180199146271,
0.017162347212433815,
-0.015438535250723362,
-0.029136091470718384,
0.09990738332271576,
-0.06965329498052597,
-0.037907492369413376,
0.0008330371929332614,
-0.00953929778188467,
-0.04809976741671562,
0.013601881451904774,
0.022525440901517868,
-0.017994185909628868,
-0.06619714200496674,
0.0959576889872551,
-0.081371009349823,
-0.018468055874109268,
-0.026628540828824043,
-0.0906907394528389,
-0.061925604939460754,
0.013492342084646225,
-0.004091693088412285,
-0.06039257347583771,
0.09122240543365479,
-0.020783178508281708,
-0.021721042692661285,
0.07863244414329529,
0.015434663742780685,
-0.06966400891542435,
0.05347844958305359,
-0.04610356688499451,
-0.05498744547367096,
0.0628976970911026,
0.0299863088876009,
0.08045066893100739,
0.006765992380678654,
-0.024711906909942627,
0.01119941659271717,
0.07859079539775848,
-0.018260471522808075,
0.07216594368219376,
-0.01586509309709072,
-0.0452079139649868,
-0.08444594591856003,
0.008351421914994717,
-0.028174228966236115,
-5.321785678802371e-8,
-0.05158693715929985,
0.04401397705078125,
-0.05090545117855072,
0.06389208137989044,
-0.013312970288097858,
0.025077883154153824,
0.04040199890732765,
0.1597440391778946,
-0.04936736822128296,
0.027408542111516,
0.06733841449022293,
-0.06332830339670181,
-0.15245100855827332,
0.050869688391685486,
0.0017849351279437542,
0.0044371820986270905,
0.04650641232728958,
0.02081330679357052,
-0.03571988269686699,
-0.02663109451532364,
-0.020817352458834648,
0.0002535177336540073,
0.035492416471242905,
-0.02174733392894268,
0.001606002333573997,
0.013110115192830563,
-0.003690078854560852,
0.028730379417538643,
-0.05300344154238701,
-0.12121789902448654,
0.028531109914183617,
0.028335802257061005,
-0.02080388180911541,
0.043758124113082886,
0.06588974595069885,
0.013658340089023113,
-0.05412447452545166,
0.004221555311232805,
-0.06919322162866592,
0.03387864679098129,
0.019789330661296844,
0.03218873590230942,
0.006038555409759283,
0.013192445039749146,
0.014520280994474888,
0.05423489212989807,
-0.051831431686878204,
0.1196456104516983,
0.03436153754591942,
0.019147545099258423,
-0.019541461020708084,
-0.0803149938583374,
-0.0470082052052021,
0.05166962742805481,
0.031097156926989555,
-0.049975547939538956,
0.019880449399352074,
-0.05639968812465668,
0.08867352455854416,
0.03348592668771744,
0.05002150684595108,
-0.04072749987244606,
-0.03454297035932541,
-0.0530770979821682
] | 0.069491
|
[[caching-heavy-aggregations]] == Caching heavy aggregations Frequently used aggregations (e.g. for display on the home page of a website) can be cached for faster responses. These cached results are the same results that would be returned by an uncached aggregation -- you will never get stale results. See <> for more details. [[returning-only-agg-results]] == Returning only aggregation results There are many occasions when aggregations are required but search hits are not. For these cases the hits can be ignored by setting `size=0`. For example: [source,js] -------------------------------------------------- GET /twitter/\_search { "size": 0, "aggregations": { "my\_agg": { "terms": { "field": "text" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] Setting `size` to `0` avoids executing the fetch phase of the search making the request more efficient. [[agg-metadata]] == Aggregation Metadata You can associate a piece of metadata with individual aggregations at request time that will be returned in place at response time. Consider this example where we want to associate the color blue with our `terms` aggregation. [source,js] -------------------------------------------------- GET /twitter/\_search { "size": 0, "aggs": { "titles": { "terms": { "field": "title" }, "meta": { "color": "blue" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] Then that piece of metadata will be returned in place for our `titles` terms aggregation [source,js] -------------------------------------------------- { "aggregations": { "titles": { "meta": { "color" : "blue" }, "doc\_count\_error\_upper\_bound" : 0, "sum\_other\_doc\_count" : 0, "buckets": [ ] } }, ... } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": "$body.took", "timed\_out": false, "\_shards": "$body.\_shards", "hits": "$body.hits"/] [[returning-aggregation-type]] == Returning the type of the aggregation Sometimes you need to know the exact type of an aggregation in order to parse its results. The `typed\_keys` parameter can be used to change the aggregation's name in the response so that it will be prefixed by its internal type. Considering the following <> named `tweets\_over\_time` which has a sub <> named `top\_users`: [source,js] -------------------------------------------------- GET /twitter/\_search?typed\_keys { "aggregations": { "tweets\_over\_time": { "date\_histogram": { "field": "date", "interval": "year" }, "aggregations": { "top\_users": { "top\_hits": { "size": 1 } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:twitter] In the response, the aggregations names will be changed to respectively `date\_histogram#tweets\_over\_time` and `top\_hits#top\_users`, reflecting the internal types of each aggregation: [source,js] -------------------------------------------------- { "aggregations": { "date\_histogram#tweets\_over\_time": { <1> "buckets" : [ { "key\_as\_string" : "2009-01-01T00:00:00.000Z", "key" : 1230768000000, "doc\_count" : 5, "top\_hits#top\_users" : { <2> "hits" : { "total" : 5, "max\_score" : 1.0, "hits" : [ { "\_index": "twitter", "\_type": "\_doc", "\_id": "0", "\_score": 1.0, "\_source": { "date": "2009-11-15T14:12:12", "message": "trying out Elasticsearch", "user": "kimchy", "likes": 0 } } ] } } } ] } }, ... } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": "$body.took", "timed\_out": false, "\_shards": "$body.\_shards", "hits": "$body.hits"/] <1> The name `tweets\_over\_time` now contains the `date\_histogram` prefix. <2> The name `top\_users` now contains the `top\_hits` prefix. NOTE: For some aggregations, it is possible that the returned type is not the same as the one provided with the request. This is the case for Terms, Significant Terms and Percentiles aggregations, where the returned type also contains information about the type of the targeted field: `lterms` (for a terms aggregation on a Long field), `sigsterms` (for a significant terms aggregation on a String field), `tdigest\_percentiles` (for a percentile aggregation based on the TDigest algorithm).
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/misc.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.07818925380706787,
0.037461161613464355,
0.001237837364897132,
0.1268991231918335,
0.021570835262537003,
-0.05308173596858978,
-0.025905603542923927,
-0.03053048439323902,
0.12887367606163025,
-0.0512472502887249,
-0.006055088248103857,
0.0472649447619915,
-0.009392909705638885,
-0.10215386748313904,
-0.02613435871899128,
-0.012468371540307999,
0.05911193788051605,
-0.01559223048388958,
-0.07208474725484848,
-0.14618758857250214,
0.009858923964202404,
-0.024086765944957733,
0.012799997813999653,
-0.03609628602862358,
0.06718204915523529,
-0.023515809327363968,
-0.12142820656299591,
-0.0387219674885273,
0.05084476247429848,
0.0010898768668994308,
-0.05241052806377411,
0.07407527416944504,
-0.015676487237215042,
0.060377031564712524,
-0.06558853387832642,
0.03374209254980087,
-0.07312989979982376,
0.01212822925299406,
0.03350774571299553,
-0.042356621474027634,
0.03445860743522644,
0.03518203645944595,
-0.04271979629993439,
-0.040137942880392075,
0.016391556710004807,
-0.0595027357339859,
-0.009012647904455662,
-0.029098084196448326,
-0.0988260880112648,
-0.026464005932211876,
-0.03100847825407982,
0.0014828129205852747,
-0.059709012508392334,
0.04046054556965828,
0.027215972542762756,
0.016606904566287994,
-0.06390035152435303,
0.005793069489300251,
-0.07362693548202515,
-0.021052546799182892,
0.0038937043864279985,
-0.07576868683099747,
-0.019139550626277924,
-0.012772228568792343,
0.04642566293478012,
-0.05685780942440033,
0.10731886327266693,
0.009828309528529644,
0.021472448483109474,
0.07130623608827591,
0.07412377744913101,
0.005976076703518629,
-0.0020903286058455706,
-0.02122773602604866,
0.08177781850099564,
0.08023782819509506,
-0.02695843018591404,
-0.05728187412023544,
0.03524622321128845,
0.035902563482522964,
-0.06217271462082863,
-0.09615714102983475,
-0.0014056925429031253,
-0.014494071714580059,
0.027831347659230232,
-0.023219779133796692,
0.04847591370344162,
-0.08908940106630325,
0.0566871352493763,
-0.07114847749471664,
0.040143176913261414,
0.020233839750289917,
0.035375624895095825,
0.022763419896364212,
-0.012715928256511688,
0.024131745100021362,
0.01559687964618206,
-0.031477250158786774,
0.03670748323202133,
0.03271656855940819,
0.03191743418574333,
0.02535436674952507,
0.03975776955485344,
-0.005180336534976959,
-0.017667364329099655,
0.01934524066746235,
-0.02461717277765274,
0.09926752746105194,
-0.019969020038843155,
0.0988338515162468,
-0.004706426989287138,
0.03962947055697441,
-0.003799303900450468,
0.031068366020917892,
-0.09294261783361435,
0.0063810753636062145,
0.03183744475245476,
-0.03055870532989502,
0.05035926029086113,
0.03606795147061348,
0.10804871469736099,
0.040438998490571976,
-0.010814253240823746,
-0.052138570696115494,
0.059047311544418335,
0.061499837785959244,
0.03436877578496933,
1.821775818445604e-33,
-0.008790350519120693,
-0.03936120495200157,
-0.02019854448735714,
-0.039671890437603,
-0.04544759914278984,
0.053924381732940674,
0.0008623352041468024,
0.07064608484506607,
-0.06109487637877464,
0.039822403341531754,
-0.006891950964927673,
0.13764435052871704,
-0.046964116394519806,
-0.01511871162801981,
0.0187578983604908,
0.005838829558342695,
0.04797683656215668,
0.019416991621255875,
0.012831724248826504,
0.012366926297545433,
0.02539246715605259,
0.011944232508540154,
0.010146362707018852,
0.007739587686955929,
-0.011818605475127697,
-0.008846168406307697,
0.01764628477394581,
0.008726799860596657,
-0.17982274293899536,
-0.017853710800409317,
-0.025420408695936203,
0.04400057718157768,
0.018429631367325783,
-0.01959657482802868,
0.04068182781338692,
0.01877759024500847,
-0.002114218892529607,
0.00032096332870423794,
-0.04724967107176781,
-0.06760325282812119,
-0.03310155123472214,
0.052960462868213654,
0.003391749458387494,
-0.16087475419044495,
-0.08810170739889145,
-0.019511932507157326,
-0.01789933256804943,
0.02007942646741867,
-0.007202157750725746,
0.032862428575754166,
0.0012703831307590008,
0.05176188051700592,
0.0017044704873114824,
0.07437212765216827,
0.06304366886615753,
0.057130251079797745,
0.053665123879909515,
0.017266476526856422,
-0.0040173945017158985,
0.013272801414132118,
-0.0079577611759305,
-0.05153223127126694,
0.007943229749798775,
0.012659578584134579,
-0.01994428038597107,
0.11432473361492157,
0.0019598889630287886,
0.07829628139734268,
0.00026655406691133976,
0.013274538330733776,
0.11568783223628998,
0.05019914358854294,
0.003789120353758335,
0.006843201816082001,
0.006117804441601038,
-0.09184757620096207,
-0.027277356013655663,
0.0002213736152043566,
0.006082295905798674,
-0.0012838123366236687,
0.1127394586801529,
-0.09194280952215195,
-0.05582389608025551,
0.07326539605855942,
-0.05773405730724335,
0.03837677463889122,
-0.010652920231223106,
-0.05995989218354225,
-0.011074998416006565,
0.06427177041769028,
-0.06531483680009842,
0.05093563720583916,
-0.015232968144118786,
-0.06153067946434021,
-0.07498520612716675,
-3.455183809959721e-33,
0.008525168523192406,
-0.04770514369010925,
-0.024482980370521545,
0.0921577736735344,
0.021673239767551422,
-0.018234647810459137,
-0.011336741968989372,
0.03691213205456734,
0.045920662581920624,
-0.015425029210746288,
0.012575041502714157,
-0.006906350143253803,
-0.06473502516746521,
-0.0344151109457016,
0.04719055816531181,
0.06394609808921814,
0.0022644002456218004,
-0.1503218114376068,
-0.01191152073442936,
0.037626784294843674,
0.006544356234371662,
0.021675344556570053,
-0.029514925554394722,
0.09227785468101501,
-0.023811066523194313,
-0.05148439109325409,
-0.004992968402802944,
-0.014926208183169365,
-0.07823730260133743,
-0.006318094674497843,
0.03808438032865524,
-0.0657844990491867,
-0.04819841682910919,
-0.07137181609869003,
0.002920966362580657,
-0.024081552401185036,
0.040385421365499496,
0.03004947118461132,
-0.034014198929071426,
0.06133067235350609,
0.0319611132144928,
0.024677418172359467,
-0.010121376253664494,
-0.00015380812692455947,
0.01429495308548212,
-0.014899068512022495,
-0.0508667528629303,
0.05091630667448044,
0.008515642024576664,
-0.0006273907492868602,
0.06983710080385208,
-0.005579724442213774,
-0.053691647946834564,
0.05042235553264618,
-0.012913482263684273,
-0.04307122528553009,
-0.0012455086689442396,
-0.04445431008934975,
-0.07615260034799576,
-0.007207157090306282,
-0.0034714057110249996,
-0.08583928644657135,
-0.12590953707695007,
-0.014199980534613132,
0.024159202352166176,
-0.02124917134642601,
-0.05033188313245773,
-0.0604536309838295,
0.03973543643951416,
0.028660420328378677,
0.06007068604230881,
-0.03462502360343933,
0.04961778596043587,
0.009206454269587994,
-0.019989442080259323,
0.018790263682603836,
0.051298536360263824,
-0.042767759412527084,
0.054609037935733795,
-0.03284173086285591,
-0.08103863149881363,
0.03128533065319061,
0.021148985251784325,
0.06258802115917206,
-0.03255626931786537,
0.0013957817573100328,
-0.0694938451051712,
0.08196967840194702,
0.006272709928452969,
0.05691041424870491,
0.012273327447474003,
-0.08354263752698898,
-0.043002258986234665,
0.025177109986543655,
0.03671344742178917,
-5.4253263215287006e-8,
-0.07069678604602814,
0.005383910611271858,
-0.055199217051267624,
0.05897660553455353,
-0.03477988764643669,
-0.00272751203738153,
0.06871453672647476,
0.06374319642782211,
-0.007510184310376644,
-0.010117179714143276,
0.05966908857226372,
0.05923541262745857,
-0.07062973827123642,
0.027618728578090668,
0.014269890263676643,
-0.012407996691763401,
-0.03214593976736069,
-0.0856298953294754,
-0.06020016968250275,
-0.06462138891220093,
-0.0677531436085701,
0.04449852183461189,
-0.0042980439029634,
-0.04604284092783928,
0.01408440712839365,
0.04479007050395012,
0.03653573989868164,
0.05578775331377983,
-0.008128552697598934,
-0.035125404596328735,
-0.02297268994152546,
0.0023333828430622816,
0.01896367408335209,
-0.004315744619816542,
0.04955706372857094,
0.015347612090408802,
-0.038583848625421524,
-0.019302254542708397,
-0.011776247061789036,
0.05910028517246246,
0.03899697586894035,
0.056194812059402466,
0.0019013758283108473,
0.031014712527394295,
-0.04771747440099716,
0.012965233996510506,
-0.042747899889945984,
0.009137921035289764,
0.0793846845626831,
-0.045901186764240265,
0.04354259371757507,
-0.08640067279338837,
-0.15793344378471375,
-0.0006586117669939995,
-0.013195748440921307,
-0.08437158912420273,
0.08233912289142609,
-0.022425226867198944,
0.08816312998533249,
0.01294640451669693,
0.1250120997428894,
-0.13154520094394684,
-0.07486880570650101,
-0.031017914414405823
] | 0.059673
|
[[search-aggregations-metrics-stats-aggregation]] === Stats Aggregation A `multi-value` metrics aggregation that computes stats over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. The stats that are returned consist of: `min`, `max`, `sum`, `count` and `avg`. Assuming the data consists of documents representing exams grades (between 0 and 100) of students [source,js] -------------------------------------------------- POST /exams/\_search?size=0 { "aggs" : { "grades\_stats" : { "stats" : { "field" : "grade" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] The above aggregation computes the grades statistics over all documents. The aggregation type is `stats` and the `field` setting defines the numeric field of the documents the stats will be computed on. The above will return the following: [source,js] -------------------------------------------------- { ... "aggregations": { "grades\_stats": { "count": 2, "min": 50.0, "max": 100.0, "avg": 75.0, "sum": 150.0 } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] The name of the aggregation (`grades\_stats` above) also serves as the key by which the aggregation result can be retrieved from the returned response. ==== Script Computing the grades stats based on a script: [source,js] -------------------------------------------------- POST /exams/\_search?size=0 { "aggs" : { "grades\_stats" : { "stats" : { "script" : { "lang": "painless", "source": "doc['grade'].value" } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a stored script use the following syntax: [source,js] -------------------------------------------------- POST /exams/\_search?size=0 { "aggs" : { "grades\_stats" : { "stats" : { "script" : { "id": "my\_script", "params" : { "field" : "grade" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams,stored\_example\_script] ===== Value Script It turned out that the exam was way above the level of the students and a grade correction needs to be applied. We can use a value script to get the new stats: [source,js] -------------------------------------------------- POST /exams/\_search?size=0 { "aggs" : { "grades\_stats" : { "stats" : { "field" : "grade", "script" : { "lang": "painless", "source": "\_value \* params.correction", "params" : { "correction" : 1.2 } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] ==== Missing value The `missing` parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value. [source,js] -------------------------------------------------- POST /exams/\_search?size=0 { "aggs" : { "grades\_stats" : { "stats" : { "field" : "grade", "missing": 0 <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] <1> Documents without a value in the `grade` field will fall into the same bucket as documents that have the value `0`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/stats-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.017262820154428482,
0.09540317952632904,
-0.052952297031879425,
0.07188943773508072,
-0.023242387920618057,
0.04425197094678879,
-0.020927615463733673,
0.08194418251514435,
0.05628993734717369,
-0.013392080552875996,
-0.030644040554761887,
-0.04334520921111107,
0.02611355483531952,
0.010668802075088024,
-0.02093752846121788,
0.0005467833252623677,
-0.05595870688557625,
0.04439008980989456,
-0.05271732434630394,
-0.10902059823274612,
0.00881762895733118,
0.02557920664548874,
0.02731722965836525,
-0.0796332061290741,
0.05888158082962036,
0.03701862692832947,
-0.09518788009881973,
-0.04982069879770279,
0.0061460379511117935,
0.02838745340704918,
-0.03702157363295555,
-0.004890819545835257,
0.04067205637693405,
0.07927533239126205,
-0.045176997780799866,
-0.07209254801273346,
-0.005852140951901674,
-0.019182536751031876,
0.03916557505726814,
0.04696231335401535,
-0.009875447489321232,
0.017107877880334854,
-0.008540092967450619,
-0.06208772212266922,
0.04333033785223961,
-0.08166678994894028,
-0.10938401520252228,
-0.06140071153640747,
0.02031063660979271,
0.05936966463923454,
-0.05187064781785011,
0.018467416986823082,
-0.06974680721759796,
0.03001326508820057,
0.02810109406709671,
0.021273495629429817,
-0.024576496332883835,
-0.06831920146942139,
-0.04327031597495079,
-0.07344361394643784,
-0.060692545026540756,
-0.09593833982944489,
0.00522416178137064,
-0.006595917511731386,
0.005125892348587513,
-0.019041936844587326,
-0.01385694183409214,
0.058678414672613144,
0.001522817532531917,
0.07744485139846802,
0.03588995337486267,
0.0027358641382306814,
0.053682539612054825,
-0.05753134563565254,
0.05323358252644539,
0.05654619634151459,
-0.07755184173583984,
-0.012014362961053848,
0.05934221297502518,
0.022863082587718964,
-0.08063118159770966,
-0.10949888825416565,
-0.027811428532004356,
0.01861564815044403,
0.06939227133989334,
-0.026208678260445595,
0.05485842004418373,
-0.05256781354546547,
0.058926038444042206,
-0.02211747132241726,
-0.09377555549144745,
0.034604351967573166,
-0.036421675235033035,
0.07452128082513809,
0.017686886712908745,
0.02359948679804802,
0.0029113637283444405,
-0.036882441490888596,
0.0960230901837349,
0.018128221854567528,
0.016569629311561584,
0.030854469165205956,
0.037749361246824265,
-0.054477542638778687,
-0.07855473458766937,
-0.0005873078480362892,
0.03504813462495804,
-0.0021799588575959206,
-0.053005583584308624,
-0.040843162685632706,
0.028808964416384697,
0.02265886589884758,
-0.02067946456372738,
0.006257175467908382,
-0.023265553638339043,
0.05145789682865143,
0.10370200127363205,
0.012159534730017185,
0.03548475354909897,
0.0737529844045639,
0.05847872793674469,
0.04269473999738693,
0.02257947251200676,
-0.024811388924717903,
0.022525520995259285,
0.036761075258255005,
0.0037940319161862135,
-2.477459496001072e-34,
0.022829225286841393,
-0.08068384975194931,
0.0011476327199488878,
-0.05717790499329567,
-0.046352751553058624,
0.015016968362033367,
0.017276715487241745,
0.09082222729921341,
-0.02614801935851574,
0.019037064164876938,
-0.050885412842035294,
0.15550564229488373,
-0.012149274349212646,
-0.05796939879655838,
0.04327729344367981,
0.015166656114161015,
-0.019696297124028206,
-0.0018761182436719537,
-0.0011164241004735231,
0.030696367844939232,
0.0873018428683281,
-0.0445275716483593,
0.025070378556847572,
0.06803620606660843,
0.03627055138349533,
0.004899388179183006,
-0.034645307809114456,
-0.043133825063705444,
-0.1138225793838501,
-0.0038218337576836348,
0.00875895470380783,
-0.02752835489809513,
-0.0359988771378994,
-0.05141361057758331,
0.03215481713414192,
0.008800285868346691,
0.030504485592246056,
0.07473473250865936,
-0.02729819342494011,
0.02481754496693611,
-0.00015724670083727688,
-0.027695128694176674,
0.04462478309869766,
-0.10081598162651062,
-0.11368994414806366,
0.04761834442615509,
-0.032943908125162125,
0.023191753774881363,
0.0612918920814991,
0.010429990477859974,
-0.09164196252822876,
-0.0415954627096653,
-0.026191964745521545,
0.006488252431154251,
0.0051069101318717,
0.02979736402630806,
-0.004607789684087038,
0.10159330070018768,
-0.036496467888355255,
-0.048273663967847824,
-0.028507409617304802,
0.008608142845332623,
0.01021733507514,
0.0007575913914479315,
-0.0012411412317305803,
0.02524484507739544,
-0.04183175414800644,
0.08014027774333954,
0.083330437541008,
0.04979196935892105,
0.032353971153497696,
0.06710904091596603,
-0.0253576822578907,
-0.008797491900622845,
0.026794007048010826,
-0.02250678837299347,
0.066580630838871,
0.020484792068600655,
-0.018212657421827316,
-0.01112168189138174,
0.02309008128941059,
-0.02734958380460739,
-0.020139180123806,
-0.04138795658946037,
-0.02366238459944725,
0.15559130907058716,
-0.03615273907780647,
-0.011386674828827381,
-0.06849542260169983,
-0.07449820637702942,
-0.04667362943291664,
0.01996985450387001,
-0.1047077402472496,
-0.08879215270280838,
-0.0669516772031784,
-2.3768042106275633e-33,
-0.0011859021615236998,
0.02514641359448433,
0.003466295776888728,
0.03126665949821472,
0.06766898930072784,
-0.0008218248840421438,
0.02499035745859146,
0.007674987427890301,
0.02662532590329647,
0.03852108493447304,
-0.007116564083844423,
-0.0329594723880291,
0.005747975315898657,
-0.08698391169309616,
-0.004850598517805338,
0.011424805037677288,
-0.11725590378046036,
-0.05483785271644592,
0.01731887087225914,
0.009892837144434452,
-0.05669654905796051,
0.05586818978190422,
0.04174270108342171,
0.10608302056789398,
0.003929611295461655,
-0.04780185967683792,
-0.01564418338239193,
-0.09219963848590851,
-0.06655069440603256,
0.015926742926239967,
0.03602978214621544,
-0.05689357593655586,
-0.03769495338201523,
0.07043551653623581,
-0.06230771541595459,
-0.0684513971209526,
0.05747270584106445,
-0.02478804439306259,
-0.04515084996819496,
0.09347626566886902,
-0.02811841107904911,
-0.006098022218793631,
-0.05701214820146561,
0.01612192951142788,
0.06030343100428581,
0.0739208236336708,
0.017205040901899338,
0.07640227675437927,
-0.043090350925922394,
-0.098275326192379,
-0.009448075667023659,
0.019082248210906982,
-0.05277259647846222,
0.09419526904821396,
-0.036019712686538696,
-0.031509850174188614,
-0.019778002053499222,
-0.09305524826049805,
-0.06983963400125504,
0.027088353410363197,
0.026263313367962837,
-0.03518481180071831,
-0.07678966969251633,
0.05286940559744835,
0.025056075304746628,
-0.06182420998811722,
-0.029817448928952217,
-0.04196947440505028,
-0.09690941125154495,
0.06499224901199341,
0.013478203676640987,
0.011854574084281921,
0.140247642993927,
-0.010643448680639267,
0.003864175407215953,
0.02711520716547966,
-0.01863720640540123,
0.009691039100289345,
0.03391116112470627,
0.010762887075543404,
0.0003043711185455322,
-0.012302962131798267,
0.06313078850507736,
0.0811818540096283,
-0.04423389583826065,
-0.011133979074656963,
0.07510080933570862,
0.07951485365629196,
0.021678967401385307,
-0.0018449862254783511,
-0.0753973126411438,
-0.0008543053991161287,
0.002299313899129629,
-0.05159579589962959,
0.003782192012295127,
-4.679971610244138e-8,
-0.03873308375477791,
-0.013134666718542576,
-0.08756162226200104,
0.0899713784456253,
-0.055393148213624954,
0.056101005524396896,
-0.026633067056536674,
0.08490446209907532,
-0.016790570691227913,
0.008890560828149319,
0.025210365653038025,
-0.026058385148644447,
-0.08401419967412949,
0.003080344758927822,
-0.07273624837398529,
0.006197581999003887,
0.015194136649370193,
0.11702971160411835,
0.015318309888243675,
-0.047890555113554,
0.06733321398496628,
-0.017861120402812958,
0.045229118317365646,
0.006405002437531948,
0.03178712725639343,
0.032287970185279846,
-0.019100874662399292,
-0.007378190290182829,
0.04512831196188927,
-0.03383937105536461,
-0.03883359581232071,
-0.038985688239336014,
0.0036602152977138758,
-0.024868439882993698,
0.03284715116024017,
-0.009606622159481049,
0.03065265342593193,
0.04654510319232941,
-0.04315062239766121,
0.055832020938396454,
-0.009335118345916271,
-0.028755586594343185,
-0.05141978710889816,
0.04710601642727852,
0.031206712126731873,
-0.03233421966433525,
-0.06166219711303711,
0.023693572729825974,
0.11979693174362183,
-0.010935802944004536,
0.08350836485624313,
-0.14472107589244843,
-0.04191174730658531,
-0.02725837752223015,
-0.07719502598047256,
-0.0654384046792984,
0.01492802333086729,
-0.007058501243591309,
-0.050727684050798416,
-0.05225374177098274,
0.09030530601739883,
-0.06457681953907013,
-0.04501716047525406,
0.0199267715215683
] | 0.035962
|
[[search-aggregations-metrics-extendedstats-aggregation]] === Extended Stats Aggregation A `multi-value` metrics aggregation that computes stats over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. The `extended\_stats` aggregations is an extended version of the <> aggregation, where additional metrics are added such as `sum\_of\_squares`, `variance`, `std\_deviation` and `std\_deviation\_bounds`. Assuming the data consists of documents representing exams grades (between 0 and 100) of students [source,js] -------------------------------------------------- GET /exams/\_search { "size": 0, "aggs" : { "grades\_stats" : { "extended\_stats" : { "field" : "grade" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] The above aggregation computes the grades statistics over all documents. The aggregation type is `extended\_stats` and the `field` setting defines the numeric field of the documents the stats will be computed on. The above will return the following: [source,js] -------------------------------------------------- { ... "aggregations": { "grades\_stats": { "count": 2, "min": 50.0, "max": 100.0, "avg": 75.0, "sum": 150.0, "sum\_of\_squares": 12500.0, "variance": 625.0, "std\_deviation": 25.0, "std\_deviation\_bounds": { "upper": 125.0, "lower": 25.0 } } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] The name of the aggregation (`grades\_stats` above) also serves as the key by which the aggregation result can be retrieved from the returned response. ==== Standard Deviation Bounds By default, the `extended\_stats` metric will return an object called `std\_deviation\_bounds`, which provides an interval of plus/minus two standard deviations from the mean. This can be a useful way to visualize variance of your data. If you want a different boundary, for example three standard deviations, you can set `sigma` in the request: [source,js] -------------------------------------------------- GET /exams/\_search { "size": 0, "aggs" : { "grades\_stats" : { "extended\_stats" : { "field" : "grade", "sigma" : 3 <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] <1> `sigma` controls how many standard deviations +/- from the mean should be displayed `sigma` can be any non-negative double, meaning you can request non-integer values such as `1.5`. A value of `0` is valid, but will simply return the average for both `upper` and `lower` bounds. .Standard Deviation and Bounds require normality [NOTE] ===== The standard deviation and its bounds are displayed by default, but they are not always applicable to all data-sets. Your data must be normally distributed for the metrics to make sense. The statistics behind standard deviations assumes normally distributed data, so if your data is skewed heavily left or right, the value returned will be misleading. ===== ==== Script Computing the grades stats based on a script: [source,js] -------------------------------------------------- GET /exams/\_search { "size": 0, "aggs" : { "grades\_stats" : { "extended\_stats" : { "script" : { "source" : "doc['grade'].value", "lang" : "painless" } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a stored script use the following syntax: [source,js] -------------------------------------------------- GET /exams/\_search { "size": 0, "aggs" : { "grades\_stats" : { "extended\_stats" : { "script" : { "id": "my\_script", "params": { "field": "grade" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams,stored\_example\_script] ===== Value Script It turned out that the exam was way above the level of the students and a grade correction needs to be applied. We can use value script to get the new stats: [source,js] -------------------------------------------------- GET /exams/\_search { "size": 0, "aggs" : { "grades\_stats" : { "extended\_stats" : { "field" : "grade", "script" : { "lang" : "painless", "source": "\_value \* params.correction", "params" : { "correction" : 1.2 } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/extendedstats-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.015707582235336304,
0.09873832017183304,
-0.017747649922966957,
0.06409280747175217,
-0.005584769416600466,
0.03702518716454506,
-0.024735335260629654,
0.08047518879175186,
0.02388768643140793,
-0.018894590437412262,
-0.005562322214245796,
-0.009174870327115059,
0.02076161466538906,
0.0021091310773044825,
0.00037448760122060776,
-0.013094637542963028,
-0.019790764898061752,
0.06841956079006195,
-0.06541063636541367,
-0.09417614340782166,
0.017257796600461006,
-0.001080890535376966,
0.010486863553524017,
-0.06845076382160187,
0.06030271574854851,
0.04152515530586243,
-0.0829354077577591,
-0.053787797689437866,
-0.004022307228296995,
0.05402872711420059,
-0.01727951690554619,
0.009215318597853184,
0.0393206849694252,
0.08785207569599152,
-0.04216785728931427,
-0.0621989481151104,
0.0017464978154748678,
0.019247977063059807,
0.02222679927945137,
0.04362823814153671,
-0.015392127446830273,
0.01921096257865429,
0.012431181967258453,
-0.05825606361031532,
0.05668148398399353,
-0.08995745331048965,
-0.10033504664897919,
-0.08623475581407547,
-0.0031505385413765907,
0.06248107925057411,
-0.05065710097551346,
0.02100728265941143,
-0.060134243220090866,
0.02320355921983719,
0.007489161100238562,
0.016056105494499207,
0.007010761648416519,
-0.08186568319797516,
-0.04704112559556961,
-0.05238685756921768,
-0.08527166396379471,
-0.09140465408563614,
-0.0054412176832556725,
-0.007765186484903097,
-0.03512759134173393,
-0.013081676326692104,
0.0025071606505662203,
0.04975498840212822,
0.022419149056077003,
0.06551888585090637,
0.010469197295606136,
0.036354754120111465,
0.03888154774904251,
-0.038926124572753906,
0.06048455834388733,
0.058876968920230865,
-0.08270799368619919,
-0.004174873232841492,
0.07389740645885468,
-0.00025656697107478976,
-0.08332961052656174,
-0.09235841780900955,
0.00673104589805007,
-0.009087113663554192,
0.08397345244884491,
0.0020771643612533808,
0.0914512574672699,
-0.05287736654281616,
0.02640671283006668,
-0.01177501492202282,
-0.06991596519947052,
0.003900915617123246,
-0.04662438854575157,
0.09252209216356277,
0.028284218162298203,
0.02354896068572998,
0.02782684937119484,
-0.03317545726895332,
0.11715319752693176,
0.016189802438020706,
0.019727211445569992,
0.07474285364151001,
0.020597748458385468,
-0.06666583567857742,
-0.09378889203071594,
0.018170665949583054,
0.023517614230513573,
-0.030338561162352562,
-0.03517717495560646,
-0.07436926662921906,
0.026983465999364853,
-0.0012274389155209064,
-0.01325160637497902,
0.010347606614232063,
-0.0031064392533153296,
0.04044434428215027,
0.09352271258831024,
-0.002009105170145631,
0.02728957124054432,
0.044659946113824844,
0.04310835897922516,
0.013992208056151867,
0.011824589222669601,
-0.010597625747323036,
0.03155888244509697,
0.05562692880630493,
-0.013586741872131824,
-1.9444011850714773e-33,
0.017031962051987648,
-0.06116233393549919,
-0.00791529007256031,
-0.0117647061124444,
-0.053691428154706955,
0.042991798371076584,
0.026815805584192276,
0.10017969459295273,
-0.03161253407597542,
0.04017982259392738,
-0.0564420111477375,
0.15935105085372925,
-0.023442815989255905,
-0.0499291718006134,
0.07430398464202881,
0.01842518523335457,
-0.01618209481239319,
0.021259868517518044,
0.010088954120874405,
0.019596369937062263,
0.08242052793502808,
-0.05323711037635803,
0.03843769431114197,
0.10201072692871094,
0.04791012778878212,
-0.01850791461765766,
-0.045223429799079895,
-0.056426044553518295,
-0.10350392758846283,
0.0009097505826503038,
0.006050975993275642,
-0.03536498546600342,
-0.037303343415260315,
-0.04237290099263191,
0.03212499991059303,
-0.006213740445673466,
0.05001994967460632,
0.05178773030638695,
-0.01394999586045742,
0.0025152405723929405,
0.0056308782659471035,
-0.03751283138990402,
0.06835324317216873,
-0.09296725690364838,
-0.12033882737159729,
0.04040908440947533,
-0.04506360739469528,
0.02009817771613598,
0.07683809846639633,
-0.014417224563658237,
-0.1049099862575531,
-0.005838462617248297,
-0.030678462237119675,
-0.00795651599764824,
0.003397490829229355,
0.02765624038875103,
-0.0004055179306305945,
0.09864405542612076,
-0.02751491777598858,
-0.03986745327711105,
-0.034639354795217514,
0.019829386845231056,
0.02586185559630394,
0.01843619905412197,
0.004640487022697926,
0.023241732269525528,
-0.03182341903448105,
0.04145513474941254,
0.10669228434562683,
0.04143529385328293,
0.018780814483761787,
0.0474705770611763,
-0.033923353999853134,
0.015251202508807182,
0.012716192752122879,
-0.03414779528975487,
0.057457100600004196,
0.016844915226101875,
-0.01511469017714262,
-0.027290157973766327,
0.005681353155523539,
-0.05672556161880493,
-0.026003658771514893,
-0.04840424284338951,
-0.03239436820149422,
0.09038572758436203,
-0.040157463401556015,
-0.05633009970188141,
-0.04513224959373474,
-0.10310053825378418,
-0.055935729295015335,
0.01618165709078312,
-0.11100047826766968,
-0.053697120398283005,
-0.07930409908294678,
-6.2801782107814024e-34,
0.02466444857418537,
0.03930436819791794,
-0.008841476403176785,
0.03081335499882698,
0.09263113886117935,
-0.01017279364168644,
0.014194688759744167,
0.015345947816967964,
0.02560660056769848,
0.003646326484158635,
-0.03787767514586449,
-0.009483021683990955,
0.024936407804489136,
-0.08181725442409515,
-0.018434708938002586,
0.03375769406557083,
-0.1238422840833664,
-0.052998512983322144,
-0.0069151814095675945,
0.02937433496117592,
-0.036030206829309464,
0.03921923413872719,
0.06385951489210129,
0.09882652014493942,
0.03710202872753143,
-0.030921228229999542,
-0.006495046894997358,
-0.09980829060077667,
-0.06455089896917343,
-0.004283060785382986,
0.025600900873541832,
-0.06049095839262009,
-0.060671817511320114,
0.05672363564372063,
-0.047262564301490784,
-0.08632715046405792,
0.04356610029935837,
-0.026002123951911926,
-0.03787330538034439,
0.12380027770996094,
-0.00731263542547822,
0.02105223760008812,
-0.06438226997852325,
0.011609765700995922,
0.06538385152816772,
0.08875700831413269,
0.014263960532844067,
0.0639481469988823,
-0.0189758762717247,
-0.08875259011983871,
0.000783013878390193,
0.04010409861803055,
-0.03494004160165787,
0.09562285989522934,
-0.01028642151504755,
-0.020115425810217857,
-0.034219060093164444,
-0.08183340728282928,
-0.10935215651988983,
0.03877193108201027,
0.03227933868765831,
-0.043495744466781616,
-0.06975958496332169,
0.047527533024549484,
-0.0021427799947559834,
-0.04514318332076073,
-0.04428961127996445,
-0.043659668415784836,
-0.09789124876260757,
0.06453167647123337,
0.03353501856327057,
-0.01172573771327734,
0.11468857526779175,
0.0032043440733104944,
-0.012721139937639236,
0.021099736914038658,
0.0020735228899866343,
-0.0036755187902599573,
0.02996225282549858,
0.023759981617331505,
-0.01857013814151287,
-0.005334931891411543,
0.07100589573383331,
0.07475224137306213,
-0.039105139672756195,
0.0011418203357607126,
0.08033300936222076,
0.11049658805131912,
0.013544498942792416,
-0.001675059087574482,
-0.0682206079363823,
0.02213871479034424,
-0.010895485989749432,
-0.05123279243707657,
0.027775919064879417,
-4.856207169723348e-8,
-0.037710338830947876,
-0.027862276881933212,
-0.07632900029420853,
0.08343128114938736,
-0.04363057017326355,
0.034709084779024124,
-0.04418765753507614,
0.07683857530355453,
-0.06456657499074936,
0.01622818596661091,
0.04506804049015045,
-0.03143537789583206,
-0.0925782322883606,
-0.02025526762008667,
-0.05423245206475258,
0.01965273916721344,
0.00809335894882679,
0.09893590211868286,
0.0008248384110629559,
-0.04198199883103371,
0.06770307570695877,
-0.00931430421769619,
0.03642328828573227,
0.03330393135547638,
0.006927016656845808,
0.026482881978154182,
-0.03659787029027939,
-0.022744715213775635,
0.04261190444231033,
-0.012991839088499546,
0.007717892527580261,
-0.039833515882492065,
0.02779819816350937,
-0.02773798443377018,
0.039357829838991165,
-0.009556103497743607,
0.002667438704520464,
0.03293033689260483,
-0.021118858829140663,
0.0712006539106369,
0.0035221162252128124,
-0.019839933142066002,
-0.026919415220618248,
0.05755879357457161,
0.04984816908836365,
-0.04186055064201355,
-0.08649790287017822,
0.05001261830329895,
0.10539700835943222,
0.011687018908560276,
0.060241471976041794,
-0.14049798250198364,
-0.05609924718737602,
-0.021731087937951088,
-0.06973878294229507,
-0.052789583802223206,
0.000613802345469594,
0.00577035965397954,
-0.05101410672068596,
-0.07925406098365784,
0.07946785539388657,
-0.055628206580877304,
-0.05801835656166077,
0.010594614781439304
] | 0.042285
|
get the new stats: [source,js] -------------------------------------------------- GET /exams/\_search { "size": 0, "aggs" : { "grades\_stats" : { "extended\_stats" : { "field" : "grade", "script" : { "lang" : "painless", "source": "\_value \* params.correction", "params" : { "correction" : 1.2 } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] ==== Missing value The `missing` parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value. [source,js] -------------------------------------------------- GET /exams/\_search { "size": 0, "aggs" : { "grades\_stats" : { "extended\_stats" : { "field" : "grade", "missing": 0 <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] <1> Documents without a value in the `grade` field will fall into the same bucket as documents that have the value `0`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/extendedstats-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.0471218079328537,
0.12849514186382294,
-0.026694588363170624,
0.1228548139333725,
0.01865721307694912,
0.03888924792408943,
0.002264099894091487,
0.07043313980102539,
0.012608320452272892,
0.0026235058903694153,
0.040073782205581665,
-0.02649354562163353,
0.013555333949625492,
-0.047125332057476044,
0.03307536244392395,
-0.02192538231611252,
-0.10036282986402512,
-0.02131195180118084,
-0.0665951818227768,
-0.13239067792892456,
-0.05532151833176613,
0.07578786462545395,
0.024555271491408348,
-0.026088939979672432,
0.024541174992918968,
0.02665957622230053,
-0.09629422426223755,
-0.0476045198738575,
0.00884318444877863,
0.05154081806540489,
-0.04684491083025932,
0.0032806715462356806,
-0.011942261829972267,
0.06469690054655075,
0.029799815267324448,
-0.02921539731323719,
0.012594528496265411,
-0.012497561983764172,
-0.0045945472083985806,
0.041739948093891144,
0.005216627381742001,
0.06295627355575562,
-0.017411328852176666,
-0.05929652974009514,
0.018689481541514397,
-0.09545749425888062,
-0.111289843916893,
-0.07383845001459122,
-0.008868184871971607,
0.027532128617167473,
-0.049769774079322815,
-0.050466831773519516,
-0.053257398307323456,
0.0065073189325630665,
0.021614331752061844,
0.021927375346422195,
-0.005720657296478748,
-0.04384859651327133,
-0.030938420444726944,
-0.05418221652507782,
-0.04835028946399689,
-0.06578968465328217,
-0.0003656555782072246,
0.0006515459972433746,
0.00018658886256162077,
-0.02028391882777214,
0.007988342083990574,
0.011963866651058197,
0.020518794655799866,
0.10015091300010681,
-0.014597485773265362,
0.008056041784584522,
0.017241211608052254,
-0.0025376989506185055,
0.033976197242736816,
0.02212231419980526,
-0.045337725430727005,
-0.0031708423048257828,
0.08253378421068192,
0.03275015205144882,
-0.08425276726484299,
-0.1573362797498703,
-0.04060118645429611,
0.021641787141561508,
0.04983416199684143,
-0.007230178918689489,
0.03975701704621315,
-0.006688882131129503,
0.03405508026480675,
-0.03189884498715401,
-0.03176619112491608,
-0.04931798204779625,
-0.07640500366687775,
0.06787409633398056,
0.04026053473353386,
0.06472806632518768,
-0.005921132396906614,
-0.05947735905647278,
0.023387055844068527,
0.05576116591691971,
0.018215209245681763,
0.013595555908977985,
0.05674223601818085,
0.024096542969346046,
-0.05047779530286789,
0.04318298399448395,
0.02188168279826641,
-0.021890822798013687,
-0.04950777813792229,
-0.009868403896689415,
0.0037119584158062935,
0.07616366446018219,
-0.0020788945257663727,
0.0016396470600739121,
-0.0084297526627779,
0.04205146059393883,
0.10046637058258057,
-0.041847094893455505,
-0.017062006518244743,
0.07251545041799545,
0.1219940334558487,
0.04056407883763313,
-0.015243823640048504,
-0.010540693998336792,
0.009319807402789593,
0.0060256849974393845,
-0.004691991023719311,
-2.5144950067271627e-33,
0.040646713227033615,
-0.05612559989094734,
-0.01805780455470085,
-0.0700877457857132,
-0.01391263771802187,
0.06565001606941223,
0.06434722989797592,
0.09472540020942688,
0.019050879403948784,
-0.004723116289824247,
-0.0931168794631958,
0.10218193382024765,
-0.050037138164043427,
-0.07547522336244583,
-0.032350316643714905,
0.058412276208400726,
0.05427921935915947,
0.017368154600262642,
0.0017144649755209684,
0.023247521370649338,
0.06740185618400574,
-0.04594476893544197,
0.002109783235937357,
0.04236103594303131,
0.010854511521756649,
0.009552067145705223,
-0.00900220312178135,
-0.04547320678830147,
-0.11898603290319443,
-0.021373607218265533,
0.0044763656333088875,
-0.042296335101127625,
0.026561075821518898,
0.01664366014301777,
0.03183762729167938,
-0.028567446395754814,
0.04455503821372986,
0.012266343459486961,
-0.04333437606692314,
0.03275080397725105,
0.0042121452279388905,
-0.018845975399017334,
0.028483960777521133,
-0.04895230382680893,
-0.07559306174516678,
-0.057567253708839417,
-0.015092648565769196,
-0.011219137348234653,
0.07259611785411835,
0.04890488460659981,
-0.09693574905395508,
0.047812189906835556,
0.0004901775391772389,
-0.0673677995800972,
-0.030995653942227364,
0.025798648595809937,
-0.014480340294539928,
0.04711053892970085,
-0.023786557838320732,
-0.06518710404634476,
0.027081545442342758,
0.02992394007742405,
0.0005629374645650387,
0.027991006150841713,
-0.014104494825005531,
0.04845060408115387,
-0.04526946693658829,
0.01632944494485855,
0.05754395201802254,
-0.007333969697356224,
-0.006038525607436895,
0.022368725389242172,
-0.07298624515533447,
0.07212230563163757,
0.04706192761659622,
-0.06241464614868164,
0.0037195945624262094,
0.009649761021137238,
0.0228341743350029,
-0.03761978819966316,
0.057823244482278824,
-0.0755946934223175,
-0.07973849028348923,
-0.005376284476369619,
-0.01110913697630167,
0.05867031589150429,
0.0181009229272604,
-0.05846363306045532,
-0.02500319480895996,
-0.09195014834403992,
-0.008706759661436081,
-0.03727121651172638,
-0.14203117787837982,
-0.08339520543813705,
0.008200576528906822,
-1.2646600972714698e-33,
0.017716431990265846,
0.031619392335414886,
-0.02824375405907631,
0.04604009911417961,
0.006924978923052549,
-0.019253822043538094,
0.08861193060874939,
-0.005420963279902935,
0.09625019133090973,
0.040015850216150284,
-0.004001104272902012,
-0.00974282342940569,
-0.018478473648428917,
-0.07787789404392242,
-0.02269584871828556,
0.06621994078159332,
-0.16075938940048218,
-0.07514815777540207,
0.01342733670026064,
-0.0097897844389081,
-0.010877189226448536,
0.0750143751502037,
0.031831301748752594,
0.055664822459220886,
-0.080748051404953,
-0.04124131798744202,
-0.03772453963756561,
-0.08904679119586945,
-0.06472611427307129,
0.005582304671406746,
0.024852963164448738,
0.004505107179284096,
-0.06190995126962662,
0.07854806631803513,
-0.009617670439183712,
-0.07076152414083481,
0.06947304308414459,
0.006390036083757877,
-0.06451824307441711,
0.1593417376279831,
-0.005665116012096405,
0.06270820647478104,
-0.08333168178796768,
0.053046245127916336,
0.037934593856334686,
0.09896062314510345,
0.06772845983505249,
0.06695283949375153,
0.01045901421457529,
-0.09426786750555038,
0.020629752427339554,
-0.0007941494113765657,
-0.04899172484874725,
0.05460495129227638,
-0.021627994254231453,
-0.026425806805491447,
-0.047712020576000214,
-0.04718438535928726,
-0.1311313658952713,
0.05428273603320122,
0.01932821422815323,
-0.0018727199640125036,
-0.05208649858832359,
-0.030482549220323563,
0.00998742412775755,
-0.0557732991874218,
-0.0295391958206892,
0.03162494674324989,
-0.004259446170181036,
0.002786344615742564,
-0.01443939283490181,
-0.0015783295966684818,
0.1346353441476822,
-0.07375849783420563,
0.03443268686532974,
0.060214754194021225,
-0.03806435316801071,
-0.004119191784411669,
0.07134668529033661,
0.0011712143896147609,
0.02864695154130459,
-0.040317364037036896,
0.026011917740106583,
0.048451803624629974,
-0.0474933497607708,
0.0061170668341219425,
0.06316271424293518,
0.08504137396812439,
-0.02072732523083687,
-0.013118729926645756,
-0.033285416662693024,
0.03480300307273865,
0.01439318060874939,
0.009670020081102848,
0.008883749134838581,
-5.3328765403648504e-8,
-0.0020606177859008312,
0.049888744950294495,
-0.10941567271947861,
0.07972943037748337,
-0.05586925148963928,
-0.03392012044787407,
-0.02356410026550293,
0.04681016132235527,
-0.03368334099650383,
0.01646488718688488,
-0.009252769872546196,
-0.019167466089129448,
-0.033249013125896454,
-0.022013597190380096,
-0.08238152414560318,
-0.03063223510980606,
0.01121352519840002,
0.10705395042896271,
-0.022367626428604126,
0.0015016052639111876,
0.03495614603161812,
-0.01773662678897381,
0.020170297473669052,
0.027780402451753616,
0.07895618677139282,
0.015525398775935173,
-0.013400531373918056,
-0.006253688130527735,
0.06026812270283699,
0.004101073835045099,
0.0028589621651917696,
-0.03693895787000656,
0.037352535873651505,
-0.045970551669597626,
-0.0012457784032449126,
0.02022291161119938,
0.07510709762573242,
0.02993892878293991,
-0.025258183479309082,
0.05385784059762955,
-0.03231167048215866,
-0.055068425834178925,
-0.024245483800768852,
0.03565749153494835,
-0.024551959708333015,
-0.06822390109300613,
-0.03532585874199867,
0.016831399872899055,
0.050777919590473175,
-0.1084611788392067,
0.06985261291265488,
-0.09758909046649933,
-0.04982471838593483,
-0.021117134019732475,
-0.02582395449280739,
-0.046111948788166046,
0.04764566570520401,
0.05103454366326332,
-0.0938759595155716,
-0.07694700360298157,
0.06397552043199539,
-0.06870242953300476,
-0.021624000743031502,
0.03947124257683754
] | 0.019353
|
[[search-aggregations-metrics-avg-aggregation]] === Avg Aggregation A `single-value` metrics aggregation that computes the average of numeric values that are extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. Assuming the data consists of documents representing exams grades (between 0 and 100) of students we can average their scores with: [source,js] -------------------------------------------------- POST /exams/\_search?size=0 { "aggs" : { "avg\_grade" : { "avg" : { "field" : "grade" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] The above aggregation computes the average grade over all documents. The aggregation type is `avg` and the `field` setting defines the numeric field of the documents the average will be computed on. The above will return the following: [source,js] -------------------------------------------------- { ... "aggregations": { "avg\_grade": { "value": 75.0 } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] The name of the aggregation (`avg\_grade` above) also serves as the key by which the aggregation result can be retrieved from the returned response. ==== Script Computing the average grade based on a script: [source,js] -------------------------------------------------- POST /exams/\_search?size=0 { "aggs" : { "avg\_grade" : { "avg" : { "script" : { "source" : "doc.grade.value" } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a stored script use the following syntax: [source,js] -------------------------------------------------- POST /exams/\_search?size=0 { "aggs" : { "avg\_grade" : { "avg" : { "script" : { "id": "my\_script", "params": { "field": "grade" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams,stored\_example\_script] ===== Value Script It turned out that the exam was way above the level of the students and a grade correction needs to be applied. We can use value script to get the new average: [source,js] -------------------------------------------------- POST /exams/\_search?size=0 { "aggs" : { "avg\_corrected\_grade" : { "avg" : { "field" : "grade", "script" : { "lang": "painless", "source": "\_value \* params.correction", "params" : { "correction" : 1.2 } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] ==== Missing value The `missing` parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value. [source,js] -------------------------------------------------- POST /exams/\_search?size=0 { "aggs" : { "grade\_avg" : { "avg" : { "field" : "grade", "missing": 10 <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:exams] <1> Documents without a value in the `grade` field will fall into the same bucket as documents that have the value `10`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/avg-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.0061426726169884205,
0.10282306373119354,
-0.04462441802024841,
0.0945427417755127,
-0.024937503039836884,
0.033346161246299744,
-0.00010762883175630122,
0.07666376233100891,
0.02901112474501133,
-0.005982912611216307,
-0.03250296786427498,
-0.04673932120203972,
0.01883845403790474,
0.008269173093140125,
-0.04197309911251068,
0.0043303207494318485,
-0.07296650111675262,
0.02791217342019081,
-0.02896159142255783,
-0.09539401531219482,
-0.0026782271452248096,
0.014667891897261143,
0.016119694337248802,
-0.07544519007205963,
0.06844528019428253,
0.05111192911863327,
-0.09943536669015884,
-0.02404547482728958,
0.0070678237825632095,
0.03638691455125809,
-0.07068543881177902,
-0.025764821097254753,
0.06696286052465439,
0.07145390659570694,
-0.04857156053185463,
-0.07105995714664459,
0.007913388311862946,
0.013330692425370216,
-0.0023604047019034624,
0.01466715894639492,
-0.004918108228594065,
0.009379342198371887,
0.0070609659887850285,
-0.07209866493940353,
0.041330061852931976,
-0.10586553066968918,
-0.11133109033107758,
-0.06510484218597412,
0.010981673374772072,
0.06734313815832138,
-0.0380755215883255,
0.0034100650809705257,
-0.062108755111694336,
-0.00884317047894001,
-0.007440025918185711,
0.059296853840351105,
-0.015196730382740498,
-0.08479249477386475,
-0.02210685797035694,
-0.09789622575044632,
-0.09294010698795319,
-0.06755663454532623,
0.011606764979660511,
-0.006718177814036608,
0.0013968988787382841,
-0.02775203250348568,
0.007931367494165897,
0.05319736525416374,
-0.008441627956926823,
0.08613211661577225,
0.02361811324954033,
-0.0029717751313000917,
0.06140432879328728,
-0.0755309909582138,
0.04662017896771431,
0.06668087840080261,
-0.08245914429426193,
-0.01873777247965336,
0.07618614286184311,
0.083201564848423,
-0.06530442833900452,
-0.10817041993141174,
-0.014958963729441166,
0.022899344563484192,
0.034282147884368896,
-0.03362353891134262,
0.12062740325927734,
-0.02778783068060875,
0.05220229923725128,
0.00716423150151968,
-0.10120822489261627,
0.020817279815673828,
-0.035298533737659454,
0.034805767238140106,
0.06814903765916824,
0.030418869107961655,
0.022438988089561462,
-0.08116495609283447,
0.0941849872469902,
0.03799775615334511,
0.024684928357601166,
0.028101079165935516,
0.02433333732187748,
-0.06467431038618088,
-0.06865139305591583,
-0.006089233327656984,
0.05457329750061035,
-0.010242030024528503,
-0.03920122981071472,
-0.05639136582612991,
0.004267244599759579,
0.03028327226638794,
0.012050008401274681,
-0.018628796562552452,
-0.026144608855247498,
0.02093789167702198,
0.1059710681438446,
-0.0005783522501587868,
0.05882595479488373,
0.06930399686098099,
0.05536908283829689,
0.03446552902460098,
0.02540726214647293,
-0.013698077760636806,
0.05606360733509064,
0.027809247374534607,
0.026717564091086388,
-3.726043054986116e-33,
0.018713131546974182,
-0.09459351748228073,
0.01003989763557911,
-0.04542826488614082,
-0.031222214922308922,
0.019317708909511566,
0.04156076908111572,
0.1031455397605896,
-0.03118959814310074,
0.018886378034949303,
-0.02601630985736847,
0.12863518297672272,
0.0025708151515573263,
-0.03777354583144188,
0.0635894387960434,
0.015157918445765972,
-0.025265619158744812,
0.0054505751468241215,
0.014763052575290203,
0.006109791342169046,
0.07356858253479004,
-0.04287533089518547,
0.031131522729992867,
0.054158348590135574,
0.0023244600743055344,
-0.029785949736833572,
-0.03337237611413002,
-0.03673864156007767,
-0.08814708888530731,
-0.015844227746129036,
0.015086391940712929,
-0.0030483959708362818,
-0.058435410261154175,
-0.031057141721248627,
0.013017135672271252,
0.0025173742324113846,
0.04360288381576538,
0.08690482378005981,
-0.007652691565454006,
0.017659274861216545,
0.05074388533830643,
-0.031880006194114685,
0.030884364619851112,
-0.10855599492788315,
-0.11559071391820908,
0.052164290100336075,
-0.0408623144030571,
0.027594050392508507,
0.06602408736944199,
0.01296731922775507,
-0.09420529752969742,
-0.023480219766497612,
-0.031199270859360695,
0.0018492542440071702,
-0.005157878156751394,
0.04293384775519371,
0.019732879474759102,
0.10267597436904907,
-0.03994922712445259,
-0.08712070435285568,
-0.041678331792354584,
0.007177968975156546,
0.02826610580086708,
-0.003249329049140215,
-0.03344789892435074,
0.022814573720097542,
-0.03875460848212242,
0.03143550828099251,
0.04310489818453789,
0.04923449084162712,
0.03982342779636383,
0.040383853018283844,
-0.04533110186457634,
-0.03454473242163658,
0.030165910720825195,
-0.02739351987838745,
0.03970922529697418,
0.023880204185843468,
-0.028393251821398735,
-0.008831460028886795,
0.02434026636183262,
-0.006573197897523642,
-0.014956369996070862,
-0.05766410008072853,
0.01183569896966219,
0.1132832020521164,
-0.041065458208322525,
-0.01825593411922455,
-0.06322158128023148,
-0.0939716175198555,
-0.06277275830507278,
-0.0017059247475117445,
-0.08698470890522003,
-0.07539556920528412,
-0.019771911203861237,
6.99365644562749e-34,
0.012275246903300285,
0.03639998286962509,
0.01471036672592163,
0.05566687509417534,
0.07509376853704453,
0.001917797140777111,
0.02384515106678009,
-0.0005644229240715504,
0.02245297282934189,
0.03828880563378334,
-0.040813494473695755,
-0.005065593868494034,
0.007422077935189009,
-0.09115858376026154,
-0.0064767044968903065,
0.022661499679088593,
-0.10445170849561691,
-0.06937062740325928,
0.03204610198736191,
0.005355612840503454,
-0.05691351369023323,
0.05517754703760147,
0.06358067691326141,
0.10590416938066483,
0.028651317581534386,
-0.054529543966054916,
0.009839299134910107,
-0.05887411907315254,
-0.07677362859249115,
0.008263835683465004,
0.008889605291187763,
-0.04463778808712959,
-0.0028849972877651453,
0.07734101265668869,
-0.06309448182582855,
-0.056520067155361176,
0.07621512562036514,
-0.05811421945691109,
-0.08140838146209717,
0.10128788650035858,
-0.026618346571922302,
0.013697169721126556,
-0.08670347183942795,
0.01245432160794735,
0.09214544296264648,
0.08179937303066254,
0.01926923543214798,
0.03862796351313591,
-0.0569595992565155,
-0.09482880681753159,
-0.01402632612735033,
0.018304359167814255,
-0.05812954157590866,
0.07530318200588226,
-0.05200665816664696,
-0.0073542483150959015,
-0.021747715771198273,
-0.07425962388515472,
-0.0845901295542717,
0.053205154836177826,
0.027609864249825478,
-0.03431251272559166,
-0.05014404281973839,
0.022456474602222443,
0.019058464094996452,
-0.040211427956819534,
0.013577603735029697,
-0.03490729257464409,
-0.10363048315048218,
0.05620342120528221,
0.01251001376658678,
0.003568268846720457,
0.12721356749534607,
0.00022357139096129686,
0.03874766454100609,
0.036321092396974564,
0.01141170784831047,
0.02084788866341114,
0.03732634335756302,
-0.014847053214907646,
0.007653071079403162,
0.005041499622166157,
0.029915988445281982,
0.06268340349197388,
-0.06819882988929749,
-0.01388592179864645,
0.1061469092965126,
0.07376108318567276,
-0.003632431384176016,
0.04115001857280731,
-0.07159233838319778,
0.003015488153323531,
0.018800457939505577,
-0.028718076646327972,
0.016917193308472633,
-4.1892601387871764e-8,
-0.022886859253048897,
-0.018655672669410706,
-0.08992752432823181,
0.11060609668493271,
-0.08864650130271912,
0.04621182009577751,
-0.044858090579509735,
0.04976092651486397,
-0.021635660901665688,
-0.021639948710799217,
0.019390832632780075,
-0.028164658695459366,
-0.0580238476395607,
0.03240399807691574,
-0.031234921887516975,
-0.0004714038223028183,
-0.020992469042539597,
0.11220967769622803,
-0.006673463154584169,
-0.040698178112506866,
0.06334110349416733,
0.009407629258930683,
0.03594851866364479,
-0.010870872065424919,
0.025076590478420258,
0.01592680998146534,
-0.00541843893006444,
-0.0245165154337883,
0.024584367871284485,
-0.020517244935035706,
-0.044156935065984726,
-0.029407376423478127,
0.007195357233285904,
-0.03091181069612503,
0.023352472111582756,
-0.010816293768584728,
0.03803002089262009,
0.025025520473718643,
-0.025255506858229637,
0.05320776253938675,
0.004474760964512825,
-0.011220531538128853,
-0.05390414968132973,
-0.006550852674990892,
-0.0010314838727936149,
-0.022169701755046844,
-0.09266844391822815,
0.031574465334415436,
0.1281750351190567,
-0.01797458529472351,
0.09653948247432709,
-0.08188434690237045,
-0.08416588604450226,
-0.03624118119478226,
-0.02620147354900837,
-0.08732903748750687,
0.04752019792795181,
-0.013960437849164009,
-0.033088795840740204,
-0.046104516834020615,
0.06979180127382278,
-0.0773579403758049,
-0.04462914168834686,
-0.0009317012154497206
] | 0.00036
|
[[search-aggregations-metrics-valuecount-aggregation]] === Value Count Aggregation A `single-value` metrics aggregation that counts the number of values that are extracted from the aggregated documents. These values can be extracted either from specific fields in the documents, or be generated by a provided script. Typically, this aggregator will be used in conjunction with other single-value aggregations. For example, when computing the `avg` one might be interested in the number of values the average is computed over. [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "types\_count" : { "value\_count" : { "field" : "type" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] Response: [source,js] -------------------------------------------------- { ... "aggregations": { "types\_count": { "value": 7 } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] The name of the aggregation (`types\_count` above) also serves as the key by which the aggregation result can be retrieved from the returned response. ==== Script Counting the values generated by a script: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "type\_count" : { "value\_count" : { "script" : { "source" : "doc['type'].value" } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a stored script use the following syntax: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "types\_count" : { "value\_count" : { "script" : { "id": "my\_script", "params" : { "field" : "type" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales,stored\_example\_script]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/valuecount-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.03617018088698387,
0.06232984736561775,
-0.03641095384955406,
0.15324674546718597,
-0.05123303458094597,
0.06174129992723465,
0.02371235378086567,
0.07430744916200638,
0.12193670868873596,
-0.06637485325336456,
-0.054722514003515244,
-0.02522737719118595,
0.025674523785710335,
-0.04100370407104492,
-0.05020596459507942,
0.016601821407675743,
-0.06164633110165596,
-0.012518790550529957,
-0.029930975288152695,
-0.10148545354604721,
0.04577212408185005,
0.007913358509540558,
0.0223760437220335,
-0.08900821208953857,
0.05956577509641647,
0.0014958283863961697,
-0.14650443196296692,
0.001603327109478414,
0.05314183235168457,
0.03216627985239029,
-0.040105633437633514,
0.03818533197045326,
0.08309546113014221,
0.07392068952322006,
-0.027305733412504196,
-0.042920712381601334,
-0.008027834817767143,
-0.00923381932079792,
0.017629120498895645,
-0.0003173760778736323,
0.03321406617760658,
0.01900847814977169,
-0.01585581712424755,
-0.07432574033737183,
0.03145492821931839,
-0.06338682770729065,
-0.07767343521118164,
-0.025279324501752853,
-0.03403830900788307,
0.05644603446125984,
-0.025360994040966034,
0.059158336371183395,
-0.08287815749645233,
0.041701540350914,
0.07366400957107544,
0.04202023148536682,
-0.08676077425479889,
-0.0484551303088665,
-0.016726231202483177,
-0.055814262479543686,
-0.03058059886097908,
-0.07146774232387543,
-0.014054844155907631,
-0.03429265692830086,
0.003003515303134918,
-0.020778069272637367,
0.009771383367478848,
0.04506498947739601,
-0.04033568501472473,
0.00909271091222763,
0.024115711450576782,
-0.0066924630664289,
0.025598175823688507,
-0.06236741319298744,
0.02222750522196293,
0.048806410282850266,
-0.07032801955938339,
-0.0275958813726902,
0.055232226848602295,
0.03730746731162071,
-0.04956946149468422,
-0.08385585248470306,
-0.04749501496553421,
0.048727646470069885,
-0.007784770801663399,
-0.04441465064883232,
0.0484238862991333,
-0.03477818891406059,
0.09909508377313614,
0.0060781314969062805,
-0.07646279782056808,
-0.03491418808698654,
-0.043233297765254974,
0.010662578046321869,
0.04535548388957977,
0.030298255383968353,
-0.030707677826285362,
-0.03133557364344597,
0.10986725240945816,
0.018145175650715828,
0.024047236889600754,
0.005579102318733931,
0.08518856018781662,
-0.05698208138346672,
-0.058319155126810074,
-0.013619950041174889,
-0.0098013486713171,
0.04569029062986374,
-0.05452999100089073,
0.006802082527428865,
-0.0028317496180534363,
0.03400822728872299,
0.012779589742422104,
0.015276760794222355,
0.0025848476216197014,
0.05922674387693405,
0.05771062150597572,
-0.03772320598363876,
0.06346525251865387,
0.052455030381679535,
0.05015207827091217,
0.013140079565346241,
0.06214730069041252,
-0.006392249371856451,
0.023203225806355476,
0.05686355009675026,
0.036452408879995346,
1.166265801813371e-33,
-0.011462648399174213,
-0.07147974520921707,
0.048645734786987305,
-0.05180760473012924,
-0.021004265174269676,
0.038805585354566574,
0.0247831791639328,
0.08687375485897064,
-0.023393424227833748,
0.04814567044377327,
-0.04072839021682739,
0.1502004861831665,
-0.02113841474056244,
-0.015964416787028313,
0.04649648815393448,
0.0054780603386461735,
-0.0015920137520879507,
0.013769866898655891,
0.009653308428823948,
-0.030393553897738457,
0.08744406700134277,
-0.012745948508381844,
0.007236910052597523,
0.1043471097946167,
0.021976860240101814,
-0.0171830914914608,
-0.04112640768289566,
0.0019369568908587098,
-0.11241325736045837,
-0.014918317086994648,
0.01373545452952385,
0.03783571347594261,
-0.014747239649295807,
-0.05156422033905983,
0.020890381187200546,
0.006680469028651714,
-0.01734255813062191,
0.04495764896273613,
-0.006401806604117155,
-0.0191859882324934,
0.03618805482983589,
0.004706722684204578,
0.014326922595500946,
-0.14156393706798553,
-0.14864715933799744,
0.03400808200240135,
-0.025321494787931442,
-0.005283644888550043,
0.06399135291576385,
0.034594640135765076,
-0.01820552721619606,
-0.013071602210402489,
0.02881924994289875,
0.05139246955513954,
0.06297373026609421,
0.04105724021792412,
-0.003922413568943739,
0.08846139907836914,
-0.017728731036186218,
-0.012502249330282211,
-0.057195477187633514,
0.016230346634984016,
0.06084463372826576,
-0.04165156930685043,
-0.008030792698264122,
0.05867663025856018,
-0.0031596561893820763,
0.08355409651994705,
0.022517189383506775,
0.07804984599351883,
0.07926617562770844,
0.05912044271826744,
-0.06973475217819214,
-0.012503323145210743,
0.022305097430944443,
-0.0673859640955925,
0.04446645826101303,
0.0024485697504132986,
-0.04456541687250137,
0.02454950287938118,
-0.04309060424566269,
0.013094966299831867,
0.03882313147187233,
0.029145069420337677,
0.007205631583929062,
0.12502482533454895,
-0.032132185995578766,
0.0029431695584207773,
-0.04760035127401352,
-0.08285193145275116,
-0.006599838845431805,
0.006309805903583765,
-0.11777875572443008,
-0.10730607062578201,
-0.09090866148471832,
-4.0395051540221874e-33,
-0.04340555518865585,
-0.003684909548610449,
-0.0014602873707190156,
0.03479704633355141,
0.01964266411960125,
-0.01626664400100708,
0.004096501972526312,
0.0020482942927628756,
0.05569858476519585,
0.013010913506150246,
-0.05253690481185913,
0.007327653001993895,
0.009055979549884796,
-0.06903146207332611,
0.009102104231715202,
0.005886989179998636,
-0.1016061007976532,
-0.11107103526592255,
0.04047975689172745,
0.039666544646024704,
-0.05842588096857071,
0.011613857932388783,
0.055022306740283966,
0.12089211493730545,
-0.01470643375068903,
-0.029539616778492928,
0.014225566759705544,
-0.03345229849219322,
-0.06881166249513626,
-0.005162758287042379,
0.057767365127801895,
-0.058130599558353424,
0.013640973716974258,
0.05146970972418785,
-0.06614367663860321,
-0.08232767879962921,
0.08926157653331757,
0.004353522788733244,
-0.02265571616590023,
0.027337385341525078,
-0.03797425329685211,
-0.00003099393507000059,
-0.03980690613389015,
-0.009016741998493671,
0.04554632306098938,
0.033682744950056076,
0.03082868456840515,
0.04110097885131836,
-0.006120825186371803,
-0.13252772390842438,
0.009886409156024456,
0.026668228209018707,
-0.09593662619590759,
0.10371829569339752,
-0.1368020921945572,
-0.053227607160806656,
-0.013873324729502201,
-0.05738760158419609,
-0.06024060398340225,
0.00024022336583584547,
-0.010717696510255337,
-0.04296273738145828,
-0.05072006583213806,
0.0037624554242938757,
0.021269716322422028,
-0.04241018742322922,
-0.014313772320747375,
-0.08309967070817947,
-0.10184893757104874,
-0.004738816060125828,
0.01932642236351967,
-0.039481181651353836,
0.08742272853851318,
0.03209362551569939,
-0.02852683886885643,
0.032874006778001785,
0.024852408096194267,
-0.01583758369088173,
0.04751663655042648,
-0.05659831687808037,
-0.015416604466736317,
0.0008984103915281594,
0.0672510489821434,
0.05245466157793999,
-0.10196959972381592,
-0.023875383660197258,
0.029070498421788216,
0.04812207445502281,
-0.04909948632121086,
0.043612025678157806,
-0.07961641252040863,
-0.019213855266571045,
-0.032466333359479904,
-0.009812611155211926,
0.0008724482613615692,
-5.266455715968732e-8,
-0.06298093497753143,
-0.016813991591334343,
-0.05896317586302757,
0.03363233059644699,
-0.014583497308194637,
0.053318995982408524,
-0.003855728777125478,
0.10030726343393326,
-0.03146712854504585,
-0.039130792021751404,
0.012023994699120522,
-0.034906379878520966,
-0.08499559760093689,
0.04920949786901474,
-0.02570214867591858,
-0.020807990804314613,
0.005754601676017046,
0.05644778162240982,
-0.02208605222404003,
-0.0506698377430439,
0.06331273913383484,
-0.004190726205706596,
0.04607190936803818,
-0.06318032741546631,
0.053424447774887085,
-0.02111380361020565,
-0.01722981594502926,
0.001518470817245543,
0.034636564552783966,
-0.04923740774393082,
-0.02706485241651535,
0.00007771942182444036,
0.006064557936042547,
0.013667811639606953,
0.04712628945708275,
0.02924916334450245,
0.0034371784422546625,
-0.024790240451693535,
-0.06567786633968353,
0.03923138976097107,
0.02115984819829464,
0.015267390757799149,
-0.0332387275993824,
0.019935637712478638,
-0.02747849002480507,
0.016731131821870804,
-0.05684223398566246,
0.0022644544951617718,
0.0992300882935524,
-0.03052753023803234,
0.09038571268320084,
-0.07916248589754105,
-0.06128312274813652,
-0.018394099548459053,
-0.07632105052471161,
-0.08257878571748734,
0.026249205693602562,
-0.04662792384624481,
0.07017692178487778,
-0.0010153364855796099,
0.02755429595708847,
-0.09056270867586136,
-0.034914661198854446,
-0.014363215304911137
] | 0.058339
|
[[search-aggregations-metrics-max-aggregation]] === Max Aggregation A `single-value` metrics aggregation that keeps track and returns the maximum value among the numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. NOTE: The `min` and `max` aggregation operate on the `double` representation of the data. As a consequence, the result may be approximate when running on longs whose absolute value is greater than +2^53+. Computing the max price value across all documents [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "max\_price" : { "max" : { "field" : "price" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] Response: [source,js] -------------------------------------------------- { ... "aggregations": { "max\_price": { "value": 200.0 } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] As can be seen, the name of the aggregation (`max\_price` above) also serves as the key by which the aggregation result can be retrieved from the returned response. ==== Script The `max` aggregation can also calculate the maximum of a script. The example below computes the maximum price: [source,js] -------------------------------------------------- POST /sales/\_search { "aggs" : { "max\_price" : { "max" : { "script" : { "source" : "doc.price.value" } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] This will use the <> scripting language and no script parameters. To use a stored script use the following syntax: [source,js] -------------------------------------------------- POST /sales/\_search { "aggs" : { "max\_price" : { "max" : { "script" : { "id": "my\_script", "params": { "field": "price" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales,stored\_example\_script] ==== Value Script Let's say that the prices of the documents in our index are in USD, but we would like to compute the max in EURO (and for the sake of this example, let's say the conversion rate is 1.2). We can use a value script to apply the conversion rate to every value before it is aggregated: [source,js] -------------------------------------------------- POST /sales/\_search { "aggs" : { "max\_price\_in\_euros" : { "max" : { "field" : "price", "script" : { "source" : "\_value \* params.conversion\_rate", "params" : { "conversion\_rate" : 1.2 } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] ==== Missing value The `missing` parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value. [source,js] -------------------------------------------------- POST /sales/\_search { "aggs" : { "grade\_max" : { "max" : { "field" : "grade", "missing": 10 <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> Documents without a value in the `grade` field will fall into the same bucket as documents that have the value `10`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/max-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.03387729078531265,
0.04152243584394455,
-0.0082011129707098,
0.046326249837875366,
-0.05056170001626015,
0.01627490483224392,
-0.06876234710216522,
0.08990897238254547,
0.0950392410159111,
-0.021446656435728073,
-0.10276414453983307,
0.003984968643635511,
0.006881916429847479,
0.03336973860859871,
-0.016367187723517418,
0.015811031684279442,
0.013699427247047424,
0.051216308027505875,
-0.11923803389072418,
-0.07833140343427658,
0.05067805200815201,
0.007985882461071014,
0.0033975085243582726,
-0.03510349988937378,
0.042641203850507736,
-0.00802087876945734,
-0.08215279132127762,
-0.033114537596702576,
0.03980275243520737,
0.018466241657733917,
-0.05071308836340904,
-0.027628466486930847,
0.06991435587406158,
0.08301331847906113,
0.022383246570825577,
-0.07122441381216049,
-0.028894025832414627,
-0.05435294285416603,
0.021673552691936493,
-0.00036716338945552707,
0.009388766251504421,
0.011452051810920238,
-0.0893549919128418,
-0.054268207401037216,
0.04352806136012077,
-0.04142482578754425,
-0.0476282499730587,
0.018610617145895958,
0.0214853435754776,
0.0979335606098175,
-0.06898980587720871,
0.06517791002988815,
0.008620994165539742,
0.052023861557245255,
0.02159997448325157,
-0.0032400444615632296,
-0.05127901956439018,
-0.05607068911194801,
0.03407227620482445,
-0.04582447558641434,
-0.03654639422893524,
-0.046863265335559845,
0.004683645907789469,
-0.024896366521716118,
0.015026985667645931,
-0.03887788578867912,
0.0024681654758751392,
0.0019712536595761776,
-0.06802037358283997,
0.07603561878204346,
0.08203862607479095,
0.0026481507811695337,
0.04841317608952522,
-0.06973669677972794,
0.06195187196135521,
0.032404977828264236,
-0.018062399700284004,
-0.03973236680030823,
0.013724026270210743,
0.0020278184674680233,
-0.033544931560754776,
-0.09950811415910721,
-0.008741448633372784,
-0.017759395763278008,
0.03210236877202988,
-0.04962088540196419,
0.016959499567747116,
-0.001709719537757337,
0.1262919306755066,
0.0031146237161010504,
-0.0818122923374176,
-0.010199607349932194,
-0.045885879546403885,
0.03736526891589165,
0.013680948875844479,
0.028511833399534225,
-0.02933754213154316,
0.0005598359275609255,
0.08357249945402145,
-0.016520852223038673,
0.0431797094643116,
-0.050372011959552765,
0.06014919653534889,
-0.06167689338326454,
-0.02424716204404831,
-0.05006520450115204,
-0.04559895023703575,
0.01244696881622076,
-0.04697268456220627,
-0.06302610039710999,
0.0026332023553550243,
-0.025105232372879982,
-0.010089211165904999,
-0.016844432801008224,
-0.005758422426879406,
0.052055709064006805,
0.04570719972252846,
-0.01527478825300932,
0.017101338133215904,
0.03840192034840584,
0.03992987424135208,
0.022650813683867455,
0.002239047782495618,
0.046334028244018555,
0.0022060691844671965,
0.08974532783031464,
0.062340013682842255,
4.1411012940538345e-34,
-0.028172597289085388,
-0.0542428120970726,
0.041770778596401215,
-0.1218566820025444,
-0.061916641891002655,
0.04655933752655983,
-0.0007744842441752553,
0.07936720550060272,
-0.05704685300588608,
0.06245573237538338,
-0.07179553806781769,
0.12988747656345367,
-0.026913704350590706,
-0.057577818632125854,
0.04512174054980278,
-0.012896720319986343,
-0.0021642562933266163,
-0.028770864009857178,
0.02350694127380848,
-0.03319338709115982,
0.05865246057510376,
-0.03137708082795143,
-0.01629229076206684,
0.06934922933578491,
-0.005734021309763193,
0.016203679144382477,
0.011809243820607662,
0.012661450542509556,
-0.08308588713407516,
0.0027333947364240885,
-0.07032229006290436,
-0.02224278450012207,
0.0065494864247739315,
-0.00948666874319315,
-0.026341017335653305,
0.006376449018716812,
-0.019609631970524788,
0.04394654929637909,
-0.03162942826747894,
0.03809759393334389,
-0.023932533338665962,
0.0448489710688591,
0.032957009971141815,
-0.07743756473064423,
-0.0765615925192833,
0.09675996005535126,
-0.003923667129129171,
0.034206323325634,
0.03256148472428322,
-0.0022180520463734865,
-0.09150461107492447,
-0.02328542433679104,
-0.02056862600147724,
0.014977426268160343,
0.05455733835697174,
-0.03368830308318138,
0.013446870259940624,
0.03125547245144844,
0.00017275944992434233,
-0.011547870002686977,
-0.049679916352033615,
-0.02316584810614586,
0.044856276363134384,
0.04078379273414612,
-0.05537187680602074,
0.03993244469165802,
-0.0019963104277849197,
0.10030034929513931,
0.02224714681506157,
0.07718770951032639,
0.07254121452569962,
0.0669313445687294,
0.0433579683303833,
-0.010461891070008278,
0.049093954265117645,
-0.06317228823900223,
0.12230289727449417,
0.09356055408716202,
0.021212927997112274,
0.015268031507730484,
-0.057885363698005676,
0.021601969376206398,
0.0809190422296524,
0.030063053593039513,
-0.049039099365472794,
0.11784627288579941,
-0.09298712760210037,
0.0012274796608835459,
-0.07296478748321533,
-0.04308496043086052,
-0.011779321357607841,
0.042430683970451355,
-0.06690225005149841,
-0.09381133317947388,
-0.005680656526237726,
-1.895806983292453e-33,
0.012180105783045292,
-0.015034705400466919,
0.026599271222949028,
0.04916851967573166,
-0.0028321705758571625,
-0.021161405369639397,
-0.05663936957716942,
0.04652339220046997,
-0.001344018615782261,
0.012629322707653046,
0.008370515890419483,
-0.01687285117805004,
0.021341104060411453,
-0.04283585026860237,
-0.04252862185239792,
-0.018583113327622414,
-0.037499573081731796,
-0.09440069645643234,
0.07869754731655121,
-0.038529228419065475,
-0.04639321565628052,
0.0625959113240242,
0.004480518866330385,
0.1759863793849945,
0.0073062963783741,
-0.0527016818523407,
0.015485243871808052,
-0.03208790719509125,
-0.049184106290340424,
0.01291666366159916,
0.014447733759880066,
-0.05694803223013878,
-0.03817950189113617,
0.0647185891866684,
-0.06975272297859192,
-0.021968243643641472,
0.05615205317735672,
0.009898804128170013,
0.002473678207024932,
0.06644755601882935,
-0.013588875532150269,
-0.010111251845955849,
-0.03445443883538246,
0.007573815993964672,
0.10350778698921204,
-0.037406399846076965,
0.002265100833028555,
0.019911721348762512,
0.019409867003560066,
-0.09864480793476105,
-0.013342642225325108,
0.012686436995863914,
-0.02318340353667736,
0.09338303655385971,
-0.09442465007305145,
-0.06247788295149803,
-0.05573737621307373,
-0.03858652338385582,
-0.03955622389912605,
-0.0599900521337986,
0.03391728922724724,
0.020712299272418022,
-0.05094529315829277,
0.092676542699337,
0.010249162092804909,
-0.024886230006814003,
-0.019247306510806084,
-0.07271883636713028,
-0.029070818796753883,
-0.001014965819194913,
0.02070629969239235,
-0.028346620500087738,
0.09732324630022049,
0.05905279517173767,
-0.08272171020507812,
0.02501533180475235,
0.014997533522546291,
-0.022992409765720367,
0.09091456979513168,
-0.015402338467538357,
0.008826379664242268,
0.08337586373090744,
0.07094145566225052,
0.10989563167095184,
-0.07063917815685272,
-0.010891808196902275,
-0.028911404311656952,
0.0965806171298027,
-0.01371617242693901,
0.010548057965934277,
-0.11512786895036697,
-0.048066943883895874,
-0.021890128031373024,
-0.06250259280204773,
-0.04682060703635216,
-4.779734297244431e-8,
-0.06948584318161011,
0.03503482788801193,
-0.08734321594238281,
0.018027428537607193,
0.03250831365585327,
0.01954990066587925,
0.08015991747379303,
0.12891393899917603,
0.0010825075441971421,
0.023514023050665855,
0.013683238066732883,
0.02415781468153,
-0.0857345312833786,
0.018188491463661194,
-0.11273109167814255,
-0.012280160561203957,
0.05406162142753601,
-0.0004522859235294163,
0.033039484173059464,
-0.03778030350804329,
0.04904637858271599,
0.0629820004105568,
0.025138746947050095,
-0.00726811308413744,
0.07086484134197235,
0.00277431751601398,
-0.037162650376558304,
0.0448044091463089,
0.06622331589460373,
-0.027672190219163895,
-0.07570452243089676,
-0.058049995452165604,
-0.011786441318690777,
0.033486660569906235,
0.03042801469564438,
0.00875089131295681,
-0.04623431712388992,
0.06931265443563461,
-0.06633138656616211,
0.04216188192367554,
-0.037001874297857285,
-0.013449623249471188,
-0.07038918137550354,
-0.024795638397336006,
-0.003992043901234865,
0.010992473922669888,
-0.06379594653844833,
0.013397861272096634,
0.05869259312748909,
-0.01378374733030796,
0.06443467736244202,
-0.06817614287137985,
-0.008465158753097057,
0.01093109417706728,
-0.06054702028632164,
-0.12219253927469254,
-0.03892379626631737,
0.012106100097298622,
-0.04070548340678215,
0.005638354457914829,
0.05648674815893173,
-0.0907265916466713,
-0.06632673740386963,
0.011670690029859543
] | 0.011153
|
[[search-aggregations-metrics-percentile-aggregation]] === Percentiles Aggregation A `multi-value` metrics aggregation that calculates one or more percentiles over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. Percentiles show the point at which a certain percentage of observed values occur. For example, the 95th percentile is the value which is greater than 95% of the observed values. Percentiles are often used to find outliers. In normal distributions, the 0.13th and 99.87th percentiles represents three standard deviations from the mean. Any data which falls outside three standard deviations is often considered an anomaly. When a range of percentiles are retrieved, they can be used to estimate the data distribution and determine if the data is skewed, bimodal, etc. Assume your data consists of website load times. The average and median load times are not overly useful to an administrator. The max may be interesting, but it can be easily skewed by a single slow response. Let's look at a range of percentiles representing load time: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "load\_time\_outlier" : { "percentiles" : { "field" : "load\_time" <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] <1> The field `load\_time` must be a numeric field By default, the `percentile` metric will generate a range of percentiles: `[ 1, 5, 25, 50, 75, 95, 99 ]`. The response will look like this: [source,js] -------------------------------------------------- { ... "aggregations": { "load\_time\_outlier": { "values" : { "1.0": 9.9, "5.0": 29.500000000000004, "25.0": 167.5, "50.0": 445.0, "75.0": 722.5, "95.0": 940.5, "99.0": 980.1000000000001 } } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] As you can see, the aggregation will return a calculated value for each percentile in the default range. If we assume response times are in milliseconds, it is immediately obvious that the webpage normally loads in 10-723ms, but occasionally spikes to 941-980ms. Often, administrators are only interested in outliers -- the extreme percentiles. We can specify just the percents we are interested in (requested percentiles must be a value between 0-100 inclusive): [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "load\_time\_outlier" : { "percentiles" : { "field" : "load\_time", "percents" : [95, 99, 99.9] <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] <1> Use the `percents` parameter to specify particular percentiles to calculate ==== Keyed Response By default the `keyed` flag is set to `true` which associates a unique string key with each bucket and returns the ranges as a hash rather than an array. Setting the `keyed` flag to `false` will disable this behavior: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs": { "load\_time\_outlier": { "percentiles": { "field": "load\_time", "keyed": false } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] Response: [source,js] -------------------------------------------------- { ... "aggregations": { "load\_time\_outlier": { "values": [ { "key": 1.0, "value": 9.9 }, { "key": 5.0, "value": 29.500000000000004 }, { "key": 25.0, "value": 167.5 }, { "key": 50.0, "value": 445.0 }, { "key": 75.0, "value": 722.5 }, { "key": 95.0, "value": 940.5 }, { "key": 99.0, "value": 980.1000000000001 } ] } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] ==== Script The percentile metric supports scripting. For example, if our load times are in milliseconds but we want percentiles calculated in seconds, we could use a script to convert them on-the-fly: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "load\_time\_outlier" : { "percentiles" : { "script" : { "lang": "painless", "source": "doc['load\_time'].value / params.timeUnit", <1> "params" : { "timeUnit" : 1000 <2> } } } } } } --------------------------------------------------
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/percentile-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.032248325645923615,
0.020095698535442352,
-0.04280386120080948,
0.03876686468720436,
-0.034577660262584686,
-0.13322503864765167,
-0.029094059020280838,
0.06415235251188278,
0.06411843001842499,
-0.03181225433945656,
-0.011963455937802792,
0.014778208918869495,
0.04466450586915016,
0.0013410610845312476,
-0.007651092484593391,
-0.06462281942367554,
0.06886032223701477,
0.03469625860452652,
-0.11808770149946213,
-0.007907547056674957,
-0.013813909143209457,
-0.014986087568104267,
-0.020016828551888466,
-0.032825034111738205,
0.05985359475016594,
0.027461698278784752,
-0.06421498209238052,
-0.0479523204267025,
-0.002745284466072917,
0.017677297815680504,
-0.0523645281791687,
0.0177397932857275,
0.044458385556936264,
0.07997070252895355,
-0.0435899943113327,
-0.03874654322862625,
-0.02918851748108864,
0.02331508882343769,
0.05410997197031975,
-0.0148723553866148,
0.0005130980280227959,
-0.02404269203543663,
-0.0038921739906072617,
-0.009975450113415718,
-0.06761863082647324,
-0.032607585191726685,
-0.10880833119153976,
-0.022899771109223366,
-0.019005348905920982,
0.0563645176589489,
-0.06591266393661499,
0.05949799343943596,
0.03268204629421234,
0.04855654016137123,
-0.008916491642594337,
-0.0021142400801181793,
0.0000011259318171141786,
-0.12557217478752136,
0.031174547970294952,
0.005820506252348423,
-0.03207911550998688,
-0.012032214552164078,
0.06728938221931458,
-0.03896164521574974,
0.08835431933403015,
0.01382893044501543,
0.00419226661324501,
0.007818585261702538,
0.006787531543523073,
-0.029603609815239906,
0.001386019168421626,
0.0000912653049454093,
-0.03315014764666557,
-0.006098142359405756,
0.062485504895448685,
0.0158899687230587,
-0.02954399771988392,
0.053121794015169144,
-0.009261448867619038,
-0.09145400673151016,
0.01965395174920559,
0.0032992695923894644,
-0.029927341267466545,
0.03001484088599682,
0.05749598145484924,
-0.03190574795007706,
0.0667891651391983,
0.05578835308551788,
-0.013336352072656155,
0.04352157935500145,
-0.018815776333212852,
0.12086760252714157,
-0.02805597148835659,
-0.004450119566172361,
0.09222743660211563,
0.1455123871564865,
-0.00809208769351244,
-0.10697659105062485,
0.09523764997720718,
0.020818764343857765,
0.03863493353128433,
-0.003598376177251339,
0.04572640731930733,
-0.06055039167404175,
-0.0027098418213427067,
-0.10499824583530426,
0.0249161459505558,
0.06228383630514145,
-0.059304129332304,
-0.00014817045303061604,
-0.05544823780655861,
-0.02860887162387371,
0.009231416508555412,
-0.0739063173532486,
-0.004707975313067436,
-0.08041679114103317,
0.05878158286213875,
0.03046157956123352,
-0.019417693838477135,
-0.033484622836112976,
-0.005032618064433336,
0.0358501635491848,
0.029743589460849762,
-0.03286071494221687,
0.12470589578151703,
0.07398204505443573,
-0.019436009228229523,
8.636208589329555e-33,
-0.030525758862495422,
-0.03254048898816109,
-0.04002304747700691,
-0.0343565009534359,
-0.07123503088951111,
-0.0244149062782526,
-0.02459709718823433,
0.05743055045604706,
0.029394840821623802,
0.005609095096588135,
-0.010633816011250019,
0.07136629521846771,
-0.025422578677535057,
-0.019757917150855064,
0.011504756286740303,
0.03994308412075043,
0.039585817605257034,
-0.00003519199162838049,
0.023414362221956253,
-0.08281029015779495,
-0.008585695177316666,
-0.062453240156173706,
0.05275575816631317,
0.03592899814248085,
0.019748060032725334,
-0.03336750715970993,
-0.03911701962351799,
0.023595083504915237,
-0.07117576897144318,
-0.015677260234951973,
0.06940855830907822,
0.0447034016251564,
-0.04296809434890747,
-0.1138760894536972,
0.060182761400938034,
-0.01481848768889904,
0.05812956020236015,
0.055990561842918396,
-0.030103104189038277,
0.03278360143303871,
-0.12843048572540283,
0.005208786576986313,
0.018417706713080406,
-0.011809349060058594,
-0.03945636376738548,
0.08375896513462067,
-0.0040868595242500305,
0.04464661329984665,
-0.005598204210400581,
-0.02821516990661621,
-0.06684617698192596,
0.008524004369974136,
0.08882951736450195,
0.022968627512454987,
-0.028903180733323097,
0.05925772711634636,
0.06232567876577377,
-0.04669033735990524,
0.010950172320008278,
0.00025210456806235015,
0.017058109864592552,
-0.040353480726480484,
-0.012824546545743942,
-0.01291937381029129,
0.04212569072842598,
-0.0050203027203679085,
0.032517414540052414,
0.1049506664276123,
0.04807156324386597,
0.11247099190950394,
0.07544399797916412,
0.015701280906796455,
0.02701452374458313,
-0.004491100087761879,
-0.014281539246439934,
-0.022069266065955162,
0.07560380548238754,
0.08575444668531418,
-0.02285255864262581,
-0.05843576043844223,
0.035122036933898926,
-0.015841525048017502,
0.07551354169845581,
-0.06015583127737045,
-0.0023243133910000324,
0.012681993655860424,
-0.02330123260617256,
-0.021963905543088913,
-0.05942711979150772,
-0.08485327661037445,
-0.022667409852147102,
0.01960590109229088,
-0.12330573797225952,
-0.007600171025842428,
-0.07007549703121185,
-6.52315022986698e-33,
-0.0665450468659401,
0.09056279063224792,
0.019777582958340645,
0.0755750760436058,
0.07930948585271835,
0.0017639489378780127,
-0.02777783013880253,
0.049221646040678024,
0.013360346667468548,
-0.006020524073392153,
-0.04359877109527588,
-0.0456853061914444,
0.030743172392249107,
-0.059703338891267776,
0.003549204207956791,
0.0579904243350029,
0.010773852467536926,
-0.09882082045078278,
0.01140335388481617,
0.03970804810523987,
-0.020543524995446205,
-0.009886089712381363,
-0.05731742084026337,
0.07367577403783798,
0.0150016313418746,
0.0276491641998291,
-0.1350453644990921,
-0.02711719274520874,
-0.10720186680555344,
-0.027557821944355965,
0.017467400059103966,
0.004755855537950993,
0.02722685970366001,
-0.05398751050233841,
-0.009541920386254787,
-0.09941376745700836,
-0.015250543132424355,
-0.03736336529254913,
-0.016231786459684372,
-0.03334609791636467,
0.023906536400318146,
0.03662344813346863,
-0.01554949302226305,
-0.05595850944519043,
0.03986149653792381,
0.08661076426506042,
0.03020450845360756,
0.028012584894895554,
-0.02218645252287388,
0.021501705050468445,
0.024271151050925255,
0.08872148394584656,
0.022770648822188377,
0.08973539620637894,
0.04661110043525696,
0.003299567149952054,
-0.04551072418689728,
-0.04851062223315239,
0.02156888321042061,
-0.0012786641018465161,
0.031469814479351044,
-0.007544138468801975,
-0.041563548147678375,
0.022267693653702736,
-0.008106253109872341,
0.010733798146247864,
0.01583164744079113,
-0.07908567786216736,
-0.09344316273927689,
0.034247033298015594,
0.0439242459833622,
0.033921949565410614,
0.10489103943109512,
-0.10127214342355728,
-0.026858700439333916,
0.021311871707439423,
0.0277880672365427,
-0.018573816865682602,
0.005117884371429682,
0.06663577258586884,
0.025587143376469612,
0.05881495401263237,
0.03231630101799965,
0.008114210329949856,
-0.11088941246271133,
0.011847829446196556,
0.03203005716204643,
0.01566203683614731,
0.025652829557657242,
-0.03754537180066109,
-0.03592836111783981,
-0.015515606850385666,
-0.09721629321575165,
0.035913679748773575,
0.04940127953886986,
-6.112534833846439e-8,
-0.055141083896160126,
0.0011829090071842074,
-0.025303058326244354,
-0.012083813548088074,
0.05478861555457115,
0.08849658071994781,
-0.061520908027887344,
0.10290737450122833,
-0.050371963530778885,
-0.054552122950553894,
0.08123328536748886,
-0.1057974174618721,
-0.1280195713043213,
-0.034239813685417175,
0.00361664523370564,
0.0002318628685316071,
-0.009524705819785595,
-0.00022576755145564675,
-0.029723381623625755,
-0.0543794259428978,
0.0002606975322123617,
0.06748165935277939,
0.054477546364068985,
-0.044859327375888824,
0.035012587904930115,
0.06819090992212296,
-0.022346526384353638,
-0.03609563410282135,
0.03123316913843155,
-0.06462770700454712,
-0.000792275823187083,
-0.07942695915699005,
0.03416481986641884,
-0.011989245191216469,
0.004417456220835447,
0.07326577603816986,
-0.11302062124013901,
-0.005408740136772394,
-0.020813647657632828,
0.024543415755033493,
0.047693073749542236,
0.06725146621465683,
0.000048161153245018795,
0.029950786381959915,
-0.0041327509097754955,
-0.0050075906328856945,
-0.07279937714338303,
0.0742783322930336,
0.07523250579833984,
-0.028423968702554703,
0.08510633558034897,
-0.08692753314971924,
-0.011282801628112793,
0.04773125797510147,
-0.03853372111916542,
-0.046585965901613235,
0.07007873803377151,
0.017580809071660042,
-0.04479274898767471,
0.01506685558706522,
0.087671659886837,
-0.027408253401517868,
-0.07600273936986923,
0.06946642696857452
] | 0.045551
|
seconds, we could use a script to convert them on-the-fly: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "load\_time\_outlier" : { "percentiles" : { "script" : { "lang": "painless", "source": "doc['load\_time'].value / params.timeUnit", <1> "params" : { "timeUnit" : 1000 <2> } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] <1> The `field` parameter is replaced with a `script` parameter, which uses the script to generate values which percentiles are calculated on <2> Scripting supports parameterized input just like any other script This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a stored script use the following syntax: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "load\_time\_outlier" : { "percentiles" : { "script" : { "id": "my\_script", "params": { "field": "load\_time" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency,stored\_example\_script] [[search-aggregations-metrics-percentile-aggregation-approximation]] ==== Percentiles are (usually) approximate There are many different algorithms to calculate percentiles. The naive implementation simply stores all the values in a sorted array. To find the 50th percentile, you simply find the value that is at `my\_array[count(my\_array) \* 0.5]`. Clearly, the naive implementation does not scale -- the sorted array grows linearly with the number of values in your dataset. To calculate percentiles across potentially billions of values in an Elasticsearch cluster, \_approximate\_ percentiles are calculated. The algorithm used by the `percentile` metric is called TDigest (introduced by Ted Dunning in https://github.com/tdunning/t-digest/blob/master/docs/t-digest-paper/histo.pdf[Computing Accurate Quantiles using T-Digests]). When using this metric, there are a few guidelines to keep in mind: - Accuracy is proportional to `q(1-q)`. This means that extreme percentiles (e.g. 99%) are more accurate than less extreme percentiles, such as the median - For small sets of values, percentiles are highly accurate (and potentially 100% accurate if the data is small enough). - As the quantity of values in a bucket grows, the algorithm begins to approximate the percentiles. It is effectively trading accuracy for memory savings. The exact level of inaccuracy is difficult to generalize, since it depends on your data distribution and volume of data being aggregated The following chart shows the relative error on a uniform distribution depending on the number of collected values and the requested percentile: image:images/percentiles\_error.png[] It shows how precision is better for extreme percentiles. The reason why error diminishes for large number of values is that the law of large numbers makes the distribution of values more and more uniform and the t-digest tree can do a better job at summarizing it. It would not be the case on more skewed distributions. [[search-aggregations-metrics-percentile-aggregation-compression]] ==== Compression Approximate algorithms must balance memory utilization with estimation accuracy. This balance can be controlled using a `compression` parameter: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "load\_time\_outlier" : { "percentiles" : { "field" : "load\_time", "tdigest": { "compression" : 200 <1> } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] <1> Compression controls memory usage and approximation error The TDigest algorithm uses a number of "nodes" to approximate percentiles -- the more nodes available, the higher the accuracy (and large memory footprint) proportional to the volume of data. The `compression` parameter limits the maximum number of nodes to `20 \* compression`. Therefore, by increasing the compression value, you can increase the accuracy of your percentiles at the cost of more memory. Larger compression values also make the algorithm slower since the underlying tree data structure grows in size, resulting in more expensive operations. The default compression value is `100`. A "node" uses roughly 32 bytes of memory, so under worst-case scenarios
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/percentile-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.019847579300403595,
0.07695931196212769,
-0.061289913952350616,
0.08539324998855591,
-0.01411384902894497,
-0.0672530010342598,
0.011360913515090942,
0.06175012141466141,
0.051652662456035614,
-0.04223128780722618,
-0.018790652975440025,
-0.06115467846393585,
-0.021351750940084457,
-0.029719997197389603,
0.0013973216991871595,
-0.04898134618997574,
0.005615497939288616,
0.0227366890758276,
-0.06987696141004562,
-0.12834720313549042,
-0.025574522092938423,
0.018111445009708405,
-0.025859953835606575,
-0.05262504145503044,
0.03013935312628746,
-0.016495613381266594,
-0.0912747010588646,
-0.0376138873398304,
0.002769876504316926,
-0.0017169922357425094,
-0.05495550110936165,
0.003051497507840395,
-0.021411126479506493,
0.04879235476255417,
0.0012207601685076952,
0.021263159811496735,
0.028393924236297607,
-0.014490470290184021,
0.04319942742586136,
-0.02166149951517582,
0.08143917471170425,
0.00599217414855957,
-0.012011982500553131,
-0.05287502706050873,
-0.02192946895956993,
-0.07628462463617325,
-0.08287754654884338,
0.0031864976044744253,
-0.03473631665110588,
0.06830453127622604,
-0.09909985959529877,
0.02010508067905903,
-0.015328282490372658,
-0.04068108648061752,
0.029580220580101013,
0.06807885318994522,
-0.005814391653984785,
-0.014879348687827587,
-0.02476590685546398,
-0.05615101754665375,
-0.03438062220811844,
-0.04962478578090668,
0.02743404731154442,
-0.04043202102184296,
0.05506957694888115,
-0.02892104908823967,
0.04227704927325249,
0.012244291603565216,
0.011595960706472397,
0.024007506668567657,
0.021285096183419228,
0.038662977516651154,
-0.022673238068819046,
-0.023999953642487526,
0.0222600307315588,
0.0015536305727437139,
-0.038611724972724915,
0.011168280616402626,
0.020600417628884315,
-0.06601632386445999,
0.03922218456864357,
-0.07577361911535263,
-0.07498433440923691,
0.012808693572878838,
-0.00010712072980822995,
-0.03646679222583771,
0.053719550371170044,
0.10356348007917404,
0.04715145379304886,
-0.052179109305143356,
-0.07729306817054749,
0.0063456203788518906,
-0.07515576481819153,
0.017048286274075508,
0.040812961757183075,
0.10972115397453308,
0.04133516177535057,
-0.016348164528608322,
0.059300921857357025,
0.03025779314339161,
0.001245217747054994,
-0.002017571125179529,
0.01379731297492981,
-0.0057863700203597546,
-0.02489071525633335,
-0.024004168808460236,
0.03432057425379753,
0.08286933600902557,
-0.019531581550836563,
0.0367470420897007,
0.02542269602417946,
0.055176593363285065,
0.020822443068027496,
-0.08115915209054947,
0.05036285147070885,
0.03226069360971451,
0.0534789152443409,
-0.05641588568687439,
0.009145079180598259,
0.037760984152555466,
0.09886117279529572,
0.09146886318922043,
-0.04378034919500351,
-0.027532536536455154,
0.06961121410131454,
0.03799689933657646,
0.08322106301784515,
1.154868282056195e-33,
-0.0013050533598288894,
-0.011198206804692745,
0.03779119253158569,
-0.09420961141586304,
-0.02150670439004898,
0.015209292992949486,
-0.01823291927576065,
0.06779950112104416,
0.03250322490930557,
0.013937831856310368,
-0.08152469247579575,
-0.03310054540634155,
-0.06812610477209091,
-0.09387502819299698,
-0.010551325045526028,
-0.04069315642118454,
0.07082180678844452,
-0.00473305769264698,
0.0737287700176239,
-0.04031888768076897,
0.08024516701698303,
-0.08685752004384995,
-0.07001464068889618,
0.013210172764956951,
0.03266723081469536,
-0.03396415710449219,
-0.008068946190178394,
-0.05254172533750534,
-0.06852738559246063,
-0.012148313224315643,
0.020777558907866478,
0.03877938166260719,
-0.08093172311782837,
-0.012239431962370872,
0.09143294394016266,
-0.05059586465358734,
0.007775215432047844,
0.05202959105372429,
0.0036145439371466637,
0.02688985876739025,
-0.04985291510820389,
-0.004128392785787582,
-0.02633656933903694,
-0.04576721042394638,
-0.08656104654073715,
-0.04407607391476631,
-0.01656506210565567,
-0.02989637292921543,
0.017340905964374542,
-0.012231472879648209,
-0.029075192287564278,
0.06206584721803665,
0.036137860268354416,
-0.05618063360452652,
0.05687602981925011,
0.016449060291051865,
0.057440098375082016,
0.04218006506562233,
-0.005182426888495684,
0.0784032791852951,
0.01372868474572897,
0.005577268544584513,
0.0021907929331064224,
-0.027008073404431343,
0.029688596725463867,
-0.012150174006819725,
0.03786921873688698,
0.03914017230272293,
0.022576136514544487,
0.09913837164640427,
0.03220458701252937,
0.006281752604991198,
-0.0037654624320566654,
-0.005379961337894201,
0.013383541256189346,
-0.08211278915405273,
0.09243768453598022,
0.029702240601181984,
-0.026779446750879288,
-0.06547927856445312,
0.016219019889831543,
-0.0647691935300827,
-0.03764038532972336,
0.014734419994056225,
0.02778107300400734,
-0.022830501198768616,
-0.0057792882435023785,
-0.037850189954042435,
-0.06474460661411285,
-0.08868373930454254,
-0.040815193206071854,
0.0382167287170887,
-0.0705699473619461,
-0.1283080279827118,
-0.07150175422430038,
-2.41267717580779e-33,
0.04830966517329216,
-0.011387699283659458,
0.04188593849539757,
0.15923145413398743,
0.08049032837152481,
-0.06421737372875214,
0.017655296251177788,
0.07152557373046875,
0.05794761702418327,
0.1371365785598755,
-0.045299917459487915,
-0.0745631605386734,
-0.025685910135507584,
-0.13569895923137665,
0.009630279615521431,
0.0673035979270935,
-0.008049508556723595,
-0.07315105944871902,
0.03363218531012535,
-0.015427786856889725,
0.0038299697916954756,
0.0029599994886666536,
0.02400914579629898,
0.014809527434408665,
-0.03677980974316597,
-0.04710328206419945,
-0.010251840576529503,
-0.012449860572814941,
-0.13897226750850677,
-0.06689196825027466,
-0.0746615007519722,
0.015751179307699203,
-0.025531712919473648,
0.026228681206703186,
-0.053631316870450974,
0.0011089484905824065,
0.0828288346529007,
0.033980842679739,
-0.04574448615312576,
0.055326249450445175,
0.028265535831451416,
0.06538484245538712,
-0.09957624971866608,
-0.02367260865867138,
-0.019067689776420593,
0.1472242772579193,
0.018870949745178223,
0.009089373052120209,
-0.03604401275515556,
0.0013416886795312166,
0.07242678105831146,
0.05227792263031006,
-0.018266435712575912,
0.09175794571638107,
0.01401916891336441,
-0.07168853282928467,
-0.027382608503103256,
-0.10661676526069641,
-0.015582050196826458,
0.07169347256422043,
-0.02093120478093624,
-0.07132671773433685,
0.02273258939385414,
-0.041888583451509476,
0.07287491858005524,
-0.021703653037548065,
-0.0016945344395935535,
-0.02894115447998047,
-0.032370634377002716,
0.02978929877281189,
0.06347408890724182,
-0.032348982989788055,
0.05633214861154556,
0.022456761449575424,
-0.05893208459019661,
-0.0371314100921154,
0.015974879264831543,
0.023496560752391815,
0.06793462485074997,
-0.0011161388829350471,
0.050851937383413315,
0.014014185406267643,
0.037361595779657364,
0.03972553834319115,
-0.08663495630025864,
0.10637093335390091,
0.019687915220856667,
0.08460701256990433,
-0.009363717399537563,
0.005812608636915684,
-0.054909881204366684,
0.08193392306566238,
-0.021487055346369743,
0.015134655870497227,
0.04795220494270325,
-5.549733828047465e-8,
-0.08438589423894882,
0.016053155064582825,
-0.07003286480903625,
0.026816315948963165,
-0.011454257182776928,
0.02870209887623787,
-0.019384445622563362,
0.08720537275075912,
0.04536071792244911,
-0.04483354836702347,
0.06556028127670288,
-0.05444471910595894,
0.002913287840783596,
0.004911091644316912,
-0.016920553520321846,
-0.048236213624477386,
-0.029426924884319305,
-0.005385240539908409,
-0.02341417782008648,
-0.03328976407647133,
0.04425746947526932,
0.0890207514166832,
0.001642068149521947,
-0.01807212457060814,
0.0412449911236763,
0.02324266918003559,
-0.011247679591178894,
0.034261152148246765,
0.09680206328630447,
-0.038715194910764694,
-0.03389639034867287,
-0.018554210662841797,
-0.02233089692890644,
-0.00522293196991086,
-0.029232319444417953,
-0.028972895815968513,
-0.07081522792577744,
0.04277375712990761,
-0.034769847989082336,
0.10311135649681091,
0.01169163454324007,
0.03973519057035446,
-0.1510217934846878,
0.010044650174677372,
-0.017744259908795357,
-0.09045857936143875,
-0.06612571328878403,
0.038898203521966934,
0.04754756763577461,
-0.08259402960538864,
0.08825773745775223,
-0.07190794497728348,
-0.010684293694794178,
-0.018079884350299835,
-0.0015841268468648195,
-0.049917493015527725,
0.04921373724937439,
-0.020429305732250214,
-0.016317149624228477,
-0.01578715816140175,
0.04866182804107666,
-0.02849867008626461,
-0.05903893709182739,
0.025284651666879654
] | 0.05028
|
accuracy of your percentiles at the cost of more memory. Larger compression values also make the algorithm slower since the underlying tree data structure grows in size, resulting in more expensive operations. The default compression value is `100`. A "node" uses roughly 32 bytes of memory, so under worst-case scenarios (large amount of data which arrives sorted and in-order) the default settings will produce a TDigest roughly 64KB in size. In practice data tends to be more random and the TDigest will use less memory. ==== HDR Histogram NOTE: This setting exposes the internal implementation of HDR Histogram and the syntax may change in the future. https://github.com/HdrHistogram/HdrHistogram[HDR Histogram] (High Dynamic Range Histogram) is an alternative implementation that can be useful when calculating percentiles for latency measurements as it can be faster than the t-digest implementation with the trade-off of a larger memory footprint. This implementation maintains a fixed worse-case percentage error (specified as a number of significant digits). This means that if data is recorded with values from 1 microsecond up to 1 hour (3,600,000,000 microseconds) in a histogram set to 3 significant digits, it will maintain a value resolution of 1 microsecond for values up to 1 millisecond and 3.6 seconds (or better) for the maximum tracked value (1 hour). The HDR Histogram can be used by specifying the `method` parameter in the request: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "load\_time\_outlier" : { "percentiles" : { "field" : "load\_time", "percents" : [95, 99, 99.9], "hdr": { <1> "number\_of\_significant\_value\_digits" : 3 <2> } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] <1> `hdr` object indicates that HDR Histogram should be used to calculate the percentiles and specific settings for this algorithm can be specified inside the object <2> `number\_of\_significant\_value\_digits` specifies the resolution of values for the histogram in number of significant digits The HDRHistogram only supports positive values and will error if it is passed a negative value. It is also not a good idea to use the HDRHistogram if the range of values is unknown as this could lead to high memory usage. ==== Missing value The `missing` parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value. [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "grade\_percentiles" : { "percentiles" : { "field" : "grade", "missing": 10 <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] <1> Documents without a value in the `grade` field will fall into the same bucket as documents that have the value `10`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/percentile-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.05034128203988075,
0.05275975912809372,
-0.024878190830349922,
-0.02622918225824833,
0.00734443636611104,
-0.09745873510837555,
-0.08399877697229385,
0.07449451088905334,
0.019472286105155945,
0.028136763721704483,
-0.0755305290222168,
-0.01076685544103384,
0.0059338221326470375,
-0.03695923462510109,
-0.023991651833057404,
-0.07593818753957748,
0.021319499239325523,
0.00361479539424181,
-0.029173195362091064,
-0.11181197315454483,
-0.06768917292356491,
0.013674918562173843,
0.0017292642733082175,
-0.013748628087341785,
0.0782272145152092,
-0.04315492510795593,
-0.043870631605386734,
-0.014004801400005817,
0.03550286963582039,
-0.003113583894446492,
0.0399898998439312,
0.0008819797658361495,
0.08353472501039505,
0.04523748159408569,
-0.10487920045852661,
0.020723672583699226,
-0.003418476553633809,
-0.06334830820560455,
-0.003719292115420103,
0.013580854050815105,
0.04960377886891365,
0.055458128452301025,
-0.05338802933692932,
0.053467247635126114,
-0.0270976722240448,
0.0837477371096611,
-0.00838937796652317,
0.021401656791567802,
-0.025818228721618652,
0.011412599124014378,
-0.04083855077624321,
0.115659698843956,
0.029124252498149872,
0.03799830749630928,
-0.031277719885110855,
0.016509542241692543,
0.011920345015823841,
-0.03667720407247543,
0.009416353888809681,
0.05196285620331764,
-0.07715492695569992,
-0.03475541993975639,
0.046997733414173126,
-0.08183413743972778,
0.0496743880212307,
-0.024482782930135727,
0.12261492013931274,
-0.02412809059023857,
0.05025814101099968,
-0.007268696557730436,
0.03425073251128197,
0.08410657197237015,
-0.017124585807323456,
0.08195144683122635,
-0.04745497927069664,
-0.0034956838935613632,
-0.001972086727619171,
0.04388923570513725,
-0.029366301372647285,
-0.09313429892063141,
0.0006255408516153693,
0.0009479032596573234,
0.01029137521982193,
-0.02147410437464714,
-0.018938476219773293,
-0.02316170744597912,
0.018899807706475258,
0.023859158158302307,
-0.07653637230396271,
-0.020521556958556175,
0.05346699804067612,
0.012148194015026093,
-0.052052661776542664,
-0.014289332553744316,
0.023246966302394867,
0.04686176776885986,
0.045137885957956314,
0.006291703321039677,
0.027815217152237892,
-0.04034562036395073,
0.08180589973926544,
-0.0060878293588757515,
-0.023773586377501488,
-0.018935350701212883,
0.012837055139243603,
-0.05894164368510246,
0.025068778544664383,
0.08480041474103928,
-0.013290271162986755,
0.05749870464205742,
0.061072804033756256,
0.05390232801437378,
0.007055124267935753,
-0.02194075658917427,
0.036983441561460495,
-0.035268623381853104,
-0.062397122383117676,
-0.023983845487236977,
0.008957669138908386,
0.0116644985973835,
-0.03183770552277565,
-0.0725289136171341,
-0.019420292228460312,
0.006347693968564272,
0.04080888628959656,
-0.10297586023807526,
-0.06909449398517609,
8.226503992345863e-33,
-0.014426722191274166,
0.05325359106063843,
-0.03734507039189339,
-0.0433049313724041,
-0.07498046010732651,
0.018692318350076675,
-0.055277787148952484,
0.03513603284955025,
0.04536128044128418,
-0.019912708550691605,
-0.10563866794109344,
0.0006865613395348191,
0.016187962144613266,
-0.004895930644124746,
0.0176345594227314,
-0.017275413498282433,
-0.0401889868080616,
0.008442831225693226,
-0.10315423458814621,
-0.07451426237821579,
-0.05780046805739403,
-0.0291468296200037,
0.014631063677370548,
-0.03858022391796112,
0.0005961416754871607,
-0.01999136060476303,
0.024725908413529396,
-0.04063181206583977,
-0.013533328659832478,
0.014660588465631008,
-0.018300550058484077,
0.02589716576039791,
0.031922563910484314,
-0.03637095168232918,
0.13216449320316315,
-0.012083351612091064,
0.00818717386573553,
0.009121823124587536,
-0.10036495327949524,
-0.017951542511582375,
0.004101280122995377,
0.09052933007478714,
0.03000006452202797,
-0.037877973169088364,
-0.042082805186510086,
-0.0718856081366539,
0.04490666091442108,
0.004458759445697069,
-0.08953307569026947,
0.018833477050065994,
0.03654640540480614,
-0.011777139268815517,
0.007919671945273876,
0.015983106568455696,
0.03530991077423096,
0.013960377313196659,
0.12757763266563416,
-0.0367751270532608,
0.07328151911497116,
0.17135141789913177,
0.006623700261116028,
-0.014043613336980343,
0.045167870819568634,
0.046755146235227585,
0.013230918906629086,
0.021853694692254066,
0.05658531188964844,
0.07180068641901016,
-0.05460149049758911,
0.042564887553453445,
0.070608951151371,
0.05157781392335892,
0.05914841592311859,
-0.05536554753780365,
0.008566153235733509,
0.01685517095029354,
0.027753910049796104,
0.016452791169285774,
-0.12209883332252502,
-0.08462841063737869,
0.0003529250097926706,
-0.0075977882370352745,
0.05686904862523079,
-0.035557832568883896,
0.048547882586717606,
-0.04296046495437622,
0.0367267020046711,
0.0169014111161232,
-0.11929892003536224,
0.028827816247940063,
0.05471939966082573,
-0.03489046171307564,
0.026181738823652267,
-0.04416046664118767,
-0.07812556624412537,
-6.344403089513005e-33,
-0.048480112105607986,
0.06675122678279877,
0.03841990604996681,
0.13593919575214386,
0.006652672775089741,
-0.058618735522031784,
0.002473426517099142,
0.016209250316023827,
-0.005795957054942846,
-0.05513361096382141,
0.009559249505400658,
-0.026977218687534332,
0.02960067242383957,
-0.03458048403263092,
0.025295980274677277,
0.025943167507648468,
0.014660604298114777,
-0.01133047230541706,
-0.043414682149887085,
0.020753368735313416,
0.005713021848350763,
0.01013269554823637,
0.0017163252923637629,
0.01921536587178707,
-0.046886805444955826,
0.000514819344971329,
-0.10408779978752136,
0.03811028599739075,
0.015557345934212208,
-0.0888473242521286,
-0.03902808204293251,
-0.056778423488140106,
-0.0220591239631176,
-0.11148349940776825,
0.01233174279332161,
-0.056113310158252716,
0.024631336331367493,
-0.004432070069015026,
0.01918693631887436,
0.017847144976258278,
0.04855017736554146,
0.05372295528650284,
-0.04728047922253609,
-0.07724346965551376,
0.015068420208990574,
0.0774749368429184,
-0.05481484904885292,
0.034598659723997116,
0.07673510909080505,
0.04639841243624687,
0.07577584683895111,
0.09003929048776627,
0.04862797632813454,
0.11336411535739899,
0.12913550436496735,
0.02466205507516861,
-0.13447146117687225,
0.06954562664031982,
0.039576027542352676,
0.0007192305638454854,
-0.05186184123158455,
-0.05319421365857124,
0.016763675957918167,
-0.005068925675004721,
-0.03984704241156578,
0.014867992140352726,
0.005507911555469036,
-0.07153685390949249,
-0.030700836330652237,
0.0746382549405098,
0.014408184215426445,
0.005018745549023151,
0.05209089815616608,
-0.005146233830600977,
-0.07909415662288666,
0.04946130886673927,
0.015889538452029228,
-0.03167744725942612,
-0.007982547394931316,
0.07012823969125748,
-0.0483999028801918,
0.06364475935697556,
-0.042082592844963074,
0.038188181817531586,
-0.02003246732056141,
0.030898353084921837,
0.003757237922400236,
-0.06048894301056862,
-0.011176479049026966,
-0.009683610871434212,
0.027556778863072395,
0.06975271552801132,
-0.07067188620567322,
0.010984721593558788,
0.013525613583624363,
-5.9209270375504275e-8,
-0.028063565492630005,
-0.06287293881177902,
-0.044025033712387085,
-0.018758948892354965,
0.04337356984615326,
-0.05766161531209946,
-0.030226200819015503,
0.1459793597459793,
0.03697001934051514,
-0.02113913744688034,
0.15968285501003265,
-0.08376516401767731,
-0.13099564611911774,
-0.07896117866039276,
0.0765269473195076,
-0.012205452658236027,
0.06222906708717346,
-0.08606700599193573,
0.007863307371735573,
0.02751101553440094,
0.002114698523655534,
0.01718050427734852,
0.057619817554950714,
-0.02504706382751465,
0.013014564290642738,
0.003685086267068982,
0.04436470940709114,
0.02941572666168213,
0.001439564279280603,
-0.09554333239793777,
-0.003851997898891568,
0.0027527445927262306,
0.00786108523607254,
0.017774971202015877,
0.0018049029167741537,
0.034032125025987625,
-0.05714859440922737,
0.09086862951517105,
0.053198374807834625,
0.019834032282233238,
0.05034346133470535,
-0.04223860427737236,
-0.03402639180421829,
0.02225189283490181,
-0.03615647926926613,
-0.0038831366691738367,
0.004688955377787352,
0.08834279328584671,
-0.013985563069581985,
-0.03695544973015785,
-0.0020053794141858816,
-0.013534100726246834,
-0.03355014696717262,
-0.07753957808017731,
0.06794052571058273,
-0.02137402817606926,
-0.002934973919764161,
-0.054435476660728455,
-0.002408117987215519,
0.055025070905685425,
0.05005796626210213,
-0.042974866926670074,
-0.08146148175001144,
-0.004468030296266079
] | 0.036385
|
[[search-aggregations-metrics-geocentroid-aggregation]] === Geo Centroid Aggregation A metric aggregation that computes the weighted https://en.wikipedia.org/wiki/Centroid[centroid] from all coordinate values for a <> field. Example: [source,js] -------------------------------------------------- PUT /museums { "mappings": { "doc": { "properties": { "location": { "type": "geo\_point" } } } } } POST /museums/doc/\_bulk?refresh {"index":{"\_id":1}} {"location": "52.374081,4.912350", "city": "Amsterdam", "name": "NEMO Science Museum"} {"index":{"\_id":2}} {"location": "52.369219,4.901618", "city": "Amsterdam", "name": "Museum Het Rembrandthuis"} {"index":{"\_id":3}} {"location": "52.371667,4.914722", "city": "Amsterdam", "name": "Nederlands Scheepvaartmuseum"} {"index":{"\_id":4}} {"location": "51.222900,4.405200", "city": "Antwerp", "name": "Letterenhuis"} {"index":{"\_id":5}} {"location": "48.861111,2.336389", "city": "Paris", "name": "Musée du Louvre"} {"index":{"\_id":6}} {"location": "48.860000,2.327000", "city": "Paris", "name": "Musée d'Orsay"} POST /museums/\_search?size=0 { "aggs" : { "centroid" : { "geo\_centroid" : { "field" : "location" <1> } } } } -------------------------------------------------- // CONSOLE <1> The `geo\_centroid` aggregation specifies the field to use for computing the centroid. (NOTE: field must be a <> type) The above aggregation demonstrates how one would compute the centroid of the location field for all documents with a crime type of burglary The response for the above aggregation: [source,js] -------------------------------------------------- { ... "aggregations": { "centroid": { "location": { "lat": 51.00982963107526, "lon": 3.9662130922079086 }, "count": 6 } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"\_shards": $body.\_shards,"hits":$body.hits,"timed\_out":false,/] The `geo\_centroid` aggregation is more interesting when combined as a sub-aggregation to other bucket aggregations. Example: [source,js] -------------------------------------------------- POST /museums/\_search?size=0 { "aggs" : { "cities" : { "terms" : { "field" : "city.keyword" }, "aggs" : { "centroid" : { "geo\_centroid" : { "field" : "location" } } } } } } -------------------------------------------------- // CONSOLE // TEST[continued] The above example uses `geo\_centroid` as a sub-aggregation to a <> bucket aggregation for finding the central location for museums in each city. The response for the above aggregation: [source,js] -------------------------------------------------- { ... "aggregations": { "cities": { "sum\_other\_doc\_count": 0, "doc\_count\_error\_upper\_bound": 0, "buckets": [ { "key": "Amsterdam", "doc\_count": 3, "centroid": { "location": { "lat": 52.371655656024814, "lon": 4.909563297405839 }, "count": 3 } }, { "key": "Paris", "doc\_count": 2, "centroid": { "location": { "lat": 48.86055548675358, "lon": 2.3316944623366 }, "count": 2 } }, { "key": "Antwerp", "doc\_count": 1, "centroid": { "location": { "lat": 51.22289997059852, "lon": 4.40519998781383 }, "count": 1 } } ] } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"\_shards": $body.\_shards,"hits":$body.hits,"timed\_out":false,/]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/geocentroid-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.016864895820617676,
0.07216428965330124,
0.056672558188438416,
0.03817575052380562,
-0.0018481926526874304,
0.028350496664643288,
-0.04444624483585358,
-0.028262870386242867,
0.07661910355091095,
-0.0014564121374860406,
-0.06839881837368011,
-0.02487611025571823,
0.02772306278347969,
0.03583771362900734,
-0.05840224400162697,
0.06489939987659454,
-0.04366876557469368,
0.06929648667573929,
-0.0213764775544405,
-0.05658559873700142,
0.07035035640001297,
-0.034607261419296265,
0.06448041647672653,
-0.04257022961974144,
0.023948896676301956,
0.06886163353919983,
-0.0688806101679802,
0.02311955951154232,
-0.018562542274594307,
0.056244634091854095,
-0.0767015591263771,
-0.03816213458776474,
-0.0007438439060933888,
0.039529673755168915,
-0.021435486152768135,
0.05565286800265312,
-0.030093567445874214,
-0.025814199820160866,
0.06552455574274063,
0.049087997525930405,
0.07104822993278503,
0.02121991477906704,
0.024820521473884583,
-0.020762106403708458,
-0.01147825550287962,
0.008374067954719067,
-0.04343412071466446,
0.06109754368662834,
0.00987185537815094,
0.052840325981378555,
-0.013537568971514702,
-0.04705946519970894,
-0.031182091683149338,
-0.025320228189229965,
0.023080075159668922,
0.07381162792444229,
-0.08464669436216354,
-0.02536851167678833,
0.028973346576094627,
-0.129495769739151,
0.0928034782409668,
-0.08641982823610306,
0.052702054381370544,
0.0005344155360944569,
0.03244474157691002,
-0.05704313516616821,
-0.05626680701971054,
0.060354627668857574,
-0.023133045062422752,
-0.014625334180891514,
0.16285733878612518,
-0.03339431434869766,
0.038483597338199615,
-0.0590585432946682,
0.05086882784962654,
0.021321093663573265,
-0.10763721913099289,
-0.04922904446721077,
-0.03022592142224312,
0.0324023999273777,
-0.008822915144264698,
-0.033177006989717484,
0.02010922133922577,
0.03497428074479103,
0.028534438461065292,
-0.01976371370255947,
0.012149258516728878,
-0.057702843099832535,
0.001461331034079194,
-0.013836732134222984,
-0.038999129086732864,
0.008385107852518559,
-0.05385731905698776,
-0.022803010419011116,
0.004968659020960331,
0.031747203320264816,
-0.04352187737822533,
0.027245434001088142,
0.04149307310581207,
0.03849710524082184,
0.07198002189397812,
0.06305006146430969,
-0.010100370272994041,
-0.07910089194774628,
0.0040963999927043915,
-0.02641802467405796,
-0.03638831898570061,
0.08300117403268814,
-0.09331872314214706,
0.0915953740477562,
-0.03623766824603081,
0.08246656507253647,
-0.021305428817868233,
0.030501557514071465,
-0.0977177768945694,
0.0887974426150322,
0.10411524027585983,
-0.012325984425842762,
0.04541469365358353,
-0.03899182379245758,
0.07143789529800415,
-0.03183920308947563,
-0.06851354986429214,
-0.020201608538627625,
0.027538234367966652,
0.05138889700174332,
0.029959050938487053,
-1.4843455732672585e-33,
0.017068956047296524,
-0.018151797354221344,
0.051086027175188065,
-0.029112841933965683,
-0.09515316784381866,
0.0004242689465172589,
-0.02150917798280716,
0.06003652140498161,
-0.0799296423792839,
-0.016705602407455444,
-0.0462518148124218,
0.10270662605762482,
-0.004090975970029831,
-0.11050841212272644,
-0.005664970725774765,
-0.040754906833171844,
0.018796704709529877,
0.02789751999080181,
0.019901562482118607,
-0.05319373682141304,
-0.004507497418671846,
-0.016520697623491287,
-0.02894904650747776,
0.01749865710735321,
-0.04402279853820801,
-0.016524914652109146,
-0.07423584908246994,
-0.005553379189223051,
-0.12510384619235992,
-0.01798788458108902,
-0.021955881267786026,
0.023303616791963577,
-0.04521218687295914,
-0.036410585045814514,
0.010906515643000603,
-0.00313126971013844,
0.012323270551860332,
0.01848277635872364,
-0.05086660757660866,
-0.04724634811282158,
-0.016156194731593132,
0.015862606465816498,
-0.045306913554668427,
-0.08176206797361374,
-0.06131359189748764,
0.06868965178728104,
-0.014224889688193798,
-0.028666706755757332,
0.07304400205612183,
-0.004427047912031412,
0.011650430969893932,
0.03867943212389946,
-0.07174725830554962,
-0.032803334295749664,
0.02193325385451317,
0.01586262136697769,
0.010929158888757229,
0.046146854758262634,
0.015117370523512363,
0.0013360611628741026,
0.010212443768978119,
0.024370579048991203,
0.049490101635456085,
0.061502911150455475,
0.13137219846248627,
-0.004178174771368504,
0.06318869441747665,
0.10208747535943985,
0.05558023601770401,
0.08557397872209549,
0.0966501459479332,
0.036192167550325394,
0.045643530786037445,
0.07128159701824188,
0.005480024963617325,
-0.02909889817237854,
0.010935614816844463,
-0.04217415302991867,
-0.025796422734856606,
0.021008877083659172,
-0.006675326731055975,
-0.07593046128749847,
-0.019634399563074112,
0.0013795947888866067,
0.006267177872359753,
0.12078197300434113,
0.01593242585659027,
-0.0019858391024172306,
-0.049797192215919495,
-0.04026408493518829,
-0.0030744168907403946,
-0.0009803861612454057,
-0.07782315462827682,
-0.10387910157442093,
-0.10037726908922195,
1.302699094464079e-33,
0.051812030375003815,
-0.10756088048219681,
0.05921091139316559,
0.038870394229888916,
0.016020698472857475,
-0.0659039095044136,
0.026439670473337173,
0.02146618440747261,
-0.01332056149840355,
0.06716014444828033,
-0.014328130520880222,
-0.08077680319547653,
-0.0016041568014770746,
-0.0014337225584313273,
0.026075512170791626,
0.09826048463582993,
-0.01772083155810833,
-0.04114929214119911,
-0.07147649675607681,
0.024068718776106834,
0.010971296578645706,
0.025484956800937653,
-0.02705899067223072,
0.15070560574531555,
-0.08894456177949905,
-0.038847293704748154,
-0.027455126866698265,
-0.030507849529385567,
-0.10835214704275131,
-0.008369923569262028,
0.004167348146438599,
-0.04318465292453766,
-0.004782889969646931,
0.0856369137763977,
-0.01735210418701172,
0.02893952466547489,
0.0452134944498539,
0.04247092455625534,
-0.035067129880189896,
0.06293096393346786,
-0.039506129920482635,
0.008471068926155567,
-0.058620989322662354,
0.027034340426325798,
0.09229978919029236,
-0.02867974527180195,
0.003137081628665328,
0.10212521255016327,
-0.03990625962615013,
-0.031195269897580147,
-0.010251400992274284,
0.019666312262415886,
-0.0731845274567604,
0.033767059445381165,
0.004935033153742552,
0.019801925867795944,
-0.041539087891578674,
-0.0791783407330513,
-0.03626694157719612,
-0.06478984653949738,
-0.002832891419529915,
-0.05379574000835419,
-0.11134900897741318,
0.07133939117193222,
0.03213295713067055,
-0.032223716378211975,
0.013981719501316547,
-0.0046236575581133366,
-0.09440887719392776,
0.045792702585458755,
-0.010959712788462639,
0.033345889300107956,
0.09044880419969559,
-0.006462958175688982,
0.002426633844152093,
-0.0070755137130618095,
0.1260499507188797,
0.07120420783758163,
0.05300775170326233,
-0.025192951783537865,
-0.032754264771938324,
0.05917489528656006,
0.07318031042814255,
0.04663188382983208,
0.004698161967098713,
0.10322953760623932,
0.0225834921002388,
0.035964809358119965,
-0.08578608185052872,
0.01200451236218214,
-0.046289652585983276,
-0.04302519932389259,
-0.031965550035238266,
-0.040887873619794846,
-0.02945191226899624,
-4.871613157320098e-8,
-0.10101448744535446,
0.05404609069228172,
-0.04403257742524147,
0.06664320826530457,
-0.04509511590003967,
-0.015067181549966335,
0.06690533459186554,
0.08645471185445786,
0.01205221377313137,
-0.02397851087152958,
-0.002652032533660531,
0.04820357635617256,
-0.06199246644973755,
0.020052500069141388,
-0.04827718436717987,
-0.042252540588378906,
-0.0220003854483366,
0.0638284906744957,
-0.02647840417921543,
-0.00957189779728651,
0.01468735933303833,
0.015763869509100914,
0.0012518836883828044,
-0.03228922560811043,
0.0958080068230629,
0.0026095483917742968,
-0.026149507611989975,
0.004272820428013802,
0.09212885797023773,
-0.010809910483658314,
-0.035273823887109756,
-0.024144260212779045,
-0.010087259113788605,
0.014158476144075394,
0.051134586334228516,
-0.08004942536354065,
0.028230976313352585,
0.02483890950679779,
-0.07541011273860931,
0.01618908904492855,
0.03925761952996254,
-0.007287247106432915,
-0.039399679750204086,
0.05071381852030754,
0.05570957437157631,
0.01746431179344654,
-0.03847965970635414,
0.026509800925850868,
0.11312171071767807,
-0.008797775022685528,
0.01506832055747509,
-0.07050899416208267,
-0.028657857328653336,
-0.036055512726306915,
-0.03461821377277374,
-0.053736016154289246,
0.016411561518907547,
-0.0014808694832026958,
-0.008629140444099903,
0.01210158970206976,
0.06775394827127457,
-0.04025791585445404,
-0.015753814950585365,
-0.014859659597277641
] | 0.074205
|
[[search-aggregations-metrics-sum-aggregation]] === Sum Aggregation A `single-value` metrics aggregation that sums up numeric values that are extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. Assuming the data consists of documents representing sales records we can sum the sale price of all hats with: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "query" : { "constant\_score" : { "filter" : { "match" : { "type" : "hat" } } } }, "aggs" : { "hat\_prices" : { "sum" : { "field" : "price" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] Resulting in: [source,js] -------------------------------------------------- { ... "aggregations": { "hat\_prices": { "value": 450.0 } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] The name of the aggregation (`hat\_prices` above) also serves as the key by which the aggregation result can be retrieved from the returned response. ==== Script We could also use a script to fetch the sales price: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "query" : { "constant\_score" : { "filter" : { "match" : { "type" : "hat" } } } }, "aggs" : { "hat\_prices" : { "sum" : { "script" : { "source": "doc.price.value" } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a stored script use the following syntax: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "query" : { "constant\_score" : { "filter" : { "match" : { "type" : "hat" } } } }, "aggs" : { "hat\_prices" : { "sum" : { "script" : { "id": "my\_script", "params" : { "field" : "price" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales,stored\_example\_script] ===== Value Script It is also possible to access the field value from the script using `\_value`. For example, this will sum the square of the prices for all hats: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "query" : { "constant\_score" : { "filter" : { "match" : { "type" : "hat" } } } }, "aggs" : { "square\_hats" : { "sum" : { "field" : "price", "script" : { "source": "\_value \* \_value" } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] ==== Missing value The `missing` parameter defines how documents that are missing a value should be treated. By default documents missing the value will be ignored but it is also possible to treat them as if they had a value. For example, this treats all hat sales without a price as being `100`. [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "query" : { "constant\_score" : { "filter" : { "match" : { "type" : "hat" } } } }, "aggs" : { "hat\_prices" : { "sum" : { "field" : "price", "missing": 100 <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/sum-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.029977602884173393,
0.1141248270869255,
-0.013023673556745052,
0.10205090790987015,
-0.011874317191541195,
0.10320883244276047,
0.010040379129350185,
0.06173914670944214,
0.0811224952340126,
-0.03483375534415245,
-0.09123814851045609,
-0.0693831667304039,
0.00970130879431963,
-0.007109157741069794,
-0.04132827743887901,
0.015141982585191727,
-0.06847737729549408,
0.06660260260105133,
-0.01940658502280712,
-0.09416258335113525,
0.021139198914170265,
0.05088347569108009,
-0.0020396923646330833,
-0.06069892644882202,
0.05098947137594223,
-0.01707708090543747,
-0.05634723976254463,
-0.02919141575694084,
-0.005999336019158363,
0.04902530461549759,
-0.0565640814602375,
0.0006939825252629817,
0.05301404371857643,
0.09905051440000534,
-0.01731250435113907,
-0.06287265568971634,
0.013950991444289684,
0.024753501638770103,
0.02499960921704769,
0.016302987933158875,
0.05493432283401489,
0.019402476027607918,
-0.07608211785554886,
-0.09432662278413773,
0.042494211345911026,
-0.076499804854393,
-0.04993534833192825,
0.01579258404672146,
0.011300433427095413,
0.09692844748497009,
-0.017419127747416496,
0.05742727965116501,
-0.021881820634007454,
0.012529485858976841,
0.027490362524986267,
0.0346003957092762,
-0.058920376002788544,
-0.04502622038125992,
0.009121947921812534,
-0.09241873770952225,
-0.032015252858400345,
-0.12470542639493942,
-0.003170210402458906,
-0.023514945060014725,
0.026484426110982895,
-0.04238481819629669,
-0.035279471427202225,
0.03905351087450981,
-0.03393091261386871,
0.014035588130354881,
0.0654972568154335,
-0.024165982380509377,
0.043837834149599075,
-0.10007190704345703,
0.008851335383951664,
0.060250312089920044,
0.0053092981688678265,
-0.06622926890850067,
0.023633448407053947,
0.05985001474618912,
-0.08580221980810165,
-0.06678546965122223,
-0.05091381445527077,
0.03340074047446251,
-0.00685291551053524,
-0.030557086691260338,
0.0558343268930912,
-0.04066256433725357,
0.057577718049287796,
-0.0486251525580883,
-0.10009995102882385,
-0.01952151209115982,
-0.009068080224096775,
0.005786263849586248,
0.05395728722214699,
0.01951700448989868,
-0.006607765797525644,
-0.004148426931351423,
0.11882750689983368,
0.030407918617129326,
0.06438665091991425,
-0.002765247831121087,
0.0017932858318090439,
-0.10022938251495361,
-0.03939012810587883,
0.025940071791410446,
0.008022702299058437,
0.034130677580833435,
-0.08148746192455292,
-0.026913583278656006,
-0.02464294619858265,
-0.03405909612774849,
-0.050175514072179794,
0.003727810923010111,
-0.020969169214367867,
0.048160456120967865,
0.05625523254275322,
-0.060247767716646194,
-0.005226925481110811,
0.016954360529780388,
0.0875871330499649,
0.049414556473493576,
0.032644692808389664,
0.0032292623072862625,
-0.012846669182181358,
0.027823397889733315,
0.014667733572423458,
-8.306838378307012e-34,
-0.01942121610045433,
-0.07909750938415527,
0.025568582117557526,
-0.05700678378343582,
-0.011955742724239826,
0.05711566284298897,
0.038363806903362274,
0.08112305402755737,
-0.023494305089116096,
0.0785391554236412,
-0.059811752289533615,
0.15895427763462067,
-0.07865846902132034,
-0.0689026415348053,
0.027240075170993805,
0.00475618802011013,
-0.017464954406023026,
-0.015643075108528137,
0.05264656990766525,
-0.03909086808562279,
0.07849991321563721,
-0.0031229443848133087,
0.010463529266417027,
0.08802817761898041,
0.007848244160413742,
0.00043298196396790445,
-0.01781614124774933,
0.005174580030143261,
-0.06394069641828537,
-0.00495289359241724,
0.006602461915463209,
-0.011087550781667233,
-0.0043683103285729885,
-0.04892122372984886,
-0.03477799519896507,
0.007173997815698385,
-0.019169896841049194,
0.022336572408676147,
0.016907114535570145,
0.02842317707836628,
-0.024671919643878937,
0.032859835773706436,
0.02794637531042099,
-0.1453813761472702,
-0.13255992531776428,
0.05310175195336342,
-0.026125505566596985,
0.023986494168639183,
0.06441158056259155,
0.04661828279495239,
-0.05616946518421173,
-0.027632450684905052,
-0.00020139649859629571,
0.003363164607435465,
0.036788489669561386,
-0.010003241710364819,
-0.01948987878859043,
0.045994073152542114,
0.008966727182269096,
-0.018460677936673164,
-0.09171425551176071,
-0.001845725579187274,
0.05379762500524521,
-0.004392340313643217,
-0.023029765114188194,
0.04872628673911095,
0.04584689065814018,
0.08564402163028717,
-0.01768301986157894,
0.05101751163601875,
0.06324080377817154,
0.07226534932851791,
0.0017769468249753118,
0.014183800667524338,
0.09174840152263641,
-0.037906669080257416,
0.09367476403713226,
0.08956146240234375,
-0.02132559008896351,
0.03954577073454857,
-0.01713656634092331,
0.00441303476691246,
0.03557887300848961,
0.041073862463235855,
0.005075085908174515,
0.12948185205459595,
-0.029939396306872368,
0.007344563491642475,
-0.060080014169216156,
-0.059205085039138794,
-0.014869049191474915,
0.05201162025332451,
-0.12959443032741547,
-0.07423141598701477,
-0.03551580756902695,
-2.7744160013126675e-34,
-0.030381139367818832,
0.016610806807875633,
-0.011713351123034954,
0.008810416795313358,
0.026819776743650436,
0.0038149848114699125,
-0.013533860445022583,
-0.017160145565867424,
0.036028798669576645,
0.025348961353302002,
-0.0495065376162529,
-0.05067254230380058,
0.01570572331547737,
-0.05740886554121971,
-0.04510887712240219,
-0.0026221058797091246,
-0.052626799792051315,
-0.05553111061453819,
0.038279805332422256,
0.0045395768247544765,
-0.05252702906727791,
0.0584433488547802,
0.043852854520082474,
0.08408533781766891,
-0.031197331845760345,
-0.04232116788625717,
0.01099663507193327,
-0.003544745733961463,
-0.09790808707475662,
0.0648425817489624,
0.049309518188238144,
-0.03389493376016617,
-0.020420588552951813,
0.07725420594215393,
-0.05951741710305214,
-0.049848832190036774,
0.05312316492199898,
0.02431577444076538,
0.016507918015122414,
0.03947388753294945,
-0.04291805997490883,
0.0006613172590732574,
-0.0026332854758948088,
-0.014396858401596546,
0.06849236786365509,
-0.029594464227557182,
0.031173845753073692,
0.019282091408967972,
-0.0082506462931633,
-0.07523880898952484,
0.004268313758075237,
0.040604524314403534,
-0.119902603328228,
0.04184649884700775,
-0.10355372726917267,
-0.009132358245551586,
-0.021541012451052666,
-0.051714226603507996,
-0.05682205408811569,
-0.006819066125899553,
-0.013628113083541393,
-0.040329474955797195,
-0.04699349030852318,
0.050015851855278015,
0.03188192844390869,
-0.05407165363430977,
0.00501299137249589,
-0.09834452718496323,
-0.03585796430706978,
0.0004233087529428303,
0.03439715504646301,
-0.03365134820342064,
0.11894979327917099,
0.053800683468580246,
-0.04252832382917404,
0.015917019918560982,
0.025305181741714478,
0.008624129928648472,
0.09978163987398148,
0.007831024006009102,
-0.016782380640506744,
0.01136519480496645,
0.08332689851522446,
0.06328480690717697,
-0.02831851877272129,
0.006262118462473154,
-0.014783757738769054,
0.09680955857038498,
-0.02496490813791752,
0.028894545510411263,
-0.12129049003124237,
-0.023092476651072502,
-0.02517753839492798,
-0.0437823086977005,
0.0023505529388785362,
-4.521357510611779e-8,
-0.03334932029247284,
0.039273422211408615,
-0.04590823873877525,
0.08869075030088425,
-0.03371627256274223,
0.0388677753508091,
0.044117461889982224,
0.0862656980752945,
-0.05175899341702461,
-0.012688467279076576,
0.013192003592848778,
0.010622959583997726,
-0.09063784033060074,
0.03750484064221382,
-0.09391453862190247,
0.019982555881142616,
0.005963694304227829,
0.07890184968709946,
-0.0006908471114002168,
-0.051494497805833817,
0.09968148916959763,
0.06917426735162735,
0.039916787296533585,
-0.0031981931533664465,
0.05704401433467865,
0.002643424551934004,
-0.017715228721499443,
0.03128000348806381,
0.051620956510305405,
0.006548955570906401,
-0.023651359602808952,
-0.01010634284466505,
-0.03720980882644653,
0.02256418578326702,
0.04863870143890381,
-0.02738935500383377,
-0.020196422934532166,
0.06783723831176758,
-0.07785245776176453,
0.05722301825881004,
-0.022252101451158524,
0.05694938451051712,
-0.06108340248465538,
0.020119603723287582,
0.0008659427985548973,
-0.017765937373042107,
-0.06099105626344681,
0.015959450975060463,
0.06196962296962738,
-0.030737385153770447,
0.11621302366256714,
-0.08229033648967743,
-0.004092121962457895,
-0.02692496031522751,
-0.071539007127285,
-0.07773370295763016,
0.010263457894325256,
-0.03526882082223892,
0.002580700907856226,
-0.009515873156487942,
0.0019924871157854795,
-0.10416824370622635,
-0.0590231753885746,
-0.03662833571434021
] | 0.025483
|
[[search-aggregations-metrics-scripted-metric-aggregation]] === Scripted Metric Aggregation experimental[] A metric aggregation that executes using scripts to provide a metric output. Example: [source,js] -------------------------------------------------- POST ledger/\_search?size=0 { "query" : { "match\_all" : {} }, "aggs": { "profit": { "scripted\_metric": { "init\_script" : "params.\_agg.transactions = []", "map\_script" : "params.\_agg.transactions.add(doc.type.value == 'sale' ? doc.amount.value : -1 \* doc.amount.value)", <1> "combine\_script" : "double profit = 0; for (t in params.\_agg.transactions) { profit += t } return profit", "reduce\_script" : "double profit = 0; for (a in params.\_aggs) { profit += a } return profit" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:ledger] <1> `map\_script` is the only required parameter The above aggregation demonstrates how one would use the script aggregation compute the total profit from sale and cost transactions. The response for the above aggregation: [source,js] -------------------------------------------------- { "took": 218, ... "aggregations": { "profit": { "value": 240.0 } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 218/"took": $body.took/] // TESTRESPONSE[s/\.\.\./"\_shards": $body.\_shards, "hits": $body.hits, "timed\_out": false,/] The above example can also be specified using stored scripts as follows: [source,js] -------------------------------------------------- POST ledger/\_search?size=0 { "aggs": { "profit": { "scripted\_metric": { "init\_script" : { "id": "my\_init\_script" }, "map\_script" : { "id": "my\_map\_script" }, "combine\_script" : { "id": "my\_combine\_script" }, "params": { "field": "amount", <1> "\_agg": {} <2> }, "reduce\_script" : { "id": "my\_reduce\_script" } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:ledger,stored\_scripted\_metric\_script] <1> script parameters for `init`, `map` and `combine` scripts must be specified in a global `params` object so that it can be share between the scripts. <2> if you specify script parameters then you must specify `"\_agg": {}`. //// Verify this response as well but in a hidden block. [source,js] -------------------------------------------------- { "took": 218, ... "aggregations": { "profit": { "value": 240.0 } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 218/"took": $body.took/] // TESTRESPONSE[s/\.\.\./"\_shards": $body.\_shards, "hits": $body.hits, "timed\_out": false,/] //// For more details on specifying scripts see <>. ==== Allowed return types Whilst any valid script object can be used within a single script, the scripts must return or store in the `\_agg` object only the following types: \* primitive types \* String \* Map (containing only keys and values of the types listed here) \* Array (containing elements of only the types listed here) ==== Scope of scripts The scripted metric aggregation uses scripts at 4 stages of its execution: init\_script:: Executed prior to any collection of documents. Allows the aggregation to set up any initial state. + In the above example, the `init\_script` creates an array `transactions` in the `\_agg` object. map\_script:: Executed once per document collected. This is the only required script. If no combine\_script is specified, the resulting state needs to be stored in an object named `\_agg`. + In the above example, the `map\_script` checks the value of the type field. If the value is 'sale' the value of the amount field is added to the transactions array. If the value of the type field is not 'sale' the negated value of the amount field is added to transactions. combine\_script:: Executed once on each shard after document collection is complete. Allows the aggregation to consolidate the state returned from each shard. If a combine\_script is not provided the combine phase will return the aggregation variable. + In the above example, the `combine\_script` iterates through all the stored transactions, summing the values in the `profit` variable and finally returns `profit`. reduce\_script:: Executed once on the coordinating node after all shards have returned their results. The script is provided with access to a variable `\_aggs` which is an array of the result of the combine\_script on each shard. If a reduce\_script is not provided the reduce phase will
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/scripted-metric-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.041478291153907776,
0.0517166331410408,
-0.023930538445711136,
0.08302584290504456,
-0.0744924396276474,
0.013627825304865837,
0.005152552854269743,
0.08797281235456467,
0.07291959971189499,
-0.00007984693365870044,
-0.021323159337043762,
-0.06958115100860596,
0.013015935197472572,
-0.014617079868912697,
-0.008390260860323906,
0.02652720734477043,
-0.0498073473572731,
0.03813726827502251,
-0.030727628618478775,
-0.07161460816860199,
0.0497329905629158,
0.027264902368187904,
0.02374647930264473,
-0.05359330400824547,
0.01818915084004402,
-0.016273993998765945,
-0.08492869138717651,
-0.03670787066221237,
-0.04968790337443352,
0.05907392501831055,
-0.019649244844913483,
-0.0071603464893996716,
0.031992409378290176,
0.09069079905748367,
0.07326921820640564,
0.06666376441717148,
0.01322266273200512,
-0.004819132853299379,
-0.00010518194176256657,
-0.026446010917425156,
0.055618107318878174,
-0.02077617682516575,
-0.03317541256546974,
-0.12403847277164459,
0.00003457860657363199,
-0.09953612089157104,
-0.07963167130947113,
0.008716417476534843,
0.002368141198530793,
0.05480087548494339,
-0.0701441764831543,
-0.02608419954776764,
-0.044014137238264084,
-0.032510850578546524,
0.060970112681388855,
0.0522582046687603,
-0.05130298063158989,
-0.04080955311655998,
-0.039987463504076004,
-0.1621415913105011,
0.01323061902076006,
-0.05256263539195061,
-0.014924815855920315,
-0.029510006308555603,
0.023620083928108215,
-0.020396335050463676,
0.0018478315323591232,
0.08039339631795883,
-0.09308374673128128,
0.0763692632317543,
-0.0038744453340768814,
-0.0018815976800397038,
0.003443680703639984,
-0.08226889371871948,
0.028223784640431404,
0.04003576189279556,
-0.023996710777282715,
-0.05213354527950287,
0.0064058126881718636,
-0.05871095880866051,
-0.057460490614175797,
-0.07152766734361649,
-0.07170259952545166,
0.03269525244832039,
-0.0071791657246649265,
-0.04087822511792183,
0.07898165285587311,
-0.04234772548079491,
0.13361699879169464,
-0.08202062547206879,
-0.05158252641558647,
-0.007775055710226297,
-0.02098391391336918,
-0.03853553533554077,
0.022462310269474983,
0.04251151531934738,
-0.012440972961485386,
-0.0337945781648159,
0.1140255555510521,
0.04156108945608139,
0.06315585225820541,
0.0157527606934309,
0.018895065411925316,
-0.11453435570001602,
0.006327181588858366,
0.052594952285289764,
-0.029703501611948013,
0.02867811731994152,
-0.015385910868644714,
-0.014717139303684235,
-0.0010518283816054463,
0.05797237157821655,
-0.004430640954524279,
-0.00908963568508625,
-0.009838382713496685,
0.0668954849243164,
0.03382362425327301,
-0.06560873240232468,
0.02079474739730358,
0.03553401306271553,
0.08758976310491562,
0.06801861524581909,
-0.020925259217619896,
0.015654152259230614,
0.009550784714519978,
0.05894478037953377,
0.01198797207325697,
-1.895849411291678e-33,
-0.021577559411525726,
-0.1012517660856247,
0.05385507270693779,
-0.04495542123913765,
0.004953347146511078,
0.10457009077072144,
0.007480131462216377,
0.06188438832759857,
-0.09165038913488388,
0.07264620065689087,
-0.09034489840269089,
0.12295794486999512,
-0.06451322883367538,
-0.017372146248817444,
-0.017553014680743217,
0.007899637334048748,
-0.020314009860157967,
0.04709587246179581,
0.07221373915672302,
-0.031517431139945984,
0.028682788833975792,
-0.029338030144572258,
0.011879771947860718,
0.07004240155220032,
-0.02926155924797058,
-0.029157161712646484,
-0.07658521831035614,
-0.008949095383286476,
-0.06869685649871826,
-0.0032718414440751076,
0.013516886159777641,
0.010004162788391113,
-0.030063973739743233,
-0.02227706089615822,
-0.036625150591135025,
0.0018163213972002268,
-0.05377717688679695,
0.02869417518377304,
-0.027883274480700493,
-0.0009910459630191326,
-0.06377913057804108,
-0.007575152907520533,
0.0221499502658844,
-0.11497446894645691,
-0.12277145683765411,
0.050058748573064804,
-0.04235773906111717,
0.023599836975336075,
0.08338642865419388,
0.022767571732401848,
-0.03667629882693291,
-0.013850989751517773,
0.005166201386600733,
-0.01805208995938301,
0.015575895085930824,
-0.003829214721918106,
-0.02940790168941021,
0.04278970882296562,
-0.000774708460085094,
-0.026974566280841827,
-0.07159903645515442,
0.011991562321782112,
0.0056369551457464695,
-0.016835924237966537,
-0.021205827593803406,
0.04237029328942299,
0.08495888859033585,
0.09642454981803894,
-0.005118310451507568,
0.05626292899250984,
0.04116373136639595,
0.050184108316898346,
0.0011294580763205886,
0.03346007317304611,
0.09749733656644821,
-0.12310938537120819,
0.08993057161569595,
0.0001641393464524299,
-0.01598813384771347,
0.026941053569316864,
-0.0076663801446557045,
-0.03336749225854874,
-0.023510748520493507,
0.007533614058047533,
-0.027355823665857315,
0.13010084629058838,
-0.009464128874242306,
0.014709425158798695,
-0.02921573631465435,
-0.04038489982485771,
-0.02900727279484272,
0.00820532999932766,
-0.10516147315502167,
-0.06852566450834274,
-0.0035276473499834538,
-1.3526175640977013e-33,
0.02165372110903263,
0.008300909772515297,
0.0346040241420269,
0.028724251314997673,
0.007383246906101704,
-0.0337245911359787,
0.05491819977760315,
-0.025007426738739014,
0.022143321111798286,
0.05053858458995819,
-0.010187110863626003,
-0.02855079621076584,
-0.01132042147219181,
-0.03741394728422165,
-0.0035012969747185707,
0.010693326592445374,
-0.058912672102451324,
-0.03313000872731209,
0.05428023263812065,
-0.0029897603671997786,
0.022832699120044708,
0.07746021449565887,
0.01583239808678627,
0.15524496138095856,
-0.04542652890086174,
-0.045895326882600784,
-0.05460968613624573,
0.020500926300883293,
-0.11069947481155396,
0.011826236732304096,
0.0625317245721817,
0.0021752542816102505,
-0.03343193233013153,
0.07623592764139175,
-0.006933482363820076,
-0.06449445337057114,
0.07702813297510147,
0.04157346859574318,
-0.03213666379451752,
0.03568248078227043,
-0.02283599227666855,
0.0026711151003837585,
-0.03960499167442322,
0.033099520951509476,
0.059343256056308746,
-0.003334746928885579,
0.05970172584056854,
0.061534397304058075,
0.007758602499961853,
-0.05044965073466301,
-0.02465861476957798,
-0.005997182335704565,
-0.06771410256624222,
0.024418793618679047,
-0.10280227661132812,
-0.0033483810257166624,
0.028233986347913742,
-0.06797080487012863,
-0.08313196152448654,
0.007777347229421139,
-0.03775983303785324,
-0.013170171529054642,
0.012986574321985245,
0.033711500465869904,
0.038977522403001785,
-0.016613857820630074,
-0.022960033267736435,
-0.04686244577169418,
-0.020971862599253654,
0.0008688129601068795,
-0.02956555411219597,
-0.02507287822663784,
0.06430409103631973,
-0.02658708021044731,
-0.007885769940912724,
0.10281794518232346,
-0.011254282668232918,
-0.06977273523807526,
0.05322842299938202,
0.048285070806741714,
-0.009051973931491375,
0.020448412746191025,
0.12184690684080124,
0.04413363337516785,
-0.09369176626205444,
0.027878787368535995,
0.010707651264965534,
0.11739899963140488,
-0.03847791254520416,
0.05361443758010864,
-0.1011258214712143,
-0.029148001223802567,
0.014690644107758999,
-0.010914421640336514,
-0.01660315692424774,
-4.8891969584019535e-8,
-0.07619690150022507,
0.0452241525053978,
-0.03751682490110397,
0.06707093864679337,
-0.0611485093832016,
0.02217474952340126,
0.04591018706560135,
0.10920305550098419,
-0.03245539963245392,
-0.02174985781311989,
-0.0033634433057159185,
-0.0018350135069340467,
-0.09665530920028687,
0.06198004633188248,
-0.050890229642391205,
-0.06419450789690018,
-0.06246060132980347,
0.013403521850705147,
-0.045978955924510956,
-0.02258952334523201,
0.06949055194854736,
0.04287947714328766,
0.034635160118341446,
-0.018919872120022774,
0.06466259062290192,
-0.01747404970228672,
0.010054749436676502,
0.047959040850400925,
0.03589123860001564,
-0.02956145629286766,
0.01925271935760975,
-0.03758709132671356,
-0.015012441202998161,
0.05605850741267204,
0.035361915826797485,
-0.030003001913428307,
0.022925546392798424,
0.04188700020313263,
-0.04237822815775871,
0.0397406704723835,
0.004386803600937128,
0.05974630266427994,
-0.06216861680150032,
0.021573228761553764,
0.047091446816921234,
-0.0017919876845553517,
-0.07229919731616974,
0.02305135317146778,
0.09982624650001526,
-0.044126953929662704,
0.048979371786117554,
-0.06999044120311737,
0.011611487716436386,
-0.030707253143191338,
-0.05456967279314995,
-0.0882590189576149,
0.013337073847651482,
-0.0017677457071840763,
0.016538267955183983,
-0.003629830665886402,
0.024039406329393387,
-0.13163046538829803,
-0.021162226796150208,
-0.042080238461494446
] | 0.043318
|
finally returns `profit`. reduce\_script:: Executed once on the coordinating node after all shards have returned their results. The script is provided with access to a variable `\_aggs` which is an array of the result of the combine\_script on each shard. If a reduce\_script is not provided the reduce phase will return the `\_aggs` variable. + In the above example, the `reduce\_script` iterates through the `profit` returned by each shard summing the values before returning the final combined profit which will be returned in the response of the aggregation. ==== Worked Example Imagine a situation where you index the following documents into an index with 2 shards: [source,js] -------------------------------------------------- PUT /transactions/\_doc/\_bulk?refresh {"index":{"\_id":1}} {"type": "sale","amount": 80} {"index":{"\_id":2}} {"type": "cost","amount": 10} {"index":{"\_id":3}} {"type": "cost","amount": 30} {"index":{"\_id":4}} {"type": "sale","amount": 130} -------------------------------------------------- // CONSOLE Lets say that documents 1 and 3 end up on shard A and documents 2 and 4 end up on shard B. The following is a breakdown of what the aggregation result is at each stage of the example above. ===== Before init\_script No params object was specified so the default params object is used: [source,js] -------------------------------------------------- "params" : { "\_agg" : {} } -------------------------------------------------- // NOTCONSOLE ===== After init\_script This is run once on each shard before any document collection is performed, and so we will have a copy on each shard: Shard A:: + [source,js] -------------------------------------------------- "params" : { "\_agg" : { "transactions" : [] } } -------------------------------------------------- // NOTCONSOLE Shard B:: + [source,js] -------------------------------------------------- "params" : { "\_agg" : { "transactions" : [] } } -------------------------------------------------- // NOTCONSOLE ===== After map\_script Each shard collects its documents and runs the map\_script on each document that is collected: Shard A:: + [source,js] -------------------------------------------------- "params" : { "\_agg" : { "transactions" : [ 80, -30 ] } } -------------------------------------------------- // NOTCONSOLE Shard B:: + [source,js] -------------------------------------------------- "params" : { "\_agg" : { "transactions" : [ -10, 130 ] } } -------------------------------------------------- // NOTCONSOLE ===== After combine\_script The combine\_script is executed on each shard after document collection is complete and reduces all the transactions down to a single profit figure for each shard (by summing the values in the transactions array) which is passed back to the coordinating node: Shard A:: 50 Shard B:: 120 ===== After reduce\_script The reduce\_script receives an `\_aggs` array containing the result of the combine script for each shard: [source,js] -------------------------------------------------- "\_aggs" : [ 50, 120 ] -------------------------------------------------- // NOTCONSOLE It reduces the responses for the shards down to a final overall profit figure (by summing the values) and returns this as the result of the aggregation to produce the response: [source,js] -------------------------------------------------- { ... "aggregations": { "profit": { "value": 170 } } } -------------------------------------------------- // NOTCONSOLE ==== Other Parameters [horizontal] params:: Optional. An object whose contents will be passed as variables to the `init\_script`, `map\_script` and `combine\_script`. This can be useful to allow the user to control the behavior of the aggregation and for storing state between the scripts. If this is not specified, the default is the equivalent of providing: + [source,js] -------------------------------------------------- "params" : { "\_agg" : {} } -------------------------------------------------- // NOTCONSOLE ==== Empty Buckets If a parent bucket of the scripted metric aggregation does not collect any documents an empty aggregation response will be returned from the shard with a `null` value. In this case the `reduce\_script`'s `\_aggs` variable will contain `null` as a response from that shard. `reduce\_script`'s should therefore expect and deal with `null` responses from shards.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/scripted-metric-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.016222769394516945,
0.07639607042074203,
0.07885091751813889,
0.1235634908080101,
-0.024373503401875496,
0.00045769423013553023,
-0.006880905479192734,
-0.019139645621180534,
0.10333527624607086,
-0.0019697649404406548,
-0.005671361461281776,
0.02399086393415928,
0.022612178698182106,
-0.06385499238967896,
-0.02366224117577076,
-0.012278757989406586,
-0.03202572092413902,
0.027040287852287292,
-0.07984737306833267,
-0.0888383612036705,
0.032648976892232895,
-0.012475837022066116,
-0.0192786306142807,
-0.04522006958723068,
-0.008055245503783226,
-0.04474285989999771,
-0.11651016771793365,
-0.04945848509669304,
0.046416208148002625,
0.008601045235991478,
0.032721273601055145,
-0.027599290013313293,
-0.08011158555746078,
-0.006924016866832972,
-0.030834218487143517,
0.09806932508945465,
0.020909499377012253,
-0.0661473199725151,
-0.03342971205711365,
0.013629757799208164,
0.04582471773028374,
0.017629632726311684,
-0.0928444042801857,
-0.040969379246234894,
0.038487162441015244,
-0.05313520133495331,
-0.045072026550769806,
0.000502618495374918,
-0.033195044845342636,
-0.03615522012114525,
-0.033381830900907516,
-0.04306720569729805,
-0.039663027971982956,
-0.0017709130188450217,
0.01829610951244831,
0.04662251099944115,
-0.05717257782816887,
0.004900642205029726,
-0.0293801948428154,
-0.08420760184526443,
0.03249609097838402,
-0.09209498763084412,
0.004854690283536911,
-0.04354650154709816,
0.060716673731803894,
-0.005511720664799213,
0.08204380422830582,
0.02510988526046276,
-0.03908131644129753,
-0.0032865682151168585,
0.038577839732170105,
-0.010780981741845608,
-0.02080557495355606,
-0.08153952658176422,
0.05567438155412674,
0.0730409175157547,
0.007666052784770727,
-0.05079761892557144,
-0.010358738712966442,
0.03514545038342476,
-0.12322750687599182,
-0.09768309444189072,
-0.007780814077705145,
-0.06890641152858734,
-0.022764988243579865,
-0.07364338636398315,
-0.01764422282576561,
-0.03487282618880272,
0.10717912018299103,
-0.029390115290880203,
-0.07069896906614304,
0.0025481560733169317,
0.02158317156136036,
-0.04039451852440834,
0.08608675003051758,
0.06009248271584511,
-0.007865053601562977,
0.06615957617759705,
0.08334720879793167,
0.03369772806763649,
0.017231212928891182,
0.035110075026750565,
0.0028085780795663595,
-0.13371391594409943,
0.01249176636338234,
-0.024103805422782898,
-0.04136139899492264,
0.0389370359480381,
-0.08340419083833694,
-0.041988398879766464,
0.01033815834671259,
0.03442545607686043,
0.05481765791773796,
0.02900114841759205,
0.008022875525057316,
0.1004621759057045,
0.10390646755695343,
-0.051268093287944794,
0.02328399382531643,
-0.03400852158665657,
0.13074560463428497,
0.05802425369620323,
0.08701576292514801,
0.027142027392983437,
-0.005766159854829311,
0.006805934011936188,
-0.023095272481441498,
-1.2705057021084144e-33,
-0.00046755210496485233,
-0.06488069146871567,
0.018573332577943802,
-0.05667893961071968,
0.012702958658337593,
0.07065172493457794,
0.009045403450727463,
0.05961103364825249,
-0.06224995478987694,
0.05180906504392624,
-0.12818217277526855,
0.12654328346252441,
-0.04728827252984047,
-0.06192968413233757,
-0.05220034345984459,
-0.08385595679283142,
0.052076466381549835,
0.06611043214797974,
0.0078112781047821045,
-0.03596463054418564,
0.04930305480957031,
0.020134547725319862,
-0.001791341113857925,
0.05949554592370987,
-0.02983570285141468,
-0.01161669660359621,
-0.053982242941856384,
-0.05422413349151611,
-0.07455021142959595,
-0.027547644451260567,
-0.023514457046985626,
0.014032104052603245,
-0.021428557112812996,
-0.0027923807501792908,
-0.058980926871299744,
0.03085879422724247,
-0.035865962505340576,
0.019343527033925056,
-0.03049708902835846,
-0.05782686546444893,
0.025075607001781464,
0.030955590307712555,
0.03934802860021591,
-0.07971683889627457,
-0.13485553860664368,
-0.017229557037353516,
-0.07594730705022812,
0.06979040801525116,
0.0018075928092002869,
0.030179236084222794,
-0.0384778268635273,
0.017230620607733727,
0.025025105103850365,
0.04829525202512741,
0.017653685063123703,
0.002587288385257125,
-0.007028954569250345,
0.03473006933927536,
-0.04787576198577881,
0.03190465271472931,
0.03659610077738762,
-0.007905898615717888,
-0.02564740739762783,
0.07041402906179428,
-0.027493685483932495,
0.008874200284481049,
0.09462825953960419,
0.12789630889892578,
0.02067149430513382,
0.07436414808034897,
0.015392795205116272,
0.13673508167266846,
0.007663321681320667,
0.005104914773255587,
0.09412160515785217,
-0.1320602297782898,
-0.0025838345754891634,
-0.05760011076927185,
-0.04564733803272247,
-0.0003152270510327071,
-0.0016060626367107034,
0.005496271885931492,
-0.027949482202529907,
-0.002437541726976633,
-0.05540012940764427,
0.16568394005298615,
-0.009583542123436928,
0.0004228389880154282,
-0.018034212291240692,
-0.08486896008253098,
-0.031244901940226555,
-0.028057940304279327,
-0.007630607578903437,
-0.08755557984113693,
0.0017158803530037403,
-1.3417216498205403e-33,
0.07256879657506943,
-0.05282368138432503,
-0.02226758748292923,
0.026168711483478546,
0.0022850262466818094,
-0.009380476549267769,
0.10394293069839478,
-0.06320910155773163,
-0.0190498735755682,
-0.004157126881182194,
-0.006974248681217432,
-0.055530983954668045,
0.0323496013879776,
0.03207971155643463,
-0.027889937162399292,
0.009060341864824295,
-0.005473272409290075,
-0.12043700367212296,
0.10013681650161743,
0.015575620345771313,
-0.056440506130456924,
0.024679668247699738,
0.033702291548252106,
0.09609072655439377,
-0.07648483663797379,
-0.03672439977526665,
-0.026819001883268356,
-0.005711925216019154,
-0.06117459386587143,
0.025830334052443504,
0.032941319048404694,
-0.056053075939416885,
-0.05010996013879776,
0.026844564825296402,
-0.031192028895020485,
-0.02789667621254921,
0.004756330046802759,
-0.000058095694839721546,
0.015088257379829884,
0.07001309841871262,
0.034182872623205185,
-0.003294202731922269,
-0.0774240493774414,
0.07421623170375824,
0.03339926898479462,
0.013799771666526794,
0.03146704286336899,
0.04943590238690376,
0.025159260258078575,
-0.07237062603235245,
0.01148859690874815,
-0.0348937027156353,
-0.02712772600352764,
0.11341581493616104,
-0.07263772934675217,
-0.022238707169890404,
0.011572705581784248,
-0.05561240389943123,
-0.12767568230628967,
0.024176785722374916,
-0.05142548680305481,
-0.05916846916079521,
-0.02446119487285614,
0.013455083593726158,
-0.020180698484182358,
-0.0077808271162211895,
-0.02489524893462658,
-0.09231516718864441,
0.02424054779112339,
-0.04934360831975937,
0.02258627861738205,
-0.02694399282336235,
0.04534483700990677,
0.0064877914264798164,
0.019194470718503,
0.037360768765211105,
-0.034620501101017,
-0.06664557009935379,
0.0432310625910759,
0.04341009631752968,
-0.0470377616584301,
0.05486650764942169,
0.04120885208249092,
-0.004313225857913494,
-0.025203438475728035,
-0.05901910737156868,
-0.008825301192700863,
0.10239540785551071,
-0.044159308075904846,
0.06228860840201378,
-0.052907705307006836,
-0.016232945024967194,
0.021874362602829933,
0.028072895482182503,
0.027187960222363472,
-4.748556392542014e-8,
-0.011569583788514137,
0.08386719971895218,
-0.04562026634812355,
0.05677836760878563,
-0.02631746232509613,
-0.027941452339291573,
0.025180447846651077,
0.044185034930706024,
-0.05607830360531807,
-0.044133260846138,
-0.0002959179400932044,
-0.039395395666360855,
-0.0005097776302136481,
-0.015069006942212582,
-0.015955187380313873,
0.019167372956871986,
0.02498668245971203,
0.018259884789586067,
-0.009699189104139805,
-0.04015989601612091,
0.01699100062251091,
-0.0013182441471144557,
0.03086790256202221,
-0.009136473760008812,
0.02503572776913643,
0.06297566741704941,
0.025312913581728935,
0.017381155863404274,
0.03142087906599045,
-0.02615504339337349,
-0.0008773987647145987,
-0.02617182582616806,
0.011701585724949837,
0.037998877465724945,
-0.036061204969882965,
0.06658178567886353,
0.05335855856537819,
0.05891517922282219,
0.05300474911928177,
0.06627008318901062,
-0.0335313118994236,
0.008154412731528282,
-0.05164381116628647,
0.01759526878595352,
-0.012793507426977158,
0.0005397013737820089,
-0.07287859916687012,
0.010012896731495857,
0.07551711797714233,
-0.01097499392926693,
0.03664190322160721,
-0.0436350479722023,
0.048812124878168106,
-0.009267003275454044,
0.005814606789499521,
-0.05715283006429672,
0.03390888869762421,
-0.016710668802261353,
0.041112158447504044,
0.047788649797439575,
0.06106773018836975,
-0.11261270195245743,
-0.007993527688086033,
-0.06657392531633377
] | 0.032425
|
this case the `reduce\_script`'s `\_aggs` variable will contain `null` as a response from that shard. `reduce\_script`'s should therefore expect and deal with `null` responses from shards.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/scripted-metric-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.017309844493865967,
0.035660263150930405,
0.08856367319822311,
0.04510654881596565,
0.009540832601487637,
-0.06014503538608551,
-0.017352290451526642,
-0.016004865989089012,
0.06530015170574188,
0.017872584983706474,
0.01434437558054924,
-0.02934895269572735,
0.04862534627318382,
-0.04392211511731148,
-0.04280263930559158,
0.030980698764324188,
-0.026255952194333076,
-0.03444884344935417,
-0.06471499055624008,
-0.07249753922224045,
-0.01498338021337986,
0.009634067304432392,
0.011108181439340115,
0.0031940205954015255,
0.00939555000513792,
-0.06163811311125755,
-0.07883602380752563,
-0.06497079879045486,
-0.02933092787861824,
-0.017138702794909477,
0.07406897097826004,
-0.020849695429205894,
-0.062342677265405655,
-0.033632200211286545,
0.06764350831508636,
0.17498862743377686,
0.035979680716991425,
-0.007908347062766552,
-0.10820402204990387,
-0.005683145020157099,
0.050115589052438736,
0.013697455637156963,
-0.0978182703256607,
0.01876944862306118,
-0.03318960592150688,
-0.008793340995907784,
-0.05203334987163544,
-0.06940513849258423,
-0.059008799493312836,
-0.06246341019868851,
-0.03181016445159912,
-0.03839811682701111,
-0.0030848432797938585,
-0.011634825728833675,
0.0035973943304270506,
-0.0372462123632431,
-0.07436928153038025,
0.001723670749925077,
-0.022706331685185432,
-0.07242564857006073,
0.020447704941034317,
-0.0835009217262268,
-0.035494327545166016,
-0.048446521162986755,
0.06715290993452072,
0.022481059655547142,
0.1286741942167282,
-0.024538176134228706,
-0.06888782978057861,
0.04760092496871948,
-0.03719676285982132,
0.01460474357008934,
-0.04455128684639931,
0.035565927624702454,
0.03987334296107292,
0.08065716177225113,
-0.05424598231911659,
-0.06108209118247032,
0.0460527203977108,
0.009623550809919834,
-0.12157750129699707,
-0.08720654249191284,
-0.02357051707804203,
-0.0007101306691765785,
0.019182875752449036,
0.0025020872708410025,
-0.03513650596141815,
0.001724241185002029,
0.047494903206825256,
0.017541535198688507,
-0.04032469168305397,
-0.007306355983018875,
0.07870667427778244,
0.0014323497889563441,
0.007214518263936043,
0.06604121625423431,
-0.021933797746896744,
0.04694044962525368,
-0.00976651906967163,
0.048156771808862686,
-0.006891918368637562,
0.0386136956512928,
-0.010370061732828617,
-0.07449600100517273,
0.00621691532433033,
0.06499592214822769,
-0.12204835563898087,
0.021667122840881348,
-0.074969582259655,
-0.0018671363359317183,
0.01581779681146145,
0.014441056177020073,
0.02764354832470417,
0.004221676848828793,
0.01751137524843216,
0.09304799884557724,
0.10835520923137665,
-0.06610714644193649,
-0.05975554883480072,
0.005623092409223318,
0.08332545310258865,
0.04824670031666756,
0.06842795014381409,
0.06151397526264191,
-0.0010793147375807166,
0.011052272282540798,
-0.09900420904159546,
-1.8617644832216474e-33,
0.040767885744571686,
-0.010775784961879253,
0.10315067321062088,
-0.08208823204040527,
0.06155478581786156,
0.04084046185016632,
-0.025481872260570526,
0.11508544534444809,
-0.0018030572682619095,
0.043477799743413925,
-0.09185808151960373,
0.00014640780864283442,
0.026061860844492912,
-0.06610838323831558,
-0.045944660902023315,
-0.018449725583195686,
0.08258271217346191,
0.05917782709002495,
-0.025883205235004425,
-0.03969720005989075,
0.02287767082452774,
0.016740744933485985,
-0.016291482374072075,
0.039681367576122284,
-0.004369403701275587,
-0.005319173913449049,
-0.030415432527661324,
-0.06882375478744507,
-0.03442278504371643,
-0.00818142294883728,
-0.07159893959760666,
-0.013820214197039604,
0.039392367005348206,
0.0088893948122859,
-0.034489527344703674,
-0.008999187499284744,
-0.04030881077051163,
0.0009932996472343802,
-0.06421969085931778,
-0.06915262341499329,
0.05922990292310715,
0.010092456825077534,
0.03737946227192879,
-0.04892289265990257,
-0.04570292681455612,
-0.05096370354294777,
0.002584664383903146,
0.04669720679521561,
-0.04507741332054138,
0.058973219245672226,
0.01951706036925316,
0.019865714013576508,
0.07024554908275604,
0.0751357451081276,
0.032679926604032516,
0.00023841383517719805,
-0.03661756590008736,
-0.03795401006937027,
-0.039024002850055695,
-0.03076317347586155,
0.07713878154754639,
-0.02680801972746849,
-0.01601572521030903,
0.02906891331076622,
0.006192050874233246,
-0.04127225652337074,
0.04158322140574455,
0.0799069032073021,
-0.05130227282643318,
0.06412497162818909,
0.033296868205070496,
0.12025056779384613,
-0.027359165251255035,
0.07782670110464096,
0.06618785113096237,
-0.1278608739376068,
-0.005007895175367594,
-0.03930789604783058,
-0.040907926857471466,
-0.008312520571053028,
0.03174044191837311,
-0.010292936116456985,
-0.019580906257033348,
-0.046484772115945816,
-0.11002574115991592,
0.09622354805469513,
0.08213413506746292,
-0.01931498385965824,
-0.009791912510991096,
-0.05528431758284569,
-0.036604251712560654,
-0.07198544591665268,
-0.07352899014949799,
-0.05184783414006233,
-0.011562569998204708,
-3.2082751245780865e-34,
0.020136430859565735,
-0.011203347705304623,
-0.059621233493089676,
0.050204843282699585,
0.00040283449925482273,
-0.006580881308764219,
0.1301313191652298,
-0.013183783739805222,
0.012548893690109253,
-0.01979638822376728,
0.015576349571347237,
-0.03036760352551937,
0.01032284926623106,
0.010121738538146019,
-0.00025624444242566824,
0.055497776716947556,
0.01268170028924942,
-0.13380765914916992,
0.0643635019659996,
-0.0011203913018107414,
-0.06981173902750015,
0.12824831902980804,
-0.005432871636003256,
0.0514795258641243,
-0.0189470537006855,
-0.05399801954627037,
-0.005514800548553467,
0.001039900234900415,
-0.04168004170060158,
0.06355626881122589,
0.007513774558901787,
0.06748545169830322,
-0.08496221154928207,
-0.04093025624752045,
-0.04229212924838066,
-0.032396115362644196,
0.003052618820220232,
0.043909281492233276,
-0.011283695697784424,
0.07474330067634583,
0.024983607232570648,
-0.005452044308185577,
-0.0845959410071373,
0.09881395101547241,
-0.004572164732962847,
0.008976622484624386,
0.03690527379512787,
0.04380219429731369,
0.06629855185747147,
-0.061436258256435394,
-0.05235165357589722,
-0.04747746139764786,
0.07256390154361725,
0.13330727815628052,
0.002750599291175604,
0.0123573187738657,
0.032320842146873474,
0.007710241712629795,
-0.10914881527423859,
0.006913640536367893,
-0.07597678899765015,
-0.038418494164943695,
-0.03750932216644287,
-0.02486574463546276,
0.027794113382697105,
0.005498985294252634,
-0.033926013857126236,
0.006132803857326508,
0.014887940138578415,
-0.09172891825437546,
-0.0002691329864319414,
-0.030543573200702667,
-0.0026156269013881683,
0.0014294709544628859,
0.04946640506386757,
0.01827811449766159,
-0.03931010141968727,
-0.015298586338758469,
-0.002583177760243416,
0.028796950355172157,
0.013771169818937778,
0.06922934949398041,
0.025866609066724777,
0.024629905819892883,
0.009146171621978283,
-0.09905316680669785,
-0.009531344287097454,
0.059921640902757645,
-0.03742126747965813,
0.08152267336845398,
-0.06707725673913956,
0.0386849045753479,
0.013032474555075169,
0.07892344146966934,
0.019563602283596992,
-2.9302956505716793e-8,
0.041919682174921036,
0.06999609619379044,
-0.030467402189970016,
0.06696091592311859,
-0.01376420445740223,
-0.04027291014790535,
0.011665507219731808,
0.06792235374450684,
-0.04956502839922905,
0.0016832128167152405,
-0.09043277055025101,
-0.02500862628221512,
-0.022456511855125427,
0.005303464829921722,
0.038909703493118286,
-0.005600510630756617,
-0.0021423031575977802,
0.08700446039438248,
-0.04588630050420761,
-0.0835261419415474,
-0.03696392476558685,
0.041610293090343475,
-0.022314852103590965,
-0.0029118643142282963,
-0.0016168830916285515,
0.03541374206542969,
0.08603183180093765,
-0.02747071348130703,
0.004896273836493492,
-0.004397797863930464,
0.023886332288384438,
0.0009035640396177769,
0.0377497598528862,
-0.05493675172328949,
-0.07170101255178452,
0.12728504836559296,
0.02278204634785652,
0.028993822634220123,
0.05201182886958122,
0.021450946107506752,
-0.056877896189689636,
0.019413650035858154,
-0.06322210282087326,
-0.016095837578177452,
-0.03824542835354805,
0.00762459309771657,
-0.03113553486764431,
0.02035083994269371,
0.042323771864175797,
0.03124251775443554,
0.04218488931655884,
0.04137194901704788,
0.022178763523697853,
-0.005694808438420296,
0.010296781547367573,
-0.029699288308620453,
0.075168177485466,
-0.04871978610754013,
0.050379421561956406,
0.004881971050053835,
0.07294736802577972,
-0.11766725033521652,
-0.010926139540970325,
-0.05119834840297699
] | -0.023232
|
[[search-aggregations-metrics-geobounds-aggregation]] === Geo Bounds Aggregation A metric aggregation that computes the bounding box containing all geo\_point values for a field. Example: [source,js] -------------------------------------------------- PUT /museums { "mappings": { "doc": { "properties": { "location": { "type": "geo\_point" } } } } } POST /museums/doc/\_bulk?refresh {"index":{"\_id":1}} {"location": "52.374081,4.912350", "name": "NEMO Science Museum"} {"index":{"\_id":2}} {"location": "52.369219,4.901618", "name": "Museum Het Rembrandthuis"} {"index":{"\_id":3}} {"location": "52.371667,4.914722", "name": "Nederlands Scheepvaartmuseum"} {"index":{"\_id":4}} {"location": "51.222900,4.405200", "name": "Letterenhuis"} {"index":{"\_id":5}} {"location": "48.861111,2.336389", "name": "Musée du Louvre"} {"index":{"\_id":6}} {"location": "48.860000,2.327000", "name": "Musée d'Orsay"} POST /museums/\_search?size=0 { "query" : { "match" : { "name" : "musée" } }, "aggs" : { "viewport" : { "geo\_bounds" : { "field" : "location", <1> "wrap\_longitude" : true <2> } } } } -------------------------------------------------- // CONSOLE <1> The `geo\_bounds` aggregation specifies the field to use to obtain the bounds <2> `wrap\_longitude` is an optional parameter which specifies whether the bounding box should be allowed to overlap the international date line. The default value is `true` The above aggregation demonstrates how one would compute the bounding box of the location field for all documents with a business type of shop The response for the above aggregation: [source,js] -------------------------------------------------- { ... "aggregations": { "viewport": { "bounds": { "top\_left": { "lat": 48.86111099738628, "lon": 2.3269999679178 }, "bottom\_right": { "lat": 48.85999997612089, "lon": 2.3363889567553997 } } } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"\_shards": $body.\_shards,"hits":$body.hits,"timed\_out":false,/]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/geobounds-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.030516846105456352,
0.11236471682786942,
0.062321268022060394,
0.05449443310499191,
-0.03510693833231926,
0.039277780801057816,
-0.028405219316482544,
-0.01712411642074585,
0.04384265094995499,
-0.04522759094834328,
-0.084213986992836,
-0.005568224936723709,
0.025947459042072296,
0.028981398791074753,
-0.06201009079813957,
0.04468320682644844,
-0.02824898436665535,
0.030600883066654205,
-0.03975234553217888,
-0.05563923344016075,
0.0432112030684948,
-0.007293103262782097,
0.017749013379216194,
-0.04985067993402481,
-0.030997779220342636,
0.05305810645222664,
-0.07438933104276657,
-0.03773612529039383,
0.010646055452525616,
0.03142467513680458,
-0.06396738439798355,
-0.04959576576948166,
-0.014229992404580116,
0.05247654393315315,
0.031405992805957794,
0.07464146614074707,
-0.04014138877391815,
-0.05682219937443733,
0.06375398486852646,
0.02217230759561062,
0.047267306596040726,
0.06120867282152176,
0.039006613194942474,
-0.023569364100694656,
0.053969621658325195,
-0.022146238014101982,
-0.012298188172280788,
0.04187338799238205,
0.0026493133045732975,
0.016831034794449806,
0.00035548675805330276,
-0.0049901604652404785,
-0.0402180440723896,
-0.021391281858086586,
-0.013863541185855865,
0.049323927611112595,
-0.05921575427055359,
-0.0318576842546463,
-0.013096039183437824,
-0.08835030347108841,
0.04500897228717804,
-0.06186775118112564,
0.04023769497871399,
-0.04781513288617134,
-0.012909779325127602,
-0.06890849769115448,
-0.02972101978957653,
0.05623820051550865,
-0.050813186913728714,
0.011148463003337383,
0.12615130841732025,
0.012106928043067455,
0.008279460482299328,
-0.04659562557935715,
0.09006325900554657,
0.012106315232813358,
-0.12097019702196121,
-0.03248310461640358,
-0.015379843302071095,
-0.02379046380519867,
-0.023922046646475792,
-0.08370330184698105,
-0.0016128694405779243,
-0.008761182427406311,
-0.017262523993849754,
-0.054088424891233444,
-0.011220920830965042,
-0.08322491496801376,
0.060249052941799164,
-0.03740425407886505,
-0.053329214453697205,
-0.07094809412956238,
-0.05422118306159973,
0.016380326822400093,
-0.009601644240319729,
0.019033974036574364,
-0.04070219025015831,
0.05333365872502327,
0.04338662698864937,
0.03477445989847183,
0.054083146154880524,
0.042261917144060135,
0.0003505247295834124,
-0.04639212414622307,
0.009507549926638603,
0.027725957334041595,
-0.025458721444010735,
0.08349934965372086,
-0.046878982335329056,
0.09222777187824249,
-0.00890452228486538,
0.06689409911632538,
0.015643315389752388,
0.055375970900058746,
-0.04911000281572342,
0.08442360162734985,
0.06922757625579834,
-0.03032675012946129,
0.012353209778666496,
-0.038876019418239594,
0.06951502710580826,
-0.05087128281593323,
-0.018407193943858147,
-0.015258361585438251,
-0.014805513434112072,
0.043369587510824203,
0.049824412912130356,
-4.842611067863132e-34,
0.04289213940501213,
-0.04502829164266586,
0.051201723515987396,
0.007799939252436161,
-0.006093003321439028,
0.023982057347893715,
-0.048532988876104355,
0.06286259740591049,
-0.06316456943750381,
0.05133676901459694,
-0.03940993919968605,
0.083979032933712,
-0.02013896033167839,
-0.10198038071393967,
0.01881926693022251,
-0.02606433629989624,
-0.019292442128062248,
0.035224154591560364,
0.02137506939470768,
-0.03758193552494049,
0.025282608345150948,
-0.05810742452740669,
-0.034913163632154465,
0.07094314694404602,
0.0031693477649241686,
-0.02589479833841324,
-0.07626836746931076,
0.002777793677523732,
-0.12091093510389328,
-0.012286019511520863,
-0.02590963803231716,
0.00789352785795927,
-0.018275989219546318,
-0.07299557328224182,
0.014807070605456829,
-0.02605619840323925,
-0.008414465002715588,
0.01870521903038025,
-0.04869574308395386,
-0.06618732959032059,
0.04698387160897255,
-0.008757935836911201,
-0.042606815695762634,
-0.09329197555780411,
-0.0784941017627716,
0.03242911398410797,
0.01250242069363594,
0.01016567088663578,
0.012500203214585781,
0.029025238007307053,
0.0038484346587210894,
0.038172077387571335,
-0.07112718373537064,
-0.021542811766266823,
0.04281511530280113,
-0.03172462433576584,
-0.03700514882802963,
0.08193796873092651,
0.05259717255830765,
0.03729093819856644,
0.0322551466524601,
0.021812178194522858,
0.041561026126146317,
0.09435737878084183,
0.11818043887615204,
0.026704687625169754,
0.0505346953868866,
0.12434118241071701,
0.06270550191402435,
0.08420123904943466,
0.06474965065717697,
0.01793927513062954,
0.029520807787775993,
0.028953785076737404,
0.007326548919081688,
-0.08427754789590836,
0.04181358218193054,
-0.006759168114513159,
0.027949150651693344,
0.02762964740395546,
-0.01598961278796196,
-0.08187077939510345,
-0.021489206701517105,
-0.017831305041909218,
-0.029055701568722725,
0.045777834951877594,
0.007921092212200165,
0.034301336854696274,
-0.051194071769714355,
-0.10181654989719391,
-0.03608093410730362,
0.04114065691828728,
-0.08663341403007507,
-0.12767267227172852,
-0.05839022248983383,
-5.924926369218637e-34,
0.09946899116039276,
-0.1154421716928482,
0.07385455816984177,
0.009931628592312336,
0.033319275826215744,
-0.0950714573264122,
0.027933333069086075,
0.017273113131523132,
0.021465567871928215,
0.03540640324354172,
-0.07239627093076706,
-0.03903694450855255,
0.047190677374601364,
0.013303862884640694,
-0.012567667290568352,
0.08342017978429794,
-0.06140860170125961,
-0.09365712851285934,
-0.06821838021278381,
0.05401349067687988,
-0.018031705170869827,
0.02275676466524601,
-0.011462363414466381,
0.14344236254692078,
-0.0943286269903183,
-0.053380150347948074,
-0.055750247091054916,
-0.033222369849681854,
-0.1231207624077797,
0.012416868470609188,
0.04672884941101074,
-0.044656649231910706,
-0.012577462941408157,
0.0659753605723381,
-0.04374392330646515,
-0.024863911792635918,
0.10486245155334473,
0.05033579841256142,
-0.027187632396817207,
0.08140169829130173,
0.004671967588365078,
0.00413598632439971,
-0.057232651859521866,
0.05233551561832428,
0.06931998580694199,
0.015395911410450935,
-0.0018104760674759746,
0.0797462984919548,
-0.027496399357914925,
-0.03133688494563103,
-0.040666766464710236,
0.0011857280042022467,
-0.043995507061481476,
0.029968351125717163,
-0.00034386798506602645,
-0.032065361738204956,
-0.08006609976291656,
-0.049916259944438934,
-0.011842961423099041,
-0.00011526636080816388,
-0.003728042123839259,
-0.022252129390835762,
-0.07004213333129883,
0.04525933787226677,
0.04148057848215103,
-0.05607778951525688,
-0.016901521012187004,
-0.011377080343663692,
-0.06069381162524223,
0.00746507104486227,
0.008378672413527966,
0.01592819206416607,
0.0729936733841896,
0.0037219782825559378,
-0.019053831696510315,
0.03114171326160431,
0.1104811355471611,
0.023734530434012413,
0.08834395557641983,
-0.028301237151026726,
-0.03306050971150398,
0.039187654852867126,
0.07095294445753098,
0.07188712805509567,
-0.03197598457336426,
0.08221206068992615,
-0.003831632900983095,
0.055737316608428955,
-0.07245773077011108,
0.015192979946732521,
-0.0764111876487732,
-0.04429817199707031,
0.01027217973023653,
-0.05785200372338295,
-0.027190154418349266,
-5.0419885155861266e-8,
-0.11467510461807251,
0.08152516186237335,
-0.02805745229125023,
0.06382542103528976,
-0.040005121380090714,
0.00044621009146794677,
0.07332686334848404,
0.14696313440799713,
-0.00602760910987854,
-0.022952675819396973,
0.011866644024848938,
0.010556635446846485,
-0.0755794569849968,
0.02995278313755989,
-0.044557567685842514,
-0.0796191543340683,
-0.04669218137860298,
0.03371097519993782,
-0.03253372013568878,
0.021593868732452393,
0.04481351003050804,
0.009734489023685455,
0.07948923110961914,
-0.03498063236474991,
0.07933171093463898,
-0.05973820760846138,
-0.008606566116213799,
-0.02914506383240223,
0.06803536415100098,
-0.020954016596078873,
-0.019814295694231987,
-0.026896093040704727,
0.03241315111517906,
0.06190168112516403,
0.06034601479768753,
-0.11035901308059692,
0.012378537096083164,
0.036584995687007904,
-0.07350495457649231,
0.04870618134737015,
0.01491011492908001,
0.0027602119371294975,
-0.014733277261257172,
0.0217243954539299,
0.03511284664273262,
0.04147286340594292,
0.0069258748553693295,
0.05218048393726349,
0.10213706642389297,
-0.015569943934679031,
-0.014259355142712593,
-0.053575385361909866,
-0.004108086694031954,
-0.021890344098210335,
-0.0065804035402834415,
-0.04679714888334274,
0.010643375106155872,
0.04822397977113724,
0.020097659900784492,
0.030784867703914642,
0.02833116240799427,
-0.039085038006305695,
-0.0572756826877594,
-0.033269092440605164
] | 0.04546
|
[[search-aggregations-metrics-percentile-rank-aggregation]] === Percentile Ranks Aggregation A `multi-value` metrics aggregation that calculates one or more percentile ranks over numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. [NOTE] ================================================== Please see <> and <> for advice regarding approximation and memory use of the percentile ranks aggregation ================================================== Percentile rank show the percentage of observed values which are below certain value. For example, if a value is greater than or equal to 95% of the observed values it is said to be at the 95th percentile rank. Assume your data consists of website load times. You may have a service agreement that 95% of page loads completely within 500ms and 99% of page loads complete within 600ms. Let's look at a range of percentiles representing load time: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "load\_time\_ranks" : { "percentile\_ranks" : { "field" : "load\_time", <1> "values" : [500, 600] } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] <1> The field `load\_time` must be a numeric field The response will look like this: [source,js] -------------------------------------------------- { ... "aggregations": { "load\_time\_ranks": { "values" : { "500.0": 55.00000000000001, "600.0": 64.0 } } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] From this information you can determine you are hitting the 99% load time target but not quite hitting the 95% load time target ==== Keyed Response By default the `keyed` flag is set to `true` associates a unique string key with each bucket and returns the ranges as a hash rather than an array. Setting the `keyed` flag to `false` will disable this behavior: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs": { "load\_time\_ranks": { "percentile\_ranks": { "field": "load\_time", "values": [500, 600], "keyed": false } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] Response: [source,js] -------------------------------------------------- { ... "aggregations": { "load\_time\_ranks": { "values": [ { "key": 500.0, "value": 55.00000000000001 }, { "key": 600.0, "value": 64.0 } ] } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] ==== Script The percentile rank metric supports scripting. For example, if our load times are in milliseconds but we want to specify values in seconds, we could use a script to convert them on-the-fly: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "load\_time\_ranks" : { "percentile\_ranks" : { "values" : [500, 600], "script" : { "lang": "painless", "source": "doc['load\_time'].value / params.timeUnit", <1> "params" : { "timeUnit" : 1000 <2> } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] <1> The `field` parameter is replaced with a `script` parameter, which uses the script to generate values which percentile ranks are calculated on <2> Scripting supports parameterized input just like any other script This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a stored script use the following syntax: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "load\_time\_ranks" : { "percentile\_ranks" : { "values" : [500, 600], "script" : { "id": "my\_script", "params": { "field": "load\_time" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency,stored\_example\_script] ==== HDR Histogram NOTE: This setting exposes the internal implementation of HDR Histogram and the syntax may change in the future. https://github.com/HdrHistogram/HdrHistogram[HDR Histogram] (High Dynamic Range Histogram) is an alternative implementation that can be useful when calculating percentile ranks for latency measurements as it can be faster than the t-digest implementation with the trade-off of a larger memory footprint. This implementation maintains a fixed worse-case percentage error (specified as a number of significant
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/percentile-rank-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.004170637112110853,
0.039614878594875336,
-0.051963407546281815,
0.040704045444726944,
-0.04069260135293007,
-0.028390206396579742,
0.02697979472577572,
0.06275220960378647,
-0.007277269847691059,
0.008340775966644287,
-0.02893638052046299,
-0.010815780609846115,
0.10637287050485611,
-0.021796882152557373,
-0.015328149311244488,
-0.023759277537465096,
0.03449949249625206,
0.06214440241456032,
-0.0840076133608818,
-0.09472303837537766,
-0.006129485089331865,
0.01703615114092827,
0.026393506675958633,
-0.04634716734290123,
0.03141539916396141,
0.022971585392951965,
-0.05611088126897812,
0.028498992323875427,
0.03266746550798416,
0.021859530359506607,
-0.04295708239078522,
0.02549736388027668,
0.007395989261567593,
0.080197773873806,
-0.08725851029157639,
-0.011626374907791615,
-0.06357066333293915,
-0.04423381760716438,
0.04257422685623169,
-0.00841714907437563,
-0.024862000718712807,
-0.015686962753534317,
-0.006532413884997368,
-0.05127338692545891,
0.01208634302020073,
-0.006561838556081057,
-0.09818050265312195,
-0.04058285802602768,
-0.045110974460840225,
0.04183850437402725,
-0.12101534754037857,
0.09056879580020905,
0.017853962257504463,
0.02521534264087677,
-0.0049004568718373775,
0.002521298360079527,
0.04292594641447067,
-0.18271267414093018,
0.00030172266997396946,
-0.04800451174378395,
-0.04880392923951149,
-0.06377993524074554,
0.07049745321273804,
-0.050356682389974594,
0.018557842820882797,
0.02072434313595295,
0.03211769834160805,
0.02065676636993885,
-0.028119351714849472,
-0.025250833481550217,
-0.004965305794030428,
-0.006919406354427338,
0.0003154448640998453,
-0.055385928601026535,
-0.033937010914087296,
0.06686605513095856,
-0.0007489013369195163,
0.010947520844638348,
0.009280051104724407,
-0.08837651461362839,
0.007493244018405676,
0.0047808438539505005,
-0.038654226809740067,
0.023803720250725746,
0.009055079892277718,
-0.06794003397226334,
0.09271061420440674,
0.02001556009054184,
0.02167951501905918,
-0.0005030882894061506,
-0.000032963122066576034,
0.09154903888702393,
-0.0713358074426651,
0.010439200326800346,
0.07279995083808899,
0.07250215858221054,
-0.02957148291170597,
-0.08012466877698898,
0.08140669763088226,
-0.013354954309761524,
0.015156624838709831,
0.026627399027347565,
-0.03867705538868904,
-0.09884010255336761,
-0.052870091050863266,
-0.08761884272098541,
0.0364532545208931,
0.08639980852603912,
-0.04167881980538368,
-0.06283621490001678,
-0.03786064311861992,
-0.039792340248823166,
-0.0261418167501688,
0.014773104339838028,
0.018531862646341324,
-0.03114464320242405,
0.08191103488206863,
0.02973984181880951,
0.04938841983675957,
-0.022572843357920647,
0.008235041052103043,
0.030065538361668587,
0.03555803745985031,
0.00023126584710553288,
0.04706341773271561,
0.026015963405370712,
-0.004694217350333929,
6.177456443073347e-33,
-0.04998694360256195,
-0.061577241867780685,
-0.008451681584119797,
-0.03205154836177826,
-0.04224364832043648,
0.00689022708684206,
0.0015094467671588063,
0.0050407350063323975,
-0.02218385972082615,
-0.043391235172748566,
-0.0772930458188057,
0.0646558552980423,
-0.0891919881105423,
-0.03500894457101822,
0.004782598931342363,
0.003911439795047045,
-0.00577995739877224,
0.01011362299323082,
-0.04632280021905899,
-0.08704767376184464,
0.01701926440000534,
-0.03424741327762604,
0.06573064625263214,
0.014793822541832924,
0.0477561429142952,
-0.05003692954778671,
-0.0543024018406868,
-0.04798288270831108,
-0.08928728103637695,
0.0018821465782821178,
0.0402381531894207,
-0.008930420503020287,
-0.0040557244792580605,
-0.09726446121931076,
0.06888629496097565,
-0.0091565465554595,
0.03948216512799263,
0.08776207268238068,
0.02002924308180809,
0.0007329556392505765,
-0.10771571844816208,
-0.013290961273014545,
0.01665099337697029,
-0.06910929083824158,
-0.09059330075979233,
0.005563538987189531,
-0.03688438981771469,
0.056943025439977646,
0.03731616213917732,
-0.004254665691405535,
-0.0716293454170227,
-0.022745875641703606,
0.029916536062955856,
-0.000798853812739253,
-0.024327855557203293,
0.03800836578011513,
0.02117183431982994,
0.05235268175601959,
0.006909473799169064,
-0.01629624329507351,
-0.04328187555074692,
0.001513672643341124,
-0.02238062396645546,
-0.0789521262049675,
0.031881291419267654,
-0.022964483126997948,
0.046798914670944214,
0.09313138574361801,
0.03459085151553154,
0.08601182699203491,
0.03405912593007088,
-0.001978787127882242,
0.04794914275407791,
-0.006672350689768791,
0.028237303718924522,
0.020294904708862305,
0.10725640505552292,
0.0675969049334526,
-0.04151557385921478,
-0.0653466060757637,
0.022984610870480537,
0.0014754667645320296,
0.019746357575058937,
-0.09635227918624878,
0.030819185078144073,
-0.01826740987598896,
0.04935455694794655,
0.018790747970342636,
-0.06742603331804276,
-0.08019858598709106,
-0.012740988284349442,
0.0014526029117405415,
-0.05954420194029808,
-0.05657589063048363,
-0.0903024822473526,
-8.931492035572144e-33,
-0.03800380229949951,
0.09269675612449646,
0.11282346397638321,
0.04542196914553642,
0.04805739223957062,
-0.04068170115351677,
-0.021725336089730263,
-0.04463758319616318,
-0.05760456621646881,
-0.009218847379088402,
-0.03534418344497681,
-0.047885872423648834,
0.01264612004160881,
-0.050676215440034866,
-0.03531220555305481,
0.07416519522666931,
-0.05347312241792679,
-0.05633186548948288,
0.0014883469557389617,
0.04640071466565132,
-0.027930762618780136,
0.018153348937630653,
0.010925836861133575,
0.1278126835823059,
-0.007854166440665722,
-0.011202018707990646,
-0.008150460198521614,
-0.02057744190096855,
-0.06711450964212418,
-0.10496808588504791,
0.041387058794498444,
-0.03623665124177933,
0.004807910416275263,
-0.007357664406299591,
-0.03834744542837143,
-0.09924301505088806,
0.05063644051551819,
-0.10427485406398773,
-0.041056472808122635,
0.019250934943556786,
0.029780089855194092,
-0.008580159395933151,
-0.08071218430995941,
-0.057375602424144745,
0.049586500972509384,
0.060503169894218445,
0.013674440793693066,
0.053046319633722305,
-0.02327832765877247,
-0.025193756446242332,
0.06511679291725159,
0.12537838518619537,
0.0035168349277228117,
0.09498701244592667,
0.009443164803087711,
-0.0006198214250616729,
-0.07211045920848846,
-0.05770515277981758,
-0.041984450072050095,
-0.04498787596821785,
0.0429442822933197,
-0.05886678397655487,
-0.011440426111221313,
0.010950409807264805,
-0.005516363773494959,
-0.01083835307508707,
0.01522859837859869,
-0.006231424864381552,
-0.12183818966150284,
0.06490793824195862,
0.02769654057919979,
0.008985169231891632,
0.11130747199058533,
-0.08677548170089722,
-0.005909594241529703,
0.043918222188949585,
-0.0026957711670547724,
0.01945379190146923,
0.015972532331943512,
0.049709804356098175,
0.02373756468296051,
0.09026847034692764,
0.010774151422083378,
0.024811863899230957,
-0.10465072095394135,
0.03250223025679588,
0.03252117335796356,
0.04405122250318527,
0.00014614051906391978,
-0.07762238383293152,
-0.08822114020586014,
-0.042604681104421616,
-0.07084085792303085,
-0.04465514048933983,
0.03741610795259476,
-5.8017516124664326e-8,
-0.06505636870861053,
-0.03865772485733032,
-0.032808538526296616,
0.008528039790689945,
0.05502047389745712,
0.09553713351488113,
-0.056355997920036316,
0.0503210723400116,
-0.032489530742168427,
-0.04662199318408966,
0.09718193858861923,
-0.08837350457906723,
-0.1262200027704239,
-0.018674541264772415,
-0.034391626715660095,
0.009671510197222233,
-0.009135480038821697,
0.048916228115558624,
0.05006766319274902,
-0.03298184648156166,
0.03286784142255783,
0.053415652364492416,
0.08514237403869629,
-0.0015034895623102784,
0.024339349940419197,
0.03747331351041794,
-0.06509552150964737,
-0.08537434786558151,
0.04809582605957985,
-0.031865011900663376,
0.02727467007935047,
-0.10561352968215942,
0.02936009131371975,
-0.021480096504092216,
0.07051124423742294,
0.025054536759853363,
-0.026116464287042618,
0.013450661674141884,
-0.047319862991571426,
0.004662755411118269,
0.04064558446407318,
0.04623826593160629,
-0.014047476463019848,
0.04122217372059822,
0.04720095545053482,
0.005372942890971899,
-0.03083418682217598,
0.08077174425125122,
0.05850395932793617,
-0.014814148657023907,
0.01816081628203392,
-0.10603535175323486,
-0.02929580770432949,
0.03540867194533348,
-0.07373574376106262,
-0.0632295235991478,
0.02842876687645912,
0.039190687239170074,
-0.03013901226222515,
-0.010609433986246586,
0.07902790606021881,
-0.004970886744558811,
-0.044518351554870605,
0.075983926653862
] | -0.024726
|
(High Dynamic Range Histogram) is an alternative implementation that can be useful when calculating percentile ranks for latency measurements as it can be faster than the t-digest implementation with the trade-off of a larger memory footprint. This implementation maintains a fixed worse-case percentage error (specified as a number of significant digits). This means that if data is recorded with values from 1 microsecond up to 1 hour (3,600,000,000 microseconds) in a histogram set to 3 significant digits, it will maintain a value resolution of 1 microsecond for values up to 1 millisecond and 3.6 seconds (or better) for the maximum tracked value (1 hour). The HDR Histogram can be used by specifying the `method` parameter in the request: [source,js] -------------------------------------------------- GET latency/\_search { "size": 0, "aggs" : { "load\_time\_ranks" : { "percentile\_ranks" : { "field" : "load\_time", "values" : [500, 600], "hdr": { <1> "number\_of\_significant\_value\_digits" : 3 <2> } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] <1> `hdr` object indicates that HDR Histogram should be used to calculate the percentiles and specific settings for this algorithm can be specified inside the object <2> `number\_of\_significant\_value\_digits` specifies the resolution of values for the histogram in number of significant digits The HDRHistogram only supports positive values and will error if it is passed a negative value. It is also not a good idea to use the HDRHistogram if the range of values is unknown as this could lead to high memory usage. ==== Missing value The `missing` parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value. [source,js] -------------------------------------------------- GET latency/data/\_search { "size": 0, "aggs" : { "load\_time\_ranks" : { "percentile\_ranks" : { "field" : "load\_time", "values" : [500, 600], "missing": 10 <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:latency] <1> Documents without a value in the `load\_time` field will fall into the same bucket as documents that have the value `10`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/percentile-rank-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.00019057771714869887,
0.020745515823364258,
-0.04344222694635391,
-0.0030140504240989685,
-0.05070389062166214,
-0.048580098897218704,
-0.02520783245563507,
0.06802008301019669,
-0.00003601887874538079,
-0.03266538307070732,
-0.07146335393190384,
-0.02651108428835869,
-0.00020208035130053759,
-0.010054397396743298,
-0.02077644318342209,
-0.09370838850736618,
0.08230607211589813,
-0.036677949130535126,
-0.04908416420221329,
-0.1353454291820526,
-0.0011547565227374434,
0.014178256504237652,
0.04724719002842903,
-0.04867235943675041,
0.06510857492685318,
-0.052298206835985184,
-0.051893118768930435,
-0.009479093365371227,
0.014504455029964447,
0.0073435646481812,
0.03495566174387932,
0.004561377689242363,
0.053505800664424896,
0.03063352219760418,
-0.09887848794460297,
-0.010803923942148685,
0.006067120470106602,
0.009670430794358253,
0.014270791783928871,
-0.01800978183746338,
0.08322571963071823,
0.03928060829639435,
-0.05756516382098198,
0.014552737586200237,
-0.030910775065422058,
0.013044120743870735,
-0.07490426301956177,
-0.01667739637196064,
-0.04157492145895958,
0.06697089225053787,
-0.059174079447984695,
0.06013486161828041,
0.03744438663125038,
0.021961361169815063,
0.009991385973989964,
0.047412801533937454,
-0.020954061299562454,
-0.037711404263973236,
0.07259409129619598,
0.034059155732393265,
-0.05552951991558075,
-0.04560212790966034,
0.03377818688750267,
-0.07338681817054749,
0.1064508706331253,
-0.029979277402162552,
0.0379367433488369,
-0.00971839390695095,
0.026016870513558388,
0.031344976276159286,
-0.0014377996558323503,
0.07511192560195923,
0.0036920548882335424,
0.014371351338922977,
-0.04793988913297653,
-0.030910449102520943,
-0.0449439138174057,
0.014073631726205349,
0.033779218792915344,
-0.09128592163324356,
0.018145591020584106,
-0.049570005387067795,
-0.011632840149104595,
0.036981284618377686,
0.013178166933357716,
0.018536679446697235,
0.03309931606054306,
0.059870921075344086,
-0.03146642819046974,
-0.038144372403621674,
0.009724033996462822,
-0.010567826218903065,
-0.08978646993637085,
0.01101646851748228,
-0.01069623976945877,
0.03939342871308327,
0.030590858310461044,
-0.001427087583579123,
0.052316561341285706,
-0.023836862295866013,
0.06759031116962433,
-0.03319728747010231,
-0.031221026554703712,
0.006889615673571825,
0.014063525944948196,
-0.04064320772886276,
0.035476624965667725,
0.12263712286949158,
-0.020560959354043007,
0.0754484087228775,
0.05900837481021881,
0.03957711532711983,
0.01338527537882328,
-0.07681090384721756,
-0.0006742969271726906,
0.03249034285545349,
-0.05249625816941261,
-0.021520396694540977,
0.04287266358733177,
-0.0014587187906727195,
0.05294223502278328,
-0.03000747226178646,
-0.01603502780199051,
-0.037518613040447235,
0.10702668130397797,
-0.04339049756526947,
0.02244660258293152,
4.764701781849027e-33,
-0.01661381497979164,
0.0016015771543607116,
-0.0027655446901917458,
-0.08080999553203583,
-0.05079003795981407,
-0.006573487538844347,
-0.05305391550064087,
0.04534199833869934,
0.016293762251734734,
-0.006369553506374359,
-0.08799360692501068,
0.057114556431770325,
-0.01716461591422558,
-0.034016553312540054,
-0.04066666588187218,
-0.0291072279214859,
0.019922953099012375,
0.032907482236623764,
-0.04834018647670746,
-0.023188672959804535,
-0.02722690813243389,
-0.053119461983442307,
0.011947662569582462,
0.007576680742204189,
0.03547973930835724,
0.005314186681061983,
0.03483152016997337,
0.0015298492508009076,
-0.03212614357471466,
0.0254606194794178,
-0.0002869694144465029,
0.03372321277856827,
-0.05298604443669319,
-0.03403002396225929,
0.10635010153055191,
-0.03084607981145382,
-0.03166778013110161,
0.05935253947973251,
-0.05597781017422676,
0.01763094589114189,
0.029226087033748627,
0.03196593001484871,
-0.06107063218951225,
-0.07523380219936371,
-0.09984764456748962,
-0.0330679751932621,
0.008273792453110218,
0.014734000898897648,
-0.03971439599990845,
0.05988574028015137,
-0.001711430144496262,
0.013862371444702148,
0.010261628776788712,
-0.1189698651432991,
0.09026990830898285,
0.022748539224267006,
0.12317119538784027,
0.0186795461922884,
0.046887606382369995,
0.13720406591892242,
0.03637596592307091,
0.00470008933916688,
0.017409153282642365,
0.014026980847120285,
0.0029039597138762474,
-0.013552668504416943,
0.028742704540491104,
0.04724052548408508,
-0.04330101236701012,
0.03490400314331055,
0.10872764140367508,
0.06505295634269714,
0.08724673092365265,
-0.03462548926472664,
-0.0031430607195943594,
-0.020278669893741608,
-0.011087805032730103,
0.07951581478118896,
-0.08518294245004654,
-0.07229163497686386,
0.03762909024953842,
-0.11204372346401215,
-0.01319422759115696,
-0.0011525541776791215,
0.01221487857401371,
0.0513729527592659,
0.01328642014414072,
-0.0037132056895643473,
-0.14896026253700256,
0.016860609874129295,
0.00022530200658366084,
-0.01793806441128254,
-0.04656115919351578,
-0.08644113689661026,
-0.0941699966788292,
-4.044340109223913e-33,
-0.011381671763956547,
0.042250555008649826,
0.03041936084628105,
0.15876929461956024,
0.02666591852903366,
-0.041491422802209854,
0.05369788408279419,
0.1350230574607849,
0.02909376472234726,
0.01882541924715042,
0.022613147273659706,
-0.06701863557100296,
-0.023582570254802704,
-0.09304887801408768,
0.01771855354309082,
0.05327220633625984,
-0.021694770082831383,
-0.11036376655101776,
-0.056860726326704025,
0.021130165085196495,
0.020313981920480728,
-0.02415698766708374,
-0.03126482665538788,
0.04988889768719673,
-0.049965646117925644,
0.0032850815914571285,
-0.03596467152237892,
0.015229997225105762,
-0.04878608509898186,
-0.0981794074177742,
-0.0554070770740509,
-0.102686807513237,
-0.012456809170544147,
-0.08009466528892517,
0.004634649958461523,
-0.03482426702976227,
0.08049547672271729,
0.018638838082551956,
-0.006416684482246637,
0.035664625465869904,
0.027130046859383583,
0.03355928137898445,
-0.030773531645536423,
-0.07311087101697922,
-0.009042860008776188,
0.10861792415380478,
-0.06016601249575615,
0.11325541883707047,
0.03295443207025528,
0.004776413552463055,
0.06364824622869492,
0.040644071996212006,
0.021062280982732773,
0.099044568836689,
0.05675115808844566,
0.026810234412550926,
-0.01886114478111267,
-0.02637466974556446,
-0.0032965324353426695,
0.05626388266682625,
-0.010207037441432476,
-0.09872997552156448,
0.0426541306078434,
0.005933679174631834,
0.021494941785931587,
0.01700364425778389,
0.006556050386279821,
-0.10105979442596436,
-0.018411697819828987,
0.08784966915845871,
0.03441110625863075,
-0.0758911520242691,
0.08857882022857666,
-0.020418217405676842,
-0.04363580793142319,
-0.007431747391819954,
0.008100350387394428,
-0.03153378888964653,
-0.005620328709483147,
0.024889765307307243,
-0.03548591583967209,
0.023543691262602806,
0.008278017863631248,
0.06158227473497391,
-0.005073424428701401,
0.039349451661109924,
-0.013298536650836468,
-0.05752977356314659,
0.01743783988058567,
0.015311784110963345,
0.002787624252960086,
0.07148515433073044,
-0.11380360275506973,
0.008506749756634235,
0.021514274179935455,
-5.885507903258258e-8,
-0.041696272790431976,
-0.032089412212371826,
-0.05621012672781944,
-0.0103309853002429,
0.041170936077833176,
0.007892373017966747,
0.0123852314427495,
0.05464644357562065,
0.06726595014333725,
-0.003380708396434784,
0.14965249598026276,
-0.0934535413980484,
-0.040323659777641296,
-0.02470417320728302,
0.026937048882246017,
-0.09496670216321945,
0.06191113591194153,
-0.044283702969551086,
-0.01869122125208378,
-0.01685250923037529,
0.010272552259266376,
0.0400274395942688,
0.07813171297311783,
-0.06846782565116882,
0.03785904869437218,
0.045987751334905624,
0.00831938348710537,
0.04321849346160889,
0.04219001904129982,
-0.14311297237873077,
-0.04460804909467697,
0.033554039895534515,
0.015466979704797268,
-0.0023857310879975557,
-0.00043622739030979574,
0.007235823664814234,
-0.1021094024181366,
0.0661919116973877,
0.023402778431773186,
0.062351323664188385,
0.032915130257606506,
-0.013732344843447208,
-0.08182735741138458,
0.04128975793719292,
0.010899972170591354,
0.011736856773495674,
-0.01891181990504265,
0.02950115129351616,
-0.0013363774633035064,
-0.022539205849170685,
0.004579131957143545,
-0.040112484246492386,
-0.01576784998178482,
-0.06521177291870117,
0.05306462198495865,
-0.03620167449116707,
0.05954672023653984,
-0.08288121968507767,
-0.013667577877640724,
0.0575515553355217,
0.06757988780736923,
-0.014516150578856468,
-0.11635340750217438,
0.015671739354729652
] | 0.095068
|
[[search-aggregations-metrics-top-hits-aggregation]] === Top Hits Aggregation A `top\_hits` metric aggregator keeps track of the most relevant document being aggregated. This aggregator is intended to be used as a sub aggregator, so that the top matching documents can be aggregated per bucket. The `top\_hits` aggregator can effectively be used to group result sets by certain fields via a bucket aggregator. One or more bucket aggregators determines by which properties a result set get sliced into. ==== Options \* `from` - The offset from the first result you want to fetch. \* `size` - The maximum number of top matching hits to return per bucket. By default the top three matching hits are returned. \* `sort` - How the top matching hits should be sorted. By default the hits are sorted by the score of the main query. ==== Supported per hit features The top\_hits aggregation returns regular search hits, because of this many per hit features can be supported: \* <> \* <> \* <> \* <> \* <> \* <> \* <> \* <> ==== Example In the following example we group the questions by tag and per tag we show the last active question. For each question only the title field is being included in the source. [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs": { "top\_tags": { "terms": { "field": "type", "size": 3 }, "aggs": { "top\_sales\_hits": { "top\_hits": { "sort": [ { "date": { "order": "desc" } } ], "\_source": { "includes": [ "date", "price" ] }, "size" : 1 } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] Possible response: [source,js] -------------------------------------------------- { ... "aggregations": { "top\_tags": { "doc\_count\_error\_upper\_bound": 0, "sum\_other\_doc\_count": 0, "buckets": [ { "key": "hat", "doc\_count": 3, "top\_sales\_hits": { "hits": { "total": 3, "max\_score": null, "hits": [ { "\_index": "sales", "\_type": "\_doc", "\_id": "AVnNBmauCQpcRyxw6ChK", "\_source": { "date": "2015/03/01 00:00:00", "price": 200 }, "sort": [ 1425168000000 ], "\_score": null } ] } } }, { "key": "t-shirt", "doc\_count": 3, "top\_sales\_hits": { "hits": { "total": 3, "max\_score": null, "hits": [ { "\_index": "sales", "\_type": "\_doc", "\_id": "AVnNBmauCQpcRyxw6ChL", "\_source": { "date": "2015/03/01 00:00:00", "price": 175 }, "sort": [ 1425168000000 ], "\_score": null } ] } } }, { "key": "bag", "doc\_count": 1, "top\_sales\_hits": { "hits": { "total": 1, "max\_score": null, "hits": [ { "\_index": "sales", "\_type": "\_doc", "\_id": "AVnNBmatCQpcRyxw6ChH", "\_source": { "date": "2015/01/01 00:00:00", "price": 150 }, "sort": [ 1420070400000 ], "\_score": null } ] } } } ] } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] // TESTRESPONSE[s/AVnNBmauCQpcRyxw6ChK/$body.aggregations.top\_tags.buckets.0.top\_sales\_hits.hits.hits.0.\_id/] // TESTRESPONSE[s/AVnNBmauCQpcRyxw6ChL/$body.aggregations.top\_tags.buckets.1.top\_sales\_hits.hits.hits.0.\_id/] // TESTRESPONSE[s/AVnNBmatCQpcRyxw6ChH/$body.aggregations.top\_tags.buckets.2.top\_sales\_hits.hits.hits.0.\_id/] ==== Field collapse example Field collapsing or result grouping is a feature that logically groups a result set into groups and per group returns top documents. The ordering of the groups is determined by the relevancy of the first document in a group. In Elasticsearch this can be implemented via a bucket aggregator that wraps a `top\_hits` aggregator as sub-aggregator. In the example below we search across crawled webpages. For each webpage we store the body and the domain the webpage belong to. By defining a `terms` aggregator on the `domain` field we group the result set of webpages by domain. The `top\_hits` aggregator is then defined as sub-aggregator, so that the top matching hits are collected per bucket. Also a `max` aggregator is defined which is used by the `terms` aggregator's order feature the return the buckets by relevancy order of the most relevant document in a bucket. [source,js] -------------------------------------------------- POST /sales/\_search { "query": { "match": { "body": "elections" } }, "aggs": { "top\_sites": { "terms": { "field": "domain", "order": { "top\_hit": "desc" } }, "aggs": { "top\_tags\_hits": { "top\_hits": {} },
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/tophits-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.029318882152438164,
0.003708167467266321,
-0.007710649631917477,
0.047859299927949905,
-0.03909968212246895,
0.024878038093447685,
0.007044827565550804,
0.07721059769392014,
0.0051187146455049515,
0.021346891298890114,
-0.04014439135789871,
-0.005928708706051111,
0.07491861283779144,
-0.04869454354047775,
-0.021222375333309174,
0.03836316242814064,
0.020206470042467117,
-0.005242419894784689,
-0.06769507378339767,
-0.13054487109184265,
-0.007985642179846764,
0.028147848322987556,
0.005398309323936701,
-0.06989200413227081,
-0.0039026434533298016,
0.0469028614461422,
-0.11400705575942993,
0.01650647073984146,
0.025530751794576645,
-0.03538154810667038,
-0.03976181894540787,
-0.008277539163827896,
0.0771101713180542,
0.0778692364692688,
-0.0738593190908432,
-0.07066129148006439,
-0.06712715327739716,
-0.033170849084854126,
0.032046254724264145,
-0.0428222194314003,
-0.009710864163935184,
-0.0043528140522539616,
0.031156985089182854,
-0.11444292217493057,
0.006786031648516655,
0.03570720925927162,
-0.09537346661090851,
0.029258904978632927,
-0.01888297311961651,
0.004966764710843563,
-0.0760791003704071,
0.011338545940816402,
0.01634296216070652,
0.0623868964612484,
0.06630158424377441,
0.02592328190803528,
-0.06070402264595032,
-0.057532161474227905,
-0.028332022950053215,
-0.06907033920288086,
-0.05251102149486542,
-0.12059992551803589,
0.007547630462795496,
-0.06858602911233902,
0.07372532784938812,
-0.057485274970531464,
0.05093366652727127,
0.07826430350542068,
0.016013339161872864,
0.041697561740875244,
0.03913674131035805,
0.022252777591347694,
-0.012496416456997395,
-0.022577043622732162,
0.024584049358963966,
0.022527866065502167,
-0.05263715982437134,
-0.010741251520812511,
-0.0038531948812305927,
-0.012500387616455555,
-0.09040190279483795,
-0.008466772735118866,
-0.05499429255723953,
0.04805092513561249,
0.023866958916187286,
-0.09222345799207687,
0.0408756360411644,
-0.0029138342943042517,
0.0550120510160923,
0.01631160080432892,
-0.05043574422597885,
-0.002761782379820943,
0.027543367817997932,
-0.025166049599647522,
0.018254444003105164,
0.04702374339103699,
0.0031342452857643366,
-0.082062728703022,
0.13652990758419037,
-0.015369652770459652,
0.027771279215812683,
0.04503775015473366,
-0.0031806593760848045,
-0.10237344354391098,
-0.03686609864234924,
-0.019610537216067314,
-0.05401875078678131,
0.10758961737155914,
0.0094989575445652,
-0.012743187136948109,
0.011276214383542538,
-0.04393649473786354,
0.012284619733691216,
-0.02110268734395504,
-0.014699477702379227,
0.01202898658812046,
0.08131586015224457,
-0.02114081382751465,
0.023224418982863426,
-0.03529196232557297,
0.0590742789208889,
0.03877723217010498,
0.022294681519269943,
-0.04137839376926422,
0.004774253349751234,
0.15601979196071625,
0.01789739914238453,
9.910256386524783e-33,
0.02535746432840824,
-0.1065039411187172,
0.03251628950238228,
-0.040980543941259384,
-0.037216510623693466,
-0.0007738919812254608,
-0.024079617112874985,
0.06780082732439041,
-0.038491711020469666,
0.054948192089796066,
-0.049720339477062225,
0.1114778146147728,
-0.02727956511080265,
0.015414207242429256,
0.04196611046791077,
-0.025038596242666245,
0.03333168849349022,
0.005891637410968542,
-0.08860737085342407,
-0.026513507589697838,
0.01020828727632761,
-0.004491074942052364,
0.0411895327270031,
0.01770411804318428,
0.02446427196264267,
-0.04038304463028908,
-0.05865136906504631,
-0.04557962343096733,
-0.07129500806331635,
-0.025365067645907402,
0.022372020408511162,
0.039629992097616196,
-0.049123696982860565,
-0.0435122549533844,
0.06280258297920227,
0.007165032438933849,
-0.030805470421910286,
0.005492909345775843,
-0.00618743384256959,
0.016453905031085014,
-0.03444985672831535,
-0.016301248222589493,
0.00029266838100738823,
-0.10935147106647491,
-0.06276752054691315,
0.05867442488670349,
-0.07025457918643951,
0.02069733291864395,
0.07299026846885681,
0.031033895909786224,
-0.007387047167867422,
-0.031008280813694,
0.0679558739066124,
0.05543911084532738,
0.06479823589324951,
0.011786796152591705,
-0.002004758920520544,
0.07574783265590668,
0.04454828426241875,
0.05549873411655426,
-0.032993629574775696,
-0.04908275976777077,
0.03672504052519798,
0.023103157058358192,
0.003601159667596221,
0.02427579089999199,
0.06706131994724274,
0.07808585464954376,
0.06197278946638107,
0.10741548985242844,
0.0777924433350563,
0.07251869142055511,
0.03058551624417305,
0.0286235511302948,
0.05211343988776207,
-0.013305682688951492,
0.0853457823395729,
-0.008127997629344463,
0.006341470405459404,
-0.022432241588830948,
-0.02043292112648487,
0.0025135234463959932,
0.04432622343301773,
-0.05539635196328163,
-0.015029544942080975,
0.10045693814754486,
0.019219232723116875,
-0.0165711697191,
-0.06801307946443558,
-0.08054734021425247,
-0.07355821132659912,
0.02727040834724903,
-0.016232741996645927,
-0.04864860326051712,
-0.0450524277985096,
-8.900539065263086e-33,
0.025410879403352737,
0.049257852137088776,
0.07956231385469437,
-0.03690282627940178,
0.05598130077123642,
-0.04003092274069786,
-0.036169979721307755,
-0.04355383664369583,
0.015734095126390457,
0.036429181694984436,
-0.04757675155997276,
-0.04179053381085396,
0.06818976998329163,
-0.053011126816272736,
0.037835437804460526,
0.02820311114192009,
-0.034417394548654556,
-0.1791018396615982,
-0.033376842737197876,
0.014655917882919312,
-0.056305550038814545,
-0.042924731969833374,
0.006485974881798029,
0.10767145454883575,
-0.010024696588516235,
-0.025046782568097115,
0.015040493570268154,
-0.04316167160868645,
-0.027858518064022064,
-0.03643135726451874,
0.026202315464615822,
-0.03371531516313553,
-0.025151165202260017,
-0.009592052549123764,
-0.04527939110994339,
-0.07042545080184937,
0.04542483389377594,
-0.02710268646478653,
-0.013682559132575989,
0.02559645101428032,
-0.01793772540986538,
0.013177645392715931,
0.009956754744052887,
-0.005820263177156448,
0.05512088164687157,
0.04812168329954147,
-0.026983991265296936,
0.10886303335428238,
-0.018804071471095085,
-0.056476376950740814,
0.0026669164653867483,
0.03444884717464447,
-0.059198763221502304,
0.08549471199512482,
0.007442881353199482,
-0.03745061904191971,
0.006536321248859167,
-0.017985133454203606,
-0.05593659356236458,
-0.018023403361439705,
-0.01954600214958191,
-0.019891733303666115,
-0.007792950142174959,
0.08689654618501663,
-0.04519754648208618,
0.018578998744487762,
-0.037676457315683365,
-0.09100135415792465,
-0.14629700779914856,
0.05215216800570488,
-0.057414934039115906,
-0.048323843628168106,
0.12972012162208557,
-0.04370205104351044,
-0.03181535378098488,
0.07709619402885437,
-0.005351467989385128,
-0.0015525800408795476,
0.07054167240858078,
0.023713666945695877,
-0.04225805029273033,
0.0764245018362999,
0.060535311698913574,
0.07457111030817032,
-0.03686008229851723,
0.020236672833561897,
-0.016518937423825264,
0.03233547508716583,
0.03322894498705864,
0.012031422927975655,
-0.07596814632415771,
-0.04950045794248581,
-0.01906275935471058,
0.015848925337195396,
0.008026735857129097,
-5.845751971378377e-8,
-0.05181291699409485,
-0.0676991418004036,
-0.0647297278046608,
0.0617903470993042,
0.01812761276960373,
0.0881146639585495,
0.04854918643832207,
0.132320836186409,
-0.07019295543432236,
-0.03413863107562065,
0.0591161847114563,
-0.03311634063720703,
-0.06559840589761734,
0.030994921922683716,
0.013505489565432072,
0.0011277366429567337,
-0.016154969111084938,
-0.027703898027539253,
-0.040838927030563354,
-0.08732125163078308,
0.013106797821819782,
0.005045504309237003,
0.10544702410697937,
-0.0288464967161417,
0.027088725939393044,
0.01391231082379818,
-0.04878045246005058,
0.029070748016238213,
0.006104605738073587,
-0.05695093423128128,
0.04542500153183937,
-0.026539193466305733,
0.01993909850716591,
-0.03337305039167404,
0.11277482658624649,
0.007951907813549042,
-0.047806672751903534,
0.03278767690062523,
-0.07020964473485947,
0.003205792512744665,
0.031741973012685776,
0.04795141518115997,
0.01721268706023693,
0.025823496282100677,
0.02032390609383583,
-0.010415345430374146,
-0.027656512334942818,
0.06374373286962509,
0.07215077430009842,
0.004703163169324398,
0.0006569078541360795,
-0.13148599863052368,
0.016731591895222664,
0.03598841652274132,
-0.03356732055544853,
-0.03125008940696716,
-0.006279423367232084,
-0.024607514962553978,
0.09733771532773972,
-0.015430236235260963,
0.08312404155731201,
-0.06353048980236053,
-0.02148270048201084,
0.07489188760519028
] | 0.047294
|
feature the return the buckets by relevancy order of the most relevant document in a bucket. [source,js] -------------------------------------------------- POST /sales/\_search { "query": { "match": { "body": "elections" } }, "aggs": { "top\_sites": { "terms": { "field": "domain", "order": { "top\_hit": "desc" } }, "aggs": { "top\_tags\_hits": { "top\_hits": {} }, "top\_hit" : { "max": { "script": { "source": "\_score" } } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] At the moment the `max` (or `min`) aggregator is needed to make sure the buckets from the `terms` aggregator are ordered according to the score of the most relevant webpage per domain. Unfortunately the `top\_hits` aggregator can't be used in the `order` option of the `terms` aggregator yet. ==== top\_hits support in a nested or reverse\_nested aggregator If the `top\_hits` aggregator is wrapped in a `nested` or `reverse\_nested` aggregator then nested hits are being returned. Nested hits are in a sense hidden mini documents that are part of regular document where in the mapping a nested field type has been configured. The `top\_hits` aggregator has the ability to un-hide these documents if it is wrapped in a `nested` or `reverse\_nested` aggregator. Read more about nested in the <>. If nested type has been configured a single document is actually indexed as multiple Lucene documents and they share the same id. In order to determine the identity of a nested hit there is more needed than just the id, so that is why nested hits also include their nested identity. The nested identity is kept under the `\_nested` field in the search hit and includes the array field and the offset in the array field the nested hit belongs to. The offset is zero based. Let's see how it works with a real sample. Considering the following mapping: [source,js] -------------------------------------------------- PUT /sales { "mappings": { "\_doc" : { "properties" : { "tags" : { "type" : "keyword" }, "comments" : { <1> "type" : "nested", "properties" : { "username" : { "type" : "keyword" }, "comment" : { "type" : "text" } } } } } } } -------------------------------------------------- // CONSOLE <1> The `comments` is an array that holds nested documents under the `product` object. And some documents: [source,js] -------------------------------------------------- PUT /sales/\_doc/1?refresh { "tags": ["car", "auto"], "comments": [ {"username": "baddriver007", "comment": "This car could have better brakes"}, {"username": "dr\_who", "comment": "Where's the autopilot? Can't find it"}, {"username": "ilovemotorbikes", "comment": "This car has two extra wheels"} ] } -------------------------------------------------- // CONSOLE // TEST[continued] It's now possible to execute the following `top\_hits` aggregation (wrapped in a `nested` aggregation): [source,js] -------------------------------------------------- POST /sales/\_search { "query": { "term": { "tags": "car" } }, "aggs": { "by\_sale": { "nested" : { "path" : "comments" }, "aggs": { "by\_user": { "terms": { "field": "comments.username", "size": 1 }, "aggs": { "by\_nested": { "top\_hits":{} } } } } } } } -------------------------------------------------- // CONSOLE // TEST[continued] // TEST[s/\_search/\_search\?filter\_path=aggregations.by\_sale.by\_user.buckets/] Top hits response snippet with a nested hit, which resides in the first slot of array field `comments`: [source,js] -------------------------------------------------- { ... "aggregations": { "by\_sale": { "by\_user": { "buckets": [ { "key": "baddriver007", "doc\_count": 1, "by\_nested": { "hits": { "total": 1, "max\_score": 0.2876821, "hits": [ { "\_index": "sales", "\_type" : "\_doc", "\_id": "1", "\_nested": { "field": "comments", <1> "offset": 0 <2> }, "\_score": 0.2876821, "\_source": { "comment": "This car could have better brakes", <3> "username": "baddriver007" } } ] } } } ... ] } } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\.//] <1> Name of the array field containing the nested hit <2> Position if the nested hit in the containing array <3> Source of the nested hit If `\_source` is
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/tophits-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.02924398146569729,
0.05002424493432045,
0.04439135640859604,
0.01794741116464138,
0.061523351818323135,
0.005073218606412411,
-0.04079157114028931,
0.02550775744020939,
0.08052541315555573,
0.011038806289434433,
-0.08388655632734299,
0.02363051287829876,
0.020128782838582993,
-0.02907807193696499,
-0.006963363848626614,
0.023329023271799088,
-0.03301851451396942,
0.06909472495317459,
-0.04679782688617706,
-0.1393386572599411,
0.04281344264745712,
0.06882670521736145,
0.009731445461511612,
-0.0636158362030983,
-0.008124138228595257,
0.013780161738395691,
-0.12018422782421112,
0.018472811207175255,
0.023243969306349754,
-0.004898375365883112,
-0.013896604999899864,
-0.060046594589948654,
0.03930104151368141,
0.11951673030853271,
-0.004820737987756729,
-0.009155643172562122,
-0.06671249866485596,
-0.11149799823760986,
0.067618727684021,
-0.012770367786288261,
0.05419110506772995,
0.027950355783104897,
-0.0171335581690073,
-0.14529281854629517,
0.013793433085083961,
-0.029968248680233955,
-0.05612608417868614,
0.01288960874080658,
-0.0014318990288302302,
0.05379846319556236,
-0.05355464667081833,
-0.055835600942373276,
-0.006105974782258272,
0.04103925824165344,
0.023414406925439835,
0.07802828401327133,
-0.06501144170761108,
-0.07326127588748932,
-0.03561928868293762,
-0.09328119456768036,
-0.006350066978484392,
-0.10452283173799515,
-0.022246934473514557,
-0.012660401873290539,
0.03740038722753525,
-0.04426315054297447,
0.02400314249098301,
0.04615785926580429,
-0.029536699876189232,
0.05674672871828079,
0.11694466322660446,
-0.0068351575173437595,
-0.000041667062760097906,
-0.061339735984802246,
0.059831395745277405,
0.03402170166373253,
-0.05637550354003906,
0.01038546022027731,
-0.012947949580848217,
0.010389755479991436,
-0.08171548694372177,
-0.07269570231437683,
-0.020735720172524452,
0.010598494671285152,
-0.024680055677890778,
-0.07298828661441803,
-0.031122418120503426,
-0.0769566148519516,
0.060875054448843,
-0.023303190246224403,
-0.10719849169254303,
-0.0960431769490242,
0.03680570423603058,
0.022073429077863693,
-0.00786193273961544,
0.05686982348561287,
0.026641663163900375,
-0.03825324773788452,
0.12382519245147705,
0.04488465189933777,
0.015054638497531414,
-0.00242869951762259,
0.002677966607734561,
-0.0933200865983963,
0.01648505963385105,
0.035868365317583084,
-0.11281374096870422,
0.0725875273346901,
-0.03471016883850098,
0.00626639137044549,
-0.006679614074528217,
0.06261560320854187,
0.056628186255693436,
-0.0013759618159383535,
-0.071640744805336,
0.00480573670938611,
0.04222002997994423,
-0.03287922218441963,
0.020515453070402145,
0.012121321633458138,
0.09249036759138107,
0.05852270871400833,
-0.020847301930189133,
-0.040166981518268585,
0.03435042127966881,
0.041807327419519424,
-0.006965897511690855,
-2.9467387895329108e-33,
0.03300350904464722,
-0.07747311145067215,
0.07034896314144135,
-0.07719007879495621,
-0.01261513214558363,
0.09143608063459396,
0.008478786796331406,
0.04581175744533539,
-0.04457557946443558,
0.07775275409221649,
-0.0848420038819313,
0.10986102372407913,
-0.008749471046030521,
-0.08722937107086182,
-0.03997163474559784,
-0.04212106391787529,
-0.014779835939407349,
0.01341590192168951,
-0.061550844460725784,
0.00203228578902781,
-0.031754299998283386,
-0.035567618906497955,
-0.027112292125821114,
0.01296758558601141,
0.00736693711951375,
-0.04859312251210213,
-0.04283542558550835,
-0.033464837819337845,
-0.09672212600708008,
0.004271808546036482,
-0.03994419425725937,
0.003954682033509016,
-0.0015581216430291533,
-0.03137296065688133,
0.01755681447684765,
0.04801604896783829,
-0.018842902034521103,
0.026131823658943176,
-0.0353538878262043,
-0.011610821820795536,
-0.010148911736905575,
0.028764666989445686,
-0.014032070524990559,
-0.07098927348852158,
-0.0921507403254509,
0.05957452952861786,
-0.06368830054998398,
-0.019211702048778534,
0.06646931171417236,
0.034280966967344284,
-0.05623205751180649,
-0.036255721002817154,
0.059087611734867096,
0.0025735124945640564,
0.09335197508335114,
-0.030259927734732628,
-0.02108576148748398,
0.06496472656726837,
-0.01962217316031456,
-0.005954409018158913,
-0.016631362959742546,
0.020011695101857185,
0.010013730265200138,
0.014165664091706276,
-0.0010068451520055532,
-0.010017076507210732,
0.041768889874219894,
0.14093106985092163,
-0.000055334570788545534,
0.05815728008747101,
0.08928388357162476,
0.10524225980043411,
0.011456353589892387,
0.001197343342937529,
0.06441343575716019,
-0.05946781858801842,
0.02382817491889,
-0.0022503777872771025,
0.009260362014174461,
-0.03138650953769684,
-0.0035252198576927185,
-0.07615470141172409,
-0.005789345130324364,
0.0630035325884819,
-0.022973600775003433,
0.1093180701136589,
-0.00960600096732378,
-0.041559889912605286,
-0.05124758183956146,
-0.05047226324677467,
-0.07548300921916962,
-0.020783524960279465,
-0.02181238681077957,
-0.10583169013261795,
-0.04318644851446152,
1.0050757716148802e-33,
0.03493889793753624,
-0.03377208113670349,
0.04975148290395737,
0.0381382517516613,
0.04229656606912613,
-0.04908009618520737,
0.04444316029548645,
-0.003747333772480488,
-0.0025541484355926514,
0.07958316802978516,
-0.011087179183959961,
-0.03077930212020874,
0.021413445472717285,
-0.062492724508047104,
0.07614082843065262,
0.041074030101299286,
-0.058211565017700195,
-0.10789944231510162,
-0.017444416880607605,
-0.04575306922197342,
0.0035451571457087994,
0.0070502073504030704,
0.01934335194528103,
0.11074808239936829,
-0.01644706353545189,
-0.08362188190221786,
-0.001767418347299099,
0.011190667748451233,
-0.06780879199504852,
0.020676422864198685,
0.009783227927982807,
0.0068261995911598206,
-0.055353689938783646,
0.06429135054349899,
-0.047544240951538086,
-0.03566443547606468,
0.04368341341614723,
0.0361073799431324,
0.00979195162653923,
0.09404291957616806,
-0.038324024528265,
0.044251978397369385,
-0.006923635024577379,
0.02660587802529335,
0.017880624160170555,
0.02336166426539421,
-0.01004879642277956,
0.12117522209882736,
-0.005400794092565775,
-0.03962552919983864,
-0.05149935930967331,
0.033082783222198486,
-0.07755894958972931,
0.055050283670425415,
-0.06317529827356339,
-0.04527748376131058,
-0.019220521673560143,
-0.03659922257065773,
-0.09751025587320328,
0.02572195790708065,
0.012105444446206093,
0.004008599556982517,
0.012626194395124912,
0.025677461177110672,
0.028058871626853943,
-0.03222890943288803,
-0.0365406796336174,
0.0012713356409221888,
-0.021255945786833763,
0.007948312908411026,
-0.026410730555653572,
-0.07318664342164993,
0.09130873531103134,
0.007551555056124926,
-0.006121361628174782,
0.030324527993798256,
0.034040939062833786,
0.026234472170472145,
0.09789863228797913,
-0.05446401983499527,
-0.0163505170494318,
0.033237770199775696,
0.0317850187420845,
0.11213348805904388,
0.014415168203413486,
0.023327328264713287,
-0.04806745797395706,
0.052357450127601624,
-0.020781928673386574,
0.026706505566835403,
-0.04857894778251648,
-0.06524881720542908,
0.01860024593770504,
-0.014103133231401443,
-0.02456207573413849,
-4.5926348946068174e-8,
-0.08147824555635452,
0.015045265667140484,
-0.062419649213552475,
0.04006403312087059,
-0.00920464564114809,
0.09031955152750015,
0.09538143873214722,
0.14408664405345917,
-0.04140152409672737,
-0.05002077668905258,
0.07278800010681152,
0.06505299359560013,
-0.0454552099108696,
0.00224528880789876,
-0.03830913081765175,
0.016776898875832558,
-0.040835194289684296,
-0.000448752281954512,
-0.052435364574193954,
-0.048705026507377625,
0.002639264101162553,
0.03393314406275749,
0.06087857484817505,
0.009059486910700798,
0.050266169011592865,
-0.0006707837455905974,
-0.006900344509631395,
0.04567071050405502,
0.05511602386832237,
-0.006160527002066374,
-0.07011573016643524,
-0.013343379832804203,
-0.07787514477968216,
-0.036581456661224365,
0.06181468069553375,
-0.01494244672358036,
-0.02172640711069107,
-0.009319712407886982,
-0.0300343818962574,
0.010181699879467487,
0.02236109972000122,
0.03525014966726303,
-0.007792041637003422,
0.051342494785785675,
0.015968697145581245,
-0.014829019084572792,
0.034263983368873596,
0.04994012042880058,
0.12388600409030914,
-0.05288783460855484,
-0.0036433832719922066,
-0.07380346208810806,
-0.03861914202570915,
0.00894654169678688,
-0.03207756578922272,
-0.06621845066547394,
0.029604405164718628,
0.013831826858222485,
0.007871906273066998,
0.01542241033166647,
0.09204672276973724,
-0.019565608352422714,
0.008391140960156918,
0.07599616050720215
] | -0.009348
|
have better brakes", <3> "username": "baddriver007" } } ] } } } ... ] } } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\.//] <1> Name of the array field containing the nested hit <2> Position if the nested hit in the containing array <3> Source of the nested hit If `\_source` is requested then just the part of the source of the nested object is returned, not the entire source of the document. Also stored fields on the \*nested\* inner object level are accessible via `top\_hits` aggregator residing in a `nested` or `reverse\_nested` aggregator. Only nested hits will have a `\_nested` field in the hit, non nested (regular) hits will not have a `\_nested` field. The information in `\_nested` can also be used to parse the original source somewhere else if `\_source` isn't enabled. If there are multiple levels of nested object types defined in mappings then the `\_nested` information can also be hierarchical in order to express the identity of nested hits that are two layers deep or more. In the example below a nested hit resides in the first slot of the field `nested\_grand\_child\_field` which then resides in the second slow of the `nested\_child\_field` field: [source,js] -------------------------------------------------- ... "hits": { "total": 2565, "max\_score": 1, "hits": [ { "\_index": "a", "\_type": "b", "\_id": "1", "\_score": 1, "\_nested" : { "field" : "nested\_child\_field", "offset" : 1, "\_nested" : { "field" : "nested\_grand\_child\_field", "offset" : 0 } } "\_source": ... }, ... ] } ... -------------------------------------------------- // NOTCONSOLE
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/tophits-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.04224516451358795,
0.03555300086736679,
0.005536865908652544,
0.09967809915542603,
-0.006298898719251156,
-0.08783002942800522,
-0.008341068401932716,
0.014798800460994244,
0.029273051768541336,
-0.009392316453158855,
-0.0298275388777256,
-0.049199000000953674,
0.05735967308282852,
-0.06273578852415085,
-0.0222402885556221,
0.007968380115926266,
-0.03748137876391411,
-0.0018808578606694937,
0.026282899081707,
0.005775749683380127,
-0.04459477961063385,
0.05776359140872955,
-0.00627274950966239,
-0.016095377504825592,
-0.007410257589071989,
0.09142052382230759,
-0.06723237037658691,
0.02476370334625244,
0.014461122453212738,
0.004583865869790316,
0.03657766059041023,
0.04412839561700821,
-0.02488091215491295,
0.02499077282845974,
0.11393512040376663,
0.026049938052892685,
0.004963316954672337,
0.0020266857463866472,
0.06545601785182953,
-0.04881174489855766,
0.054675228893756866,
0.019889015704393387,
0.00789785385131836,
-0.06308549642562866,
-0.05909840017557144,
-0.08951573818922043,
-0.0098551195114851,
-0.026331031695008278,
-0.06816225498914719,
-0.019895143806934357,
-0.15795089304447174,
-0.04329455643892288,
0.035141732543706894,
0.05301482230424881,
0.0741611123085022,
0.029923774302005768,
0.044740475714206696,
-0.040717680007219315,
-0.010240604169666767,
-0.023003892973065376,
0.02438857965171337,
-0.09720107167959213,
-0.0044126203283667564,
-0.0702059343457222,
-0.005241702776402235,
0.0034070180263370275,
-0.060184650123119354,
0.009825206361711025,
-0.039268527179956436,
0.07010534405708313,
0.04858888313174248,
0.06758233159780502,
-0.01843848079442978,
0.03879593312740326,
0.06642140448093414,
0.042874548584222794,
-0.11371248215436935,
-0.041901495307683945,
0.05053694546222687,
-0.12354198098182678,
-0.0014999611303210258,
-0.07373040169477463,
-0.038441188633441925,
-0.04232557862997055,
-0.00048296648310497403,
0.013467521406710148,
0.03411371260881424,
-0.010325389914214611,
0.04251561313867569,
0.009974109008908272,
-0.02398873306810856,
-0.07230040431022644,
0.09128106385469437,
0.06890840828418732,
0.007517877966165543,
0.040491342544555664,
0.010307255201041698,
-0.05401712283492088,
0.03267916664481163,
0.04685111716389656,
-0.007346747908741236,
0.0280460137873888,
0.008287962526082993,
-0.10839401930570602,
-0.03083035536110401,
0.04010392725467682,
-0.018900837749242783,
0.036034755408763885,
-0.0068957912735641,
-0.0013841493055224419,
-0.005608135834336281,
0.06376481801271439,
0.01238651666790247,
-0.025264032185077667,
-0.04957616701722145,
-0.08954071998596191,
-0.012628654018044472,
-0.03369982913136482,
-0.031468991190195084,
0.055207446217536926,
0.08044996112585068,
-0.02961803413927555,
0.05472950637340546,
0.022557003423571587,
0.09011898189783096,
-0.046317294239997864,
-0.016724538058042526,
-5.712197983069793e-33,
0.02397850900888443,
-0.08139846473932266,
-0.006950330920517445,
0.03761516883969307,
0.02966626174747944,
0.04862568527460098,
0.0059575350023806095,
0.10151848196983337,
0.02958931028842926,
0.002745323581621051,
0.002054036594927311,
-0.03826027363538742,
-0.023941440507769585,
-0.05692734941840172,
0.05168944597244263,
0.018400393426418304,
-0.014312407933175564,
0.005686038639396429,
-0.08980964124202728,
-0.00316948676481843,
0.004446269012987614,
-0.025951853021979332,
-0.0416727177798748,
-0.01949482411146164,
-0.008967380039393902,
-0.005382250528782606,
-0.041909173130989075,
-0.028322594240307808,
-0.034762363880872726,
-0.0042821564711630344,
-0.03023994341492653,
-0.014006396755576134,
0.014325040392577648,
0.008025520481169224,
0.09156513214111328,
0.053580306470394135,
-0.002135230926796794,
-0.04467299208045006,
-0.12774138152599335,
0.007606175262480974,
0.00327256228774786,
-0.04033789411187172,
0.03792843595147133,
-0.012982148677110672,
-0.06604139506816864,
-0.1149606853723526,
-0.0697842389345169,
0.05583520233631134,
0.026267509907484055,
0.015064365230500698,
-0.005606427788734436,
0.02714698761701584,
0.04426335170865059,
-0.043560001999139786,
-0.044790878891944885,
0.027147283777594566,
-0.10609076917171478,
0.02701576240360737,
0.03930944576859474,
0.03316282853484154,
0.06730380654335022,
-0.04867427051067352,
0.00846406165510416,
-0.034703727811574936,
-0.0382549874484539,
0.0032428037375211716,
0.0355241522192955,
-0.03322815150022507,
0.018496133387088776,
0.04276369884610176,
0.06271682679653168,
0.06107909232378006,
-0.05271570011973381,
-0.03660113736987114,
-0.047602031379938126,
-0.05650761350989342,
-0.030554451048374176,
-0.009968864731490612,
0.06990042328834534,
-0.07736928015947342,
0.007752666249871254,
-0.03471701964735985,
-0.07081365585327148,
0.017016561701893806,
-0.09700605273246765,
0.05716220661997795,
-0.05389842763543129,
-0.07864361256361008,
-0.0812162235379219,
-0.012692834250628948,
-0.004145249258726835,
-0.09526490420103073,
-0.11394255608320236,
-0.07806506752967834,
0.032374683767557144,
1.0084600014837983e-33,
0.09106697142124176,
-0.04515264183282852,
0.06868747621774673,
-0.07330138236284256,
0.03912175074219704,
-0.038437068462371826,
0.0693989247083664,
0.021052418276667595,
-0.006502723321318626,
0.020865198224782944,
-0.04461761191487312,
-0.0022520970087498426,
-0.02619575522840023,
-0.07061252743005753,
0.08153939992189407,
0.04588678479194641,
0.00046751220361329615,
-0.11066416651010513,
0.04280119761824608,
-0.05459382012486458,
0.04176042228937149,
0.07222122699022293,
-0.01975676603615284,
0.15112265944480896,
-0.014659564942121506,
-0.058686189353466034,
-0.036999527364969254,
0.03488539159297943,
0.00786631554365158,
0.07686667889356613,
0.04500596597790718,
0.03930587321519852,
-0.04435631260275841,
0.04775792732834816,
-0.028498472645878792,
-0.009169052354991436,
-0.018749678507447243,
-0.00188574253115803,
-0.008266001008450985,
-0.014582034200429916,
0.09367460012435913,
0.09645919501781464,
-0.004617003723978996,
0.052788130939006805,
0.0715172216296196,
0.0033562295138835907,
0.03130728751420975,
0.07800383865833282,
0.01899680308997631,
-0.03759056329727173,
-0.012495320290327072,
-0.0655941367149353,
-0.06181621178984642,
0.062030892819166183,
-0.012556634843349457,
0.024093739688396454,
0.006163138896226883,
-0.10881663113832474,
0.011303846724331379,
-0.011481829918920994,
-0.04971497878432274,
-0.007647313643246889,
-0.009707055985927582,
0.0787578597664833,
-0.02069040946662426,
-0.09164313226938248,
-0.08618467301130295,
-0.04560963809490204,
-0.010561231523752213,
-0.02406640350818634,
0.03169754520058632,
-0.04330673813819885,
0.021012092009186745,
-0.010115093551576138,
-0.007987619377672672,
0.016907067969441414,
-0.01678450033068657,
-0.03402966633439064,
0.0014368710108101368,
-0.022118285298347473,
-0.029349468648433685,
0.017001843079924583,
-0.00817913468927145,
0.13522356748580933,
0.014639880508184433,
-0.06185712292790413,
0.04285099357366562,
0.042903512716293335,
-0.018894394859671593,
0.013866034336388111,
-0.03771144151687622,
0.008427268825471401,
-0.0009443627204746008,
-0.024777546525001526,
-0.003368255915120244,
-6.024639986890179e-8,
-0.12662972509860992,
-0.019682860001921654,
-0.04741080477833748,
0.09221518039703369,
0.03703572228550911,
0.0000447072452516295,
0.000041284827602794394,
0.03235536441206932,
-0.01589854061603546,
-0.0404280461370945,
0.029100382700562477,
-0.0741921216249466,
0.006355003919452429,
-0.060873277485370636,
-0.01254901010543108,
-0.010116197168827057,
-0.05489695444703102,
0.02443595416843891,
-0.07185927033424377,
0.03957752510905266,
0.06995603442192078,
0.007326453924179077,
0.04383907467126846,
0.06381507217884064,
0.06523987650871277,
0.029886597767472267,
-0.03525335341691971,
-0.041551049798727036,
-0.012713667005300522,
-0.08425287157297134,
0.04465102776885033,
0.05275960639119148,
0.029473865404725075,
0.05564511567354202,
-0.033733319491147995,
0.12433743476867676,
0.057575441896915436,
0.0901479721069336,
-0.05466608703136444,
0.05878665670752525,
0.006665890570729971,
0.06306787580251694,
-0.027814077213406563,
-0.015852633863687515,
-0.01276297215372324,
-0.009361372329294682,
-0.07214648276567459,
0.05366632714867592,
0.14023354649543762,
-0.04924774542450905,
-0.020850704982876778,
-0.037615980952978134,
-0.028066519647836685,
0.07562801986932755,
-0.0457366481423378,
-0.06005556508898735,
0.049398742616176605,
0.07116315513849258,
0.027128200978040695,
0.02933715097606182,
0.15075232088565826,
0.05117237940430641,
-0.018432896584272385,
0.05393269658088684
] | 0.025567
|
[[search-aggregations-metrics-min-aggregation]] === Min Aggregation A `single-value` metrics aggregation that keeps track and returns the minimum value among numeric values extracted from the aggregated documents. These values can be extracted either from specific numeric fields in the documents, or be generated by a provided script. NOTE: The `min` and `max` aggregation operate on the `double` representation of the data. As a consequence, the result may be approximate when running on longs whose absolute value is greater than +2^53+. Computing the min price value across all documents: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "min\_price" : { "min" : { "field" : "price" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] Response: [source,js] -------------------------------------------------- { ... "aggregations": { "min\_price": { "value": 10.0 } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] As can be seen, the name of the aggregation (`min\_price` above) also serves as the key by which the aggregation result can be retrieved from the returned response. ==== Script The `min` aggregation can also calculate the minimum of a script. The example below computes the minimum price: [source,js] -------------------------------------------------- POST /sales/\_search { "aggs" : { "min\_price" : { "min" : { "script" : { "source" : "doc.price.value" } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] This will use the <> scripting language and no script parameters. To use a stored script use the following syntax: [source,js] -------------------------------------------------- POST /sales/\_search { "aggs" : { "min\_price" : { "min" : { "script" : { "id": "my\_script", "params": { "field": "price" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales,stored\_example\_script] ==== Value Script Let's say that the prices of the documents in our index are in USD, but we would like to compute the min in EURO (and for the sake of this example, let's say the conversion rate is 1.2). We can use a value script to apply the conversion rate to every value before it is aggregated: [source,js] -------------------------------------------------- POST /sales/\_search { "aggs" : { "min\_price\_in\_euros" : { "min" : { "field" : "price", "script" : { "source" : "\_value \* params.conversion\_rate", "params" : { "conversion\_rate" : 1.2 } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] ==== Missing value The `missing` parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value. [source,js] -------------------------------------------------- POST /sales/\_search { "aggs" : { "grade\_min" : { "min" : { "field" : "grade", "missing": 10 <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> Documents without a value in the `grade` field will fall into the same bucket as documents that have the value `10`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/min-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.027380766347050667,
0.10101587325334549,
0.00011282954801572487,
0.0834662988781929,
-0.0279157105833292,
0.04641188308596611,
-0.05573815852403641,
0.09633556753396988,
0.1279337853193283,
-0.04850846901535988,
-0.0720403641462326,
-0.05258377268910408,
0.013928084634244442,
0.01760369911789894,
-0.01682984083890915,
-0.01311253197491169,
-0.007389774080365896,
0.0584418810904026,
-0.09708444774150848,
-0.07919314503669739,
0.027335334569215775,
0.019960083067417145,
-0.012217598967254162,
-0.04417509213089943,
0.044524259865283966,
-0.0331479050219059,
-0.06585012376308441,
-0.01337429042905569,
0.041018761694431305,
0.033928848803043365,
-0.04349665716290474,
0.0011811666190624237,
0.05847911536693573,
0.07739836722612381,
0.02915015071630478,
-0.045170173048973083,
-0.0023489128798246384,
-0.022458218038082123,
0.033867496997117996,
0.00671512121334672,
-0.0007144793635234237,
0.0070463730953633785,
-0.11557403951883316,
-0.04379001632332802,
0.0066507961601018906,
-0.055247701704502106,
-0.041110750287771225,
0.02246084250509739,
-0.0075636678375303745,
0.035543471574783325,
-0.052416037768125534,
0.07664702087640762,
-0.02315731905400753,
0.025205189362168312,
-0.008753185160458088,
0.007557060569524765,
-0.04583980515599251,
-0.06712403148412704,
0.02993294969201088,
-0.04102800413966179,
-0.018295982852578163,
-0.11801464855670929,
0.005163423251360655,
-0.03909424692392349,
0.028761766850948334,
-0.039311427623033524,
0.02801509015262127,
-0.025977235287427902,
-0.08061576634645462,
0.04903358966112137,
0.08445321768522263,
0.02485608495771885,
0.03638588264584541,
-0.0423576720058918,
0.04157909005880356,
-0.0008257912122644484,
0.023211626335978508,
-0.032055482268333435,
0.0017187981866300106,
0.005832853727042675,
-0.04201226681470871,
-0.0988263338804245,
-0.07844392955303192,
0.03525528311729431,
0.011741469614207745,
-0.08367054164409637,
0.042618509382009506,
-0.016082018613815308,
0.10538087785243988,
-0.023642700165510178,
-0.07622336596250534,
0.012442736886441708,
-0.04131387174129486,
0.04131128266453743,
0.024650556966662407,
0.01842559687793255,
0.02291041612625122,
0.024783575907349586,
0.05755363404750824,
-0.0028626529965549707,
0.049669668078422546,
-0.034515153616666794,
0.06712563335895538,
-0.061947740614414215,
-0.0027077975682914257,
-0.014357232488691807,
-0.0312851145863533,
-0.011564522050321102,
-0.052779726684093475,
-0.04929868504405022,
0.00838394369930029,
-0.03205273300409317,
-0.033825188875198364,
-0.013703594915568829,
-0.010393171571195126,
0.06611721217632294,
0.07264770567417145,
-0.06695187091827393,
0.004740743897855282,
0.049398086965084076,
0.0137803228572011,
0.050702616572380066,
0.026786906644701958,
0.014024561271071434,
0.018142936751246452,
0.08607909083366394,
0.03881419450044632,
5.598860307512362e-34,
-0.004156364127993584,
-0.06045391038060188,
0.007717037573456764,
-0.14001959562301636,
-0.054187435656785965,
0.04886545240879059,
-0.010024786926805973,
0.027356132864952087,
-0.06407362967729568,
0.04696369171142578,
-0.06018010154366493,
0.10923455655574799,
-0.030043432489037514,
-0.1061839759349823,
0.04758276790380478,
-0.03459986299276352,
0.013872159644961357,
-0.03836005553603172,
0.04276673123240471,
-0.018650662153959274,
0.011991746723651886,
-0.024319563060998917,
-0.001007743994705379,
0.056795358657836914,
-0.00011138230183860287,
0.0077530331909656525,
0.0064625428058207035,
-0.044708505272865295,
-0.06222682446241379,
-0.005822734907269478,
-0.07586430758237839,
0.001404103939421475,
0.012239545583724976,
-0.03307507187128067,
-0.006322765257209539,
0.006255825515836477,
0.012904743663966656,
0.0462958887219429,
-0.028871584683656693,
0.020245330408215523,
-0.036179035902023315,
0.07270804792642593,
0.034911368042230606,
-0.10940778255462646,
-0.0769430622458458,
0.08027651906013489,
0.058548472821712494,
0.056235142052173615,
0.046872805804014206,
-0.004462528042495251,
-0.0773051455616951,
0.012389502488076687,
-0.03547990694642067,
0.014098015613853931,
0.07732287049293518,
-0.02829814702272415,
0.007212263997644186,
0.00043045319034717977,
0.001806795597076416,
-0.03225857391953468,
-0.03748215362429619,
-0.003173187607899308,
0.04112902656197548,
0.02036183513700962,
-0.03593418374657631,
0.022347066551446915,
0.009514746256172657,
0.08984097093343735,
0.0112439701333642,
0.0807691365480423,
0.053129665553569794,
0.05279336869716644,
0.044515211135149,
-0.010570014826953411,
0.10550697147846222,
-0.02087702788412571,
0.14897991716861725,
0.04982316493988037,
0.018759822472929955,
-0.01435417216271162,
-0.0269923098385334,
0.025181150063872337,
0.03839579597115517,
0.04523845762014389,
-0.06133761629462242,
0.0952121838927269,
-0.039114613085985184,
0.032133083790540695,
-0.09126465022563934,
-0.06254018098115921,
-0.05310308560729027,
0.039109013974666595,
-0.1116718202829361,
-0.07080688327550888,
0.0040129502303898335,
-2.1253145411088275e-33,
-0.024365458637475967,
-0.03332865238189697,
0.051888011395931244,
0.07568200677633286,
0.02356630004942417,
0.0041132778860628605,
0.0006731281755492091,
0.02974541299045086,
0.025910357013344765,
0.05265658721327782,
-0.004365839529782534,
-0.02448400668799877,
-0.016271796077489853,
-0.058087922632694244,
-0.03550342470407486,
0.035043131560087204,
-0.03331832215189934,
-0.10825416445732117,
0.11356436461210251,
-0.03283959627151489,
0.0031148558482527733,
0.07554160058498383,
-0.008722683414816856,
0.1696753054857254,
-0.00947644840925932,
-0.048826396465301514,
0.02759089320898056,
-0.041105467826128006,
-0.09875679016113281,
-0.022283608093857765,
0.0009722066461108625,
-0.06527777761220932,
-0.041841600090265274,
0.019971642643213272,
-0.06766850501298904,
-0.018997231498360634,
0.018954820930957794,
0.006899100262671709,
-0.014106904156506062,
0.06590867787599564,
-0.035578470677137375,
0.004835851024836302,
-0.020780786871910095,
-0.006933147553354502,
0.04750803858041763,
-0.019305631518363953,
0.0036373340990394354,
0.012296763248741627,
-0.024561960250139236,
-0.09309595823287964,
-0.019280385226011276,
0.022898737341165543,
-0.051461104303598404,
0.09638107568025589,
-0.0881204605102539,
-0.03387843817472458,
-0.053337063640356064,
-0.02692393586039543,
-0.013540287502110004,
0.0014185890322551131,
0.022237224504351616,
-0.0110446373000741,
-0.06238693743944168,
0.039360374212265015,
0.021810349076986313,
-0.015096957795321941,
0.010536104440689087,
-0.06498322635889053,
-0.047810524702072144,
-0.0015324950218200684,
0.05950376018881798,
-0.0020767829846590757,
0.11581812798976898,
0.02588644251227379,
-0.06254035979509354,
0.007453921250998974,
0.0069971103221178055,
-0.0019205352291464806,
0.10042338073253632,
-0.013764730654656887,
0.03285607323050499,
0.0793633833527565,
0.04652658849954605,
0.0772659108042717,
-0.07165462523698807,
0.000034022672480205074,
0.007947087287902832,
0.08017678558826447,
-0.015087803825736046,
0.0435708649456501,
-0.12655644118785858,
-0.00920530129224062,
0.017125358805060387,
-0.057991255074739456,
-0.06668414175510406,
-4.9621728948068267e-8,
-0.06659454107284546,
-0.00031204576953314245,
-0.04216698184609413,
0.037458550184965134,
0.014334295876324177,
0.023566072806715965,
0.04952947422862053,
0.09395158290863037,
-0.004805847071111202,
0.03615717589855194,
0.03886425867676735,
0.01582268252968788,
-0.09096753597259521,
0.05932550132274628,
-0.10804492235183716,
-0.008397526107728481,
0.0564715750515461,
-0.009736089035868645,
0.02985006384551525,
-0.06551749259233475,
0.0645853728055954,
0.07771753519773483,
0.03207775577902794,
-0.02473861165344715,
0.04870446026325226,
-0.019266191869974136,
0.007134029176086187,
0.03846774995326996,
0.0723414495587349,
-0.06641817837953568,
-0.09180987626314163,
-0.016665354371070862,
-0.0028123490046709776,
0.04338052496314049,
0.018572304397821426,
0.021318120881915092,
-0.024596426635980606,
0.08714356273412704,
-0.09788554161787033,
0.03821336105465889,
-0.04474108666181564,
-0.036184731870889664,
-0.07986226677894592,
-0.03333456814289093,
-0.01226260419934988,
0.006983151659369469,
-0.05689720809459686,
0.00806916318833828,
0.07774484157562256,
-0.029807550832629204,
0.09176260232925415,
-0.09325244277715683,
0.0012777113588526845,
0.02674710750579834,
-0.06292524933815002,
-0.10640303045511246,
-0.007616933435201645,
-0.010057076811790466,
-0.040603794157505035,
-0.02451149746775627,
0.0375814214348793,
-0.08192242681980133,
-0.07546978443861008,
0.0063928705640137196
] | -0.006384
|
[[search-aggregations-metrics-cardinality-aggregation]] === Cardinality Aggregation A `single-value` metrics aggregation that calculates an approximate count of distinct values. Values can be extracted either from specific fields in the document or generated by a script. Assume you are indexing store sales and would like to count the unique number of sold products that match a query: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "type\_count" : { "cardinality" : { "field" : "type" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] Response: [source,js] -------------------------------------------------- { ... "aggregations" : { "type\_count" : { "value" : 3 } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] ==== Precision control This aggregation also supports the `precision\_threshold` option: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "type\_count" : { "cardinality" : { "field" : "\_doc", "precision\_threshold": 100 <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> The `precision\_threshold` options allows to trade memory for accuracy, and defines a unique count below which counts are expected to be close to accurate. Above this value, counts might become a bit more fuzzy. The maximum supported value is 40000, thresholds above this number will have the same effect as a threshold of 40000. The default value is +3000+. ==== Counts are approximate Computing exact counts requires loading values into a hash set and returning its size. This doesn't scale when working on high-cardinality sets and/or large values as the required memory usage and the need to communicate those per-shard sets between nodes would utilize too many resources of the cluster. This `cardinality` aggregation is based on the http://static.googleusercontent.com/media/research.google.com/fr//pubs/archive/40671.pdf[HyperLogLog++] algorithm, which counts based on the hashes of the values with some interesting properties: \* configurable precision, which decides on how to trade memory for accuracy, \* excellent accuracy on low-cardinality sets, \* fixed memory usage: no matter if there are tens or billions of unique values, memory usage only depends on the configured precision. For a precision threshold of `c`, the implementation that we are using requires about `c \* 8` bytes. The following chart shows how the error varies before and after the threshold: //// To generate this chart use this gnuplot script: [source,gnuplot] ------- #!/usr/bin/gnuplot reset set terminal png size 1000,400 set xlabel "Actual cardinality" set logscale x set ylabel "Relative error (%)" set yrange [0:8] set title "Cardinality error" set grid set style data lines plot "test.dat" using 1:2 title "threshold=100", \ "" using 1:3 title "threshold=1000", \ "" using 1:4 title "threshold=10000" # ------- and generate data in a 'test.dat' file using the below Java code: [source,java] ------- private static double error(HyperLogLogPlusPlus h, long expected) { double actual = h.cardinality(0); return Math.abs(expected - actual) / expected; } public static void main(String[] args) { HyperLogLogPlusPlus h100 = new HyperLogLogPlusPlus(precisionFromThreshold(100), BigArrays.NON\_RECYCLING\_INSTANCE, 1); HyperLogLogPlusPlus h1000 = new HyperLogLogPlusPlus(precisionFromThreshold(1000), BigArrays.NON\_RECYCLING\_INSTANCE, 1); HyperLogLogPlusPlus h10000 = new HyperLogLogPlusPlus(precisionFromThreshold(10000), BigArrays.NON\_RECYCLING\_INSTANCE, 1); int next = 100; int step = 10; for (int i = 1; i <= 10000000; ++i) { long h = BitMixer.mix64(i); h100.collect(0, h); h1000.collect(0, h); h10000.collect(0, h); if (i == next) { System.out.println(i + " " + error(h100, i)\*100 + " " + error(h1000, i)\*100 + " " + error(h10000, i)\*100); next += step; if (next >= 100 \* step) { step \*= 10; } } } } ------- //// image:images/cardinality\_error.png[] For all 3 thresholds, counts have been accurate up to the configured threshold (although not guaranteed, this is likely to be the case). Please also note that even with a threshold as low as 100, the error remains very low, even when counting millions of items. ==== Pre-computed hashes On string fields that have a high cardinality,
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/cardinality-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.014139852486550808,
0.04428533464670181,
-0.04981090500950813,
0.10720893740653992,
-0.0791313648223877,
0.0851413756608963,
0.06425564736127853,
0.06041013449430466,
0.1338346153497696,
-0.06994333863258362,
-0.01672418974339962,
-0.044494956731796265,
0.08209666609764099,
-0.027165059000253677,
-0.05743761360645294,
0.0009598320466466248,
-0.03895106166601181,
0.01698794774711132,
-0.023152155801653862,
-0.10888514667749405,
0.028051044791936874,
-0.003685728879645467,
0.011142772622406483,
-0.05493992567062378,
0.0055638765916228294,
-0.004370798822492361,
-0.06950704753398895,
-0.014867441728711128,
0.009065800346434116,
0.014977611601352692,
-0.055432528257369995,
-0.00954563356935978,
0.041340168565511703,
0.07886908948421478,
-0.005041024647653103,
-0.024120386689901352,
-0.03013116493821144,
-0.05024192854762077,
0.03757737949490547,
-0.018846901133656502,
0.04205850884318352,
0.03214910998940468,
0.001110189943574369,
-0.08082340657711029,
0.037269800901412964,
-0.01640218496322632,
-0.08637583255767822,
0.044353216886520386,
-0.01758892834186554,
0.04180295020341873,
-0.008207730948925018,
0.08749144524335861,
-0.05948655679821968,
0.005019065458327532,
0.10246139764785767,
0.014177064411342144,
-0.10447025299072266,
-0.08907277882099152,
-0.029604053124785423,
-0.03737124055624008,
-0.0015236112521961331,
-0.1158471554517746,
0.03627845272421837,
-0.06020016968250275,
-0.019317451864480972,
-0.01169591210782528,
0.04829159379005432,
0.04274393245577812,
0.033068619668483734,
0.02325812727212906,
0.04637126997113228,
0.007890857756137848,
0.01616167090833187,
-0.01275831088423729,
-0.02882681041955948,
0.06376880407333374,
-0.050027426332235336,
-0.013369505293667316,
0.023288488388061523,
0.053843531757593155,
-0.10417690128087997,
-0.08695739507675171,
-0.0533100850880146,
0.04992229491472244,
0.015463529154658318,
-0.048431146889925,
0.036086928099393845,
-0.025868389755487442,
0.09505046159029007,
-0.07209159433841705,
-0.1015036329627037,
0.012101668864488602,
-0.04429076611995697,
-0.008510456420481205,
0.05211642384529114,
0.024073895066976547,
0.006164214573800564,
0.013157234527170658,
0.08830606192350388,
0.025062259286642075,
0.026141691952943802,
-0.0073364428244531155,
0.05523750185966492,
-0.057350657880306244,
-0.08585728704929352,
0.029154740273952484,
-0.03656258434057236,
0.0013291955692693591,
-0.061257511377334595,
0.018190303817391396,
-0.011806122958660126,
0.02403395064175129,
0.010392319411039352,
0.06833996623754501,
0.0036234871950000525,
-0.006337237078696489,
0.094643734395504,
-0.059343982487916946,
0.07065669447183609,
0.021480869501829147,
0.09434646368026733,
0.04104432463645935,
0.04774761572480202,
0.0035805932711809874,
0.010197260417044163,
0.05837179720401764,
0.05204227566719055,
-2.338623419428886e-33,
-0.019073044881224632,
-0.033640675246715546,
0.06181410327553749,
-0.05808976665139198,
-0.006320386193692684,
0.03905801475048065,
0.02609969675540924,
0.1070607379078865,
-0.05346565321087837,
0.06032002344727516,
-0.062073446810245514,
0.14764825999736786,
-0.03321124240756035,
-0.0367068275809288,
0.021834727376699448,
0.004741644021123648,
0.043688565492630005,
-0.004378411453217268,
0.007333429530262947,
-0.0633753091096878,
0.04873659089207649,
-0.03796422481536865,
0.02407625876367092,
0.07509513199329376,
0.01282886229455471,
-0.06959639489650726,
-0.05073551833629608,
-0.022169331088662148,
-0.09356299787759781,
-0.022544439882040024,
0.020812610164284706,
0.02606453374028206,
0.00456028850749135,
-0.010397273115813732,
0.04749169945716858,
-0.02522531896829605,
-0.0008679457823745906,
0.057890549302101135,
-0.012833182699978352,
-0.021438326686620712,
0.016581635922193527,
0.003866775892674923,
0.049151934683322906,
-0.07949621230363846,
-0.11381489038467407,
0.04290701821446419,
-0.08568022400140762,
-0.021657543256878853,
0.05503013730049133,
0.04693247750401497,
-0.013137041591107845,
0.006234722211956978,
0.014279639348387718,
0.009926716797053814,
0.029537314549088478,
-0.04110744595527649,
-0.007062720134854317,
0.07384658604860306,
0.016225341707468033,
0.06603633612394333,
-0.07390162348747253,
0.02878793701529503,
0.03485089913010597,
0.009195821359753609,
0.03449070826172829,
0.03562501072883606,
0.0020591190550476313,
0.10023424029350281,
0.02082507126033306,
0.07176989316940308,
0.08972914516925812,
0.051306337118148804,
-0.005122253205627203,
-0.027202308177947998,
-0.02553592249751091,
-0.08745955675840378,
0.06277847290039062,
0.029637960717082024,
-0.05428849905729294,
0.010492882691323757,
-0.04682759568095207,
-0.01550996582955122,
-0.002655126852914691,
0.03645830973982811,
-0.03378251940011978,
0.12476300448179245,
-0.037683770060539246,
0.011156204156577587,
-0.05801874026656151,
-0.08560548722743988,
0.015587515197694302,
0.027794260531663895,
-0.08218379318714142,
-0.14734792709350586,
-0.05617266520857811,
-6.3574972700617e-34,
-0.019336683675646782,
-0.03642597049474716,
0.07284890860319138,
0.04253429174423218,
0.047915585339069366,
-0.07231658697128296,
0.0011499823303893209,
-0.012888532131910324,
0.017586586996912956,
-0.011340467259287834,
-0.007752794306725264,
0.02836417593061924,
0.05702704191207886,
-0.029311593621969223,
-0.06493247300386429,
0.05682866647839546,
-0.0737365335226059,
-0.08881799876689911,
0.019676750525832176,
0.03649352863430977,
-0.009494888596236706,
0.034495096653699875,
0.012759264558553696,
0.0898074358701706,
-0.07661349326372147,
-0.03458787500858307,
0.009401623159646988,
-0.062037721276283264,
-0.06440389156341553,
-0.0351361483335495,
0.08998723328113556,
-0.02798360586166382,
0.009942148812115192,
-0.009773213416337967,
-0.024654723703861237,
-0.09771319478750229,
0.09683532267808914,
0.04943879321217537,
-0.022075550630688667,
0.06745459139347076,
-0.06315727531909943,
-0.013396861031651497,
-0.05019037798047066,
0.00767860934138298,
0.07741618901491165,
0.0010699126869440079,
0.07871024310588837,
0.009713650681078434,
0.019721275195479393,
-0.09847164899110794,
-0.005052156280726194,
0.05034857243299484,
-0.08287443965673447,
0.07766542583703995,
-0.08311890810728073,
-0.08325624465942383,
-0.03737340494990349,
-0.02890743874013424,
-0.03060615248978138,
-0.019877061247825623,
-0.02151738479733467,
-0.026631928980350494,
-0.0234539695084095,
0.028805697336792946,
0.04182903841137886,
-0.039238762110471725,
-0.0404549315571785,
-0.058230895549058914,
-0.05563146993517876,
-0.011906123720109463,
-0.0068809231743216515,
-0.03577040135860443,
0.0708736926317215,
0.04519534483551979,
-0.02461121790111065,
0.0015789581229910254,
0.00957060419023037,
-0.02847963571548462,
0.017463574185967445,
0.03537502512335777,
-0.019695280119776726,
-0.02652132883667946,
0.07785440981388092,
0.045323289930820465,
-0.10730383545160294,
-0.0029743497725576162,
0.010905721224844456,
0.05965384468436241,
-0.04844803363084793,
0.03236498311161995,
-0.05729874223470688,
-0.019253306090831757,
-0.06353607773780823,
-0.030630113556981087,
0.04301298409700394,
-5.0532673157022145e-8,
-0.08980238437652588,
-0.00309323170222342,
-0.09166914224624634,
0.03261096030473709,
0.0006979109020903707,
0.04746846482157707,
0.04244445264339447,
0.06464683264493942,
-0.09541703015565872,
-0.05434809997677803,
-0.008882432244718075,
0.015289505943655968,
-0.08232550323009491,
0.07857280969619751,
-0.034946560859680176,
-0.03989953175187111,
0.006014311220496893,
0.08064784109592438,
0.007895433343946934,
-0.013091429136693478,
0.06880947947502136,
0.0660882443189621,
0.08245623111724854,
-0.06066557392477989,
0.015698136761784554,
-0.05600321665406227,
0.02724677138030529,
-0.0036604648921638727,
0.04489168897271156,
0.008840970695018768,
-0.010228762403130531,
-0.03550475463271141,
0.018828628584742546,
0.028735004365444183,
0.03541259095072746,
-0.010623154230415821,
-0.04691362380981445,
0.005399227607995272,
-0.08463004231452942,
-0.006956011056900024,
-0.011950084008276463,
0.011525491252541542,
-0.045693907886743546,
0.04170140624046326,
-0.017434950917959213,
0.006135611794888973,
-0.0561789833009243,
-0.011780613102018833,
0.08532088249921799,
-0.03720024228096008,
0.0548442080616951,
-0.05489221587777138,
-0.04645567759871483,
-0.031186122447252274,
-0.07328576594591141,
-0.03695504367351532,
-0.02317933179438114,
-0.04984663426876068,
0.07066448777914047,
-0.013608683831989765,
0.026513615623116493,
-0.10101599246263504,
-0.028578344732522964,
0.01109487097710371
] | 0.047027
|
accurate up to the configured threshold (although not guaranteed, this is likely to be the case). Please also note that even with a threshold as low as 100, the error remains very low, even when counting millions of items. ==== Pre-computed hashes On string fields that have a high cardinality, it might be faster to store the hash of your field values in your index and then run the cardinality aggregation on this field. This can either be done by providing hash values from client-side or by letting Elasticsearch compute hash values for you by using the {plugins}/mapper-murmur3.html[`mapper-murmur3`] plugin. NOTE: Pre-computing hashes is usually only useful on very large and/or high-cardinality fields as it saves CPU and memory. However, on numeric fields, hashing is very fast and storing the original values requires as much or less memory than storing the hashes. This is also true on low-cardinality string fields, especially given that those have an optimization in order to make sure that hashes are computed at most once per unique value per segment. ==== Script The `cardinality` metric supports scripting, with a noticeable performance hit however since hashes need to be computed on the fly. [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "type\_promoted\_count" : { "cardinality" : { "script": { "lang": "painless", "source": "doc['type'].value + ' ' + doc['promoted'].value" } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] This will interpret the `script` parameter as an `inline` script with the `painless` script language and no script parameters. To use a stored script use the following syntax: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "type\_promoted\_count" : { "cardinality" : { "script" : { "id": "my\_script", "params": { "type\_field": "\_doc", "promoted\_field": "promoted" } } } } } } -------------------------------------------------- // CONSOLE // TEST[skip:no script] ==== Missing value The `missing` parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value. [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "tag\_cardinality" : { "cardinality" : { "field" : "tag", "missing": "N/A" <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> Documents without a value in the `tag` field will fall into the same bucket as documents that have the value `N/A`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/metrics/cardinality-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.07372837513685226,
-0.002340743551030755,
0.030180662870407104,
-0.019276242703199387,
-0.051071301102638245,
-0.03990468382835388,
-0.02399262599647045,
-0.019290795549750328,
0.08532486855983734,
0.002057782607153058,
-0.08269628882408142,
-0.00030262203654274344,
0.03602214530110359,
-0.02842063643038273,
-0.08064348995685577,
0.01584402285516262,
-0.03142591565847397,
0.019703209400177002,
-0.09291105717420578,
-0.06245165690779686,
-0.018589990213513374,
0.07308493554592133,
0.02222398854792118,
-0.03187296539545059,
-0.025990577414631844,
-0.012228664010763168,
-0.09045536816120148,
0.023914385586977005,
-0.00490796472877264,
0.00016939079796429724,
0.021166181191802025,
0.05950179323554039,
0.12197693437337875,
0.05238416790962219,
-0.08036920428276062,
0.03095770813524723,
-0.05859538912773132,
-0.03525553271174431,
0.0017479229718446732,
0.00899393018335104,
0.014365033246576786,
0.008837396278977394,
-0.038159746676683426,
-0.02822301536798477,
-0.04250257834792137,
0.01231671217828989,
-0.006613029167056084,
0.05624488368630409,
0.0371607281267643,
0.01928837224841118,
-0.017986269667744637,
0.04336249455809593,
0.028062017634510994,
0.054999545216560364,
-0.011140990070998669,
0.03598294407129288,
-0.06822342425584793,
-0.10439185053110123,
-0.03489214926958084,
-0.04672963172197342,
0.016967399045825005,
-0.026764877140522003,
0.0900886133313179,
-0.10119042545557022,
0.050413910299539566,
0.024665391072630882,
0.11874145269393921,
-0.0169823095202446,
0.05048298090696335,
0.057147812098264694,
0.11871829628944397,
0.009303387254476547,
-0.03961846977472305,
0.05705699324607849,
0.0113879619166255,
0.16448132693767548,
-0.05130353197455406,
-0.06894494593143463,
0.04740524664521217,
0.0212248507887125,
-0.13255633413791656,
-0.12377603352069855,
-0.02944345586001873,
-0.022395342588424683,
0.029706917703151703,
-0.09618973731994629,
0.01830633170902729,
-0.04353410005569458,
0.01345210149884224,
-0.017045462504029274,
-0.030782682821154594,
-0.03159423917531967,
0.020019982010126114,
-0.037559568881988525,
0.1125066727399826,
0.025963667780160904,
-0.030415207147598267,
0.012514651753008366,
0.029897412285208702,
-0.002501879585906863,
-0.053651995956897736,
0.0224629957228899,
-0.018529288470745087,
-0.14063358306884766,
0.010412836447358131,
-0.005399026907980442,
0.02231444977223873,
0.00012672034790739417,
-0.06325449794530869,
0.046535756438970566,
0.08660047501325607,
0.00012474179675336927,
0.021525537595152855,
0.004153032321482897,
0.009298221208155155,
0.08574499189853668,
0.02470448985695839,
-0.019359488040208817,
0.05011327937245369,
0.0949273332953453,
0.05958835408091545,
-0.015468951314687729,
0.0259601678699255,
-0.03621983900666237,
-0.016908999532461166,
0.04357807710766792,
-0.03133673220872879,
4.977415566153982e-33,
0.04819130152463913,
0.028975075110793114,
0.0487210787832737,
0.004647541791200638,
-0.068151094019413,
0.061418525874614716,
-0.02739083580672741,
0.04331535845994949,
-0.029505042359232903,
-0.03241236135363579,
-0.05019405484199524,
0.09870289266109467,
0.034250326454639435,
-0.048716165125370026,
0.042257390916347504,
-0.060288842767477036,
0.05696820095181465,
-0.02392304688692093,
-0.05901762843132019,
-0.003441362641751766,
0.03759684041142464,
-0.12087787687778473,
-0.014696337282657623,
-0.012982084415853024,
0.049425821751356125,
0.01355552114546299,
-0.06356830894947052,
-0.10165149718523026,
0.03241008520126343,
0.004485790152102709,
-0.012007925659418106,
0.0022404419723898172,
0.026386093348264694,
-0.010829074308276176,
0.042268045246601105,
-0.0034251019824296236,
-0.03755807876586914,
0.051623862236738205,
-0.058153506368398666,
-0.03308415412902832,
0.021256033331155777,
-0.06371919810771942,
0.009964029304683208,
-0.09989612549543381,
-0.07885070145130157,
-0.0009512402466498315,
-0.08117809146642685,
0.006787104532122612,
0.03288969025015831,
0.06311643123626709,
0.0868988186120987,
-0.038260169327259064,
-0.02713797427713871,
0.057537201792001724,
0.06903375685214996,
-0.044133368879556656,
0.0618753582239151,
-0.010851855389773846,
-0.0001261445868294686,
0.04423774406313896,
-0.05492126941680908,
-0.0196998231112957,
0.1006183922290802,
0.02979595772922039,
0.08403180539608002,
-0.02953973226249218,
0.07203590869903564,
0.0772050991654396,
-0.023737212643027306,
0.07567089051008224,
0.05249447003006935,
0.04166364669799805,
0.0013000667095184326,
-0.01837153173983097,
-0.010987107641994953,
0.003840718185529113,
0.05930043011903763,
-0.014808141626417637,
-0.025705387815833092,
-0.011048749089241028,
-0.039191268384456635,
0.015228497795760632,
0.02432508021593094,
0.03911051154136658,
-0.03901860862970352,
0.019916119053959846,
-0.015133025124669075,
0.02117852307856083,
-0.07788356393575668,
-0.03799532353878021,
0.011671696789562702,
0.05716059356927872,
-0.04144495725631714,
-0.10031485557556152,
-0.09518816322088242,
-5.9370076042447093e-33,
-0.006294969469308853,
-0.015744609758257866,
0.03135359659790993,
0.1303640455007553,
0.025767313316464424,
-0.07076306641101837,
0.05020896717905998,
0.02974698133766651,
-0.03142085671424866,
-0.052297286689281464,
-0.00039646774530410767,
-0.053136277943849564,
0.014121458865702152,
-0.05415249615907669,
-0.005599291063845158,
0.01576433703303337,
-0.04093048721551895,
-0.06745190918445587,
0.05751751735806465,
0.03681609034538269,
0.0036462442949414253,
-0.029029838740825653,
0.015042131766676903,
0.1106196790933609,
-0.09122124314308167,
-0.03869214281439781,
-0.01900751329958439,
-0.0662088394165039,
-0.016504773870110512,
-0.06587030738592148,
0.011169850826263428,
0.0374995581805706,
0.0057950858026742935,
-0.04206588491797447,
-0.053122974932193756,
-0.03778602182865143,
0.07461770623922348,
0.06101835146546364,
0.06492799520492554,
0.04321862757205963,
0.0042226496152579784,
0.04116252809762955,
-0.054156553000211716,
-0.039002902805805206,
-0.044247135519981384,
-0.05953003466129303,
0.04033878818154335,
0.03357411175966263,
0.02130574733018875,
-0.018102169036865234,
0.062096383422613144,
0.0008812515297904611,
0.022936828434467316,
0.07490334659814835,
0.00806697178632021,
0.0038719093427062035,
-0.10483331233263016,
-0.04467145353555679,
-0.08065523952245712,
0.07586386799812317,
-0.07038946449756622,
-0.01035077590495348,
0.04308868944644928,
0.00861950684338808,
-0.014678632840514183,
0.0012858245754614472,
-0.05557570233941078,
-0.058447353541851044,
-0.06825952976942062,
0.014257057569921017,
-0.009694301523268223,
-0.018461178988218307,
0.04955218732357025,
0.07718609273433685,
0.0027893991209566593,
-0.012955926358699799,
-0.0148689029738307,
-0.008869733661413193,
0.07057876139879227,
0.0008453343762084842,
-0.009853369556367397,
0.0746951773762703,
-0.021516546607017517,
0.055034976452589035,
0.009399586357176304,
0.05077441409230232,
0.02282453328371048,
0.05387858301401138,
-0.04130662605166435,
0.06470324844121933,
-0.020934632048010826,
0.031255919486284256,
-0.08939531445503235,
-0.04952522739768028,
0.027048980817198753,
-5.722032980770564e-8,
-0.004227592144161463,
0.06670154631137848,
-0.03269745036959648,
0.015369197353720665,
0.07020295411348343,
-0.01841672882437706,
0.00912125501781702,
0.07905560731887817,
-0.03119303099811077,
-0.03143822401762009,
0.06752423942089081,
-0.07675229012966156,
-0.1275215893983841,
-0.03455989062786102,
0.08378906548023224,
-0.023819806054234505,
-0.043501537293195724,
0.0025377708952873945,
-0.039042264223098755,
-0.07670994102954865,
-0.037203554064035416,
0.07039310038089752,
-0.025240181013941765,
-0.07776996493339539,
0.011785639449954033,
-0.01139158383011818,
0.032882753759622574,
0.001722958404570818,
-0.011273150332272053,
-0.05661232769489288,
0.02637219987809658,
-0.02279137447476387,
-0.0007339862058870494,
-0.02362276241183281,
-0.027196649461984634,
0.010727586224675179,
-0.07904834300279617,
-0.026510164141654968,
-0.05888844653964043,
0.05536177009344101,
0.008501668460667133,
0.059710536152124405,
-0.05089013651013374,
-0.05367111787199974,
-0.013720589689910412,
-0.03622264415025711,
-0.036361709237098694,
0.13114558160305023,
0.03009275160729885,
-0.018885057419538498,
-0.00878828950226307,
0.04576071724295616,
0.0038138956297188997,
0.0625516027212143,
-0.016161683946847916,
0.046885013580322266,
-0.015805622562766075,
-0.06407460570335388,
0.07123344391584396,
0.027177762240171432,
0.03577340394258499,
-0.11338436603546143,
-0.10914178937673569,
-0.0009108450030907989
] | -0.018461
|
[[search-aggregations-pipeline-avg-bucket-aggregation]] === Avg Bucket Aggregation A sibling pipeline aggregation which calculates the (mean) average value of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation. [[avg-bucket-agg-syntax]] ==== Syntax An `avg\_bucket` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "avg\_bucket": { "buckets\_path": "the\_sum" } } -------------------------------------------------- // NOTCONSOLE [[avg-bucket-params]] .`avg\_bucket` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`buckets\_path` |The path to the buckets we wish to find the average for (see <> for more details) |Required | |`gap\_policy` |The policy to apply when gaps are found in the data (see <> for more details) |Optional |`skip` |`format` |format to apply to the output value of this aggregation |Optional | `null` |=== The following snippet calculates the average of the total monthly `sales`: [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "sales\_per\_month": { "date\_histogram": { "field": "date", "interval": "month" }, "aggs": { "sales": { "sum": { "field": "price" } } } }, "avg\_monthly\_sales": { "avg\_bucket": { "buckets\_path": "sales\_per\_month>sales" <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `buckets\_path` instructs this avg\_bucket aggregation that we want the (mean) average value of the `sales` aggregation in the `sales\_per\_month` date histogram. And the following may be the response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "sales": { "value": 550.0 } }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "sales": { "value": 60.0 } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "sales": { "value": 375.0 } } ] }, "avg\_monthly\_sales": { "value": 328.33333333333333 } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/avg-bucket-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.03199702128767967,
0.02087792381644249,
-0.001614158507436514,
0.07260192930698395,
-0.04795323684811592,
0.0064552780240774155,
0.005096242763102055,
0.03455648198723793,
0.047586455941200256,
-0.039086971431970596,
-0.04821236804127693,
-0.10927900671958923,
0.02815183438360691,
-0.02015809156000614,
-0.05439510941505432,
0.02777589112520218,
-0.049969762563705444,
0.01831621117889881,
-0.08800368010997772,
-0.14180848002433777,
0.021256323903799057,
0.03575846552848816,
0.014280269853770733,
-0.08906538784503937,
0.06627745926380157,
0.018330683931708336,
-0.10992796719074249,
-0.006679372396320105,
0.053429607301950455,
0.0230269618332386,
-0.03876780718564987,
-0.0036542476154863834,
0.033509884029626846,
0.05959789827466011,
0.03740885853767395,
0.029350124299526215,
-0.017328044399619102,
-0.019455408677458763,
-0.014375576749444008,
-0.026797980070114136,
0.021950742229819298,
0.051120053976774216,
-0.008413794450461864,
-0.15181586146354675,
0.011649458669126034,
-0.09150578826665878,
-0.10821878165006638,
-0.07782595604658127,
-0.030309783294796944,
0.015548793599009514,
-0.05869575962424278,
-0.044037360697984695,
-0.05025174841284752,
-0.00673375790938735,
0.03210744261741638,
0.08514963835477829,
-0.06836389750242233,
-0.04377906396985054,
0.01827908679842949,
-0.0936657264828682,
-0.056294750422239304,
-0.03282549977302551,
0.02018292061984539,
-0.0011060686083510518,
0.03800000995397568,
-0.029096640646457672,
-0.013266281224787235,
0.01855606585741043,
-0.0383201465010643,
0.11574963480234146,
-0.008188487961888313,
-0.03511234372854233,
-0.02465348318219185,
-0.0656442642211914,
0.06565932184457779,
0.0437840111553669,
0.013502240180969238,
0.029823867604136467,
0.047984328120946884,
0.026833171024918556,
-0.07023292779922485,
-0.09890361875295639,
-0.025771163403987885,
0.055575937032699585,
-0.016133220866322517,
-0.06101858615875244,
0.00043781936983577907,
-0.04404591768980026,
0.11913372576236725,
-0.062188830226659775,
-0.10776610672473907,
-0.02963477000594139,
-0.0011149724014103413,
0.012763162143528461,
0.08432766050100327,
0.04574356973171234,
-0.050037797540426254,
-0.07821579277515411,
0.08824843168258667,
0.04315861687064171,
-0.020771432667970657,
-0.006602997425943613,
0.059183698147535324,
-0.07413092255592346,
-0.009211167693138123,
0.003392535960301757,
0.007655938621610403,
0.03797304257750511,
-0.02118140459060669,
0.006377559155225754,
-0.018694274127483368,
0.018462765961885452,
0.03879685699939728,
0.013157220557332039,
0.015279245562851429,
0.012368522584438324,
0.081491619348526,
-0.044636111706495285,
0.07893981784582138,
0.029167938977479935,
0.08353132009506226,
0.015475591644644737,
0.02993737906217575,
-0.013952234759926796,
0.04780200496315956,
0.0042399088852107525,
0.002587852766737342,
-4.016912152599383e-33,
0.018442079424858093,
-0.13377276062965393,
0.06009561941027641,
-0.046967796981334686,
0.06185382232069969,
0.10206335783004761,
0.053966183215379715,
0.031155427917838097,
-0.06236559525132179,
0.03351513296365738,
-0.030039481818675995,
0.07188354432582855,
-0.11057104915380478,
-0.05863392725586891,
0.0052300565876066685,
0.031193653121590614,
0.0007029532571323216,
0.03153011202812195,
0.016734693199396133,
-0.014487382024526596,
0.07204321771860123,
-0.018666541203856468,
-0.016308961436152458,
0.05301717296242714,
-0.004893858917057514,
-0.07243983447551727,
0.014543927274644375,
-0.046442363411188126,
-0.036579471081495285,
-0.00039356169872917235,
0.04175369441509247,
0.03877614811062813,
-0.02529781125485897,
-0.05063847079873085,
-0.006777511909604073,
-0.02382882684469223,
0.007893694564700127,
0.07601126283407211,
-0.034214217215776443,
-0.011641887947916985,
0.030142126604914665,
-0.003614182583987713,
-0.01746237650513649,
-0.12809132039546967,
-0.10424009710550308,
-0.0033323648385703564,
0.021792270243167877,
-0.014490392990410328,
0.053104471415281296,
0.03324974328279495,
-0.03845393285155296,
-0.017059773206710815,
0.061172887682914734,
0.026179466396570206,
0.02478344365954399,
0.03036189079284668,
-0.011224831454455853,
0.11403615027666092,
-0.028011444956064224,
-0.034857116639614105,
-0.050986066460609436,
0.025637926533818245,
0.022918151691555977,
0.0004573889309540391,
0.00950060598552227,
0.047777846455574036,
0.031481340527534485,
0.09345336258411407,
0.030267728492617607,
0.0818268358707428,
0.02742110565304756,
0.08556511998176575,
-0.026043249294161797,
-0.014291191473603249,
0.04273553937673569,
-0.10617582499980927,
0.01875637285411358,
-0.0072814407758414745,
-0.002331783529371023,
-0.014371429570019245,
-0.0479620099067688,
0.025182845070958138,
0.017828650772571564,
0.02279718406498432,
0.0025912581477314234,
0.04762060195207596,
-0.06677600741386414,
0.007708914112299681,
-0.1321789026260376,
-0.027513179928064346,
-0.07874993234872818,
-0.010561050847172737,
-0.09964199364185333,
-0.049599338322877884,
-0.037768226116895676,
1.4170660163447006e-34,
-0.0065311770886182785,
0.058180030435323715,
0.05502345785498619,
0.06258871406316757,
0.03648789972066879,
-0.04824655503034592,
0.06525342166423798,
-0.07740529626607895,
0.08855205774307251,
0.038066934794187546,
-0.07195836305618286,
0.016299381852149963,
0.01755114272236824,
-0.07031615078449249,
0.04906634986400604,
0.04565627500414848,
-0.055735599249601364,
-0.10635395348072052,
0.06917108595371246,
-0.017681129276752472,
-0.04252449423074722,
0.02196420170366764,
0.012881744652986526,
0.08695996552705765,
-0.04266170784831047,
-0.01738334819674492,
-0.006390137132257223,
0.01647874340415001,
-0.04546738788485527,
-0.013280906714498997,
0.0052516646683216095,
-0.009842554107308388,
-0.01906774751842022,
0.01755707897245884,
-0.08594455569982529,
-0.09145648032426834,
0.04369118809700012,
-0.02543402463197708,
-0.04581635817885399,
-0.029294928535819054,
-0.002297625644132495,
-0.01612010970711708,
-0.02528529427945614,
-0.030222240835428238,
0.0698588564991951,
0.07349466532468796,
0.10034631192684174,
-0.015365338884294033,
-0.01281986478716135,
-0.11452151089906693,
0.0011659353040158749,
-0.023050321266055107,
-0.10368236154317856,
0.1442013531923294,
-0.08104194700717926,
0.018771305680274963,
-0.021403437480330467,
-0.031952664256095886,
-0.05917004495859146,
-0.018557816743850708,
0.024944141507148743,
-0.05739050358533859,
-0.03179251030087471,
0.010157518088817596,
-0.010810837149620056,
-0.02061551809310913,
-0.020633377134799957,
-0.03952536731958389,
-0.03354543447494507,
0.021629629656672478,
0.02277989313006401,
-0.0038768514059484005,
0.12195368856191635,
0.024868521839380264,
0.002266200724989176,
0.01807306706905365,
0.033307988196611404,
-0.04934997856616974,
0.09720924496650696,
-0.028164220973849297,
-0.0759015828371048,
0.03792477771639824,
0.02257131226360798,
0.05446518957614899,
-0.003638635156676173,
-0.04535491019487381,
0.08298391848802567,
0.08537009358406067,
-0.01899191178381443,
0.08195186406373978,
-0.06928176432847977,
-0.00600603548809886,
0.0019510725978761911,
-0.021566448733210564,
-0.01715385541319847,
-4.241624296241753e-8,
-0.008709407411515713,
0.012242813594639301,
-0.09286630898714066,
0.0051254755817353725,
-0.002545584924519062,
0.015040649101138115,
0.008101209998130798,
0.10757718980312347,
-0.044479843229055405,
-0.013425476849079132,
0.01970435306429863,
-0.03095131739974022,
-0.03230337053537369,
0.08353790640830994,
-0.035000190138816833,
-0.04958399757742882,
-0.04774916544556618,
0.0530170202255249,
-0.010044744238257408,
-0.05766674876213074,
-0.01513727381825447,
0.011119790375232697,
0.018543444573879242,
-0.015292116440832615,
0.016796648502349854,
-0.006787071004509926,
0.036324530839920044,
-0.01905401609838009,
0.04733995720744133,
-0.024177389219403267,
-0.05066622421145439,
0.013782215304672718,
0.030403442680835724,
-0.013856751844286919,
-0.03566993400454521,
-0.02469984069466591,
0.005281658377498388,
0.007946626283228397,
-0.014665563590824604,
0.03206508979201317,
0.05278623849153519,
0.0626680925488472,
-0.021685736253857613,
-0.0015198379987850785,
0.0039040527772158384,
0.049628861248493195,
-0.04527987167239189,
0.0535215362906456,
0.07091102004051208,
0.020591411739587784,
0.0782223641872406,
-0.047073669731616974,
-0.07517547905445099,
0.007657331880182028,
0.052435390651226044,
-0.11784490942955017,
0.07048051804304123,
-0.06228724867105484,
0.0509614460170269,
0.027697410434484482,
0.06253482401371002,
-0.05812249332666397,
-0.03693855181336403,
-0.03243362903594971
] | -0.007829
|
[[search-aggregations-pipeline-min-bucket-aggregation]] === Min Bucket Aggregation A sibling pipeline aggregation which identifies the bucket(s) with the minimum value of a specified metric in a sibling aggregation and outputs both the value and the key(s) of the bucket(s). The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation. ==== Syntax A `min\_bucket` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "min\_bucket": { "buckets\_path": "the\_sum" } } -------------------------------------------------- // NOTCONSOLE [[min-bucket-params]] .`min\_bucket` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`buckets\_path` |The path to the buckets we wish to find the minimum for (see <> for more details) |Required | |`gap\_policy` |The policy to apply when gaps are found in the data (see <> for more details)|Optional | `skip` |`format` |format to apply to the output value of this aggregation |Optional |`null` |=== The following snippet calculates the minimum of the total monthly `sales`: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } } } }, "min\_monthly\_sales": { "min\_bucket": { "buckets\_path": "sales\_per\_month>sales" <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `buckets\_path` instructs this min\_bucket aggregation that we want the minimum value of the `sales` aggregation in the `sales\_per\_month` date histogram. And the following may be the response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "sales": { "value": 550.0 } }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "sales": { "value": 60.0 } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "sales": { "value": 375.0 } } ] }, "min\_monthly\_sales": { "keys": ["2015/02/01 00:00:00"], <1> "value": 60.0 } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/] <1> `keys` is an array of strings since the minimum value may be present in multiple buckets
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/min-bucket-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.02242623269557953,
0.03702174872159958,
0.013209162279963493,
0.040066707879304886,
-0.042900584638118744,
0.018875258043408394,
-0.011077665723860264,
0.03351758420467377,
0.051154669374227524,
-0.05097068473696709,
-0.04972587153315544,
-0.11748143285512924,
0.05342189595103264,
-0.01034134067595005,
-0.017440134659409523,
0.020969798788428307,
-0.03313470259308815,
0.05326005071401596,
-0.1143793836236,
-0.158571258187294,
-0.004354368429630995,
0.014944037422537804,
-0.028015609830617905,
-0.05938682332634926,
0.022832144051790237,
-0.0065461378544569016,
-0.07139360159635544,
-0.023198271170258522,
0.05774969980120659,
0.010927171446383,
-0.005984795279800892,
0.00035180701524950564,
-0.0011626629857346416,
0.0622677356004715,
0.08064467459917068,
0.09027518332004547,
-0.019866880029439926,
-0.006814992055296898,
0.028880096971988678,
-0.01525035034865141,
0.028018107637763023,
0.03676328808069229,
-0.030240003019571304,
-0.14536809921264648,
-0.02387513965368271,
-0.06286287307739258,
-0.10179447382688522,
-0.04646025598049164,
-0.037661969661712646,
-0.035574741661548615,
-0.04247106611728668,
-0.01636389084160328,
-0.04984942451119423,
0.007371782790869474,
0.005067247431725264,
0.050131071358919144,
-0.04102194309234619,
-0.03152969107031822,
0.03535139933228493,
-0.0855378583073616,
-0.03569060564041138,
-0.08765891939401627,
0.04692363366484642,
-0.024027151986956596,
0.06265655159950256,
-0.029057735577225685,
-0.006697436794638634,
-0.015748098492622375,
-0.03804367408156395,
0.09018057584762573,
0.037330109626054764,
-0.01235943753272295,
-0.007919364608824253,
-0.035771310329437256,
0.06312405318021774,
-0.006579279899597168,
0.06958702951669693,
0.050557974725961685,
0.018312085419893265,
0.00886720884591341,
-0.086871437728405,
-0.07571309059858322,
-0.07169178873300552,
0.07139501720666885,
-0.024138683453202248,
-0.060056716203689575,
-0.05647937208414078,
-0.050419945269823074,
0.10773484408855438,
-0.0844050869345665,
-0.1156175509095192,
0.011264138855040073,
0.031047014519572258,
0.04862513393163681,
0.07914809137582779,
0.025051161646842957,
-0.01493654865771532,
-0.02491506189107895,
0.0517609603703022,
0.019858472049236298,
-0.044970639050006866,
0.001972205238416791,
0.05185595154762268,
-0.07653436809778214,
0.009466515854001045,
0.023837998509407043,
-0.03408293053507805,
0.008574782870709896,
-0.028645910322666168,
0.01470288634300232,
0.028588909655809402,
-0.01557417493313551,
0.035402365028858185,
0.009881400503218174,
-0.0008152155787684023,
0.02189333736896515,
0.07949646562337875,
-0.06441954523324966,
0.04103012755513191,
0.025644637644290924,
0.08725018054246902,
0.02023552544414997,
-0.000516947649884969,
-0.034602776169776917,
0.017474327236413956,
0.008188847452402115,
-0.020028717815876007,
-2.9541243838049287e-33,
0.01981303282082081,
-0.12477792799472809,
0.048951055854558945,
-0.061499349772930145,
0.05163487419486046,
0.07387897372245789,
0.040184780955314636,
0.003151967888697982,
-0.10786399245262146,
0.02348722517490387,
-0.04717030003666878,
0.06160816550254822,
-0.1401458978652954,
-0.09638776630163193,
-0.03201073780655861,
-0.013621090911328793,
0.021133936941623688,
0.04226843640208244,
-0.011101888492703438,
-0.010003634728491306,
0.008998274803161621,
-0.03547009453177452,
-0.026484381407499313,
0.015014780685305595,
0.002696000738069415,
-0.06917138397693634,
0.009938808158040047,
-0.0820240005850792,
-0.042503781616687775,
-0.0012368650641292334,
-0.012781993485987186,
0.010014884173870087,
-0.0014464487321674824,
-0.04513268917798996,
0.009772101417183876,
-0.0197453610599041,
0.041484929621219635,
0.07125844061374664,
-0.06304069608449936,
-0.024031085893511772,
-0.009508686140179634,
0.011480603367090225,
0.0062379175797104836,
-0.09885144978761673,
-0.06535318493843079,
0.012300210073590279,
0.07578319311141968,
0.003150839824229479,
0.03762981295585632,
0.0211466234177351,
-0.030840547755360603,
0.00870569609105587,
0.04403415322303772,
0.009313078597187996,
0.033350225538015366,
-0.0048578097485005856,
-0.007185047958046198,
0.035399191081523895,
-0.0031545418314635754,
0.0026942589320242405,
-0.04205077886581421,
0.043051499873399734,
-0.030526021495461464,
0.0640598013997078,
0.0483989454805851,
0.02811758778989315,
0.03318747505545616,
0.10768166929483414,
0.06447520107030869,
0.05655963718891144,
-0.023945370689034462,
0.07688558101654053,
0.028984103351831436,
0.0022038512397557497,
0.08894379436969757,
-0.1009434312582016,
0.09398908913135529,
-0.010412200354039669,
0.023452071473002434,
-0.037367645651102066,
-0.02800849638879299,
0.03070145472884178,
-0.008606231771409512,
0.06704667955636978,
-0.04295109957456589,
0.056949641555547714,
-0.05376746505498886,
0.04630585387349129,
-0.12508563697338104,
-0.0429089181125164,
-0.12242089211940765,
-0.01833142526447773,
-0.13336679339408875,
-0.04394599795341492,
0.0014093870995566249,
-7.910774842251635e-34,
0.02235756441950798,
0.036369673907756805,
0.07863494753837585,
0.05158652737736702,
0.057381030172109604,
-0.030497422441840172,
0.10381126403808594,
-0.08763287961483002,
0.07814230769872665,
0.06999550014734268,
-0.04779459536075592,
-0.0081774378195405,
0.02818938158452511,
-0.07264768332242966,
0.0014848526334390044,
0.05978583171963692,
-0.07581818103790283,
-0.1289007067680359,
0.07473067194223404,
-0.02084558829665184,
0.004301492590457201,
0.03407849743962288,
-0.03938404470682144,
0.10070982575416565,
-0.04161415994167328,
-0.008280589245259762,
-0.023357292637228966,
0.007283462677150965,
-0.037264127284288406,
-0.001989665674045682,
0.008087406866252422,
0.003555928822606802,
-0.04414444789290428,
-0.03024519979953766,
-0.06178179755806923,
-0.08781122416257858,
0.0033968761563301086,
0.008234848268330097,
-0.028342459350824356,
0.009161869995296001,
-0.017247043550014496,
-0.037410981953144073,
0.0035798801109194756,
-0.008663282729685307,
0.028530646115541458,
0.05112018063664436,
0.10758665949106216,
-0.004322864580899477,
-0.0392133854329586,
-0.07369860261678696,
-0.014625522308051586,
-0.036732159554958344,
-0.10601744800806046,
0.12774387001991272,
-0.028937309980392456,
-0.007428875658661127,
-0.038809407502412796,
-0.013584475964307785,
0.008286171592772007,
-0.03810405358672142,
0.022274328395724297,
-0.0560133196413517,
-0.037727098912000656,
0.03793569281697273,
-0.016595397144556046,
-0.028044549748301506,
-0.05445164814591408,
-0.04031316190958023,
-0.011628041043877602,
0.035605449229478836,
0.03383245691657066,
0.020491434261202812,
0.16108857095241547,
-0.012874847277998924,
-0.0149708716198802,
0.002626012545078993,
-0.01922307349741459,
-0.042914487421512604,
0.11128261685371399,
-0.005857439246028662,
-0.05896710231900215,
0.05818818509578705,
0.04959624260663986,
0.07353366911411285,
0.02269083447754383,
-0.015977298840880394,
0.06484267860651016,
0.08553362637758255,
0.009706813842058182,
0.08410559594631195,
-0.089693583548069,
-0.026004845276474953,
0.00774737261235714,
-0.048166461288928986,
-0.03723709657788277,
-4.336135717153411e-8,
-0.04721582680940628,
0.008663502521812916,
-0.0810411125421524,
-0.01453476119786501,
0.018922341987490654,
0.00362026016227901,
0.04042010009288788,
0.11286621540784836,
-0.03550105541944504,
0.03488539159297943,
0.022190287709236145,
0.0030800241511315107,
-0.0362369529902935,
0.08038803935050964,
-0.06304214894771576,
-0.028960460796952248,
0.014869186095893383,
0.003258833196014166,
0.01802210882306099,
-0.07595163583755493,
-0.009927093982696533,
0.005872693378478289,
0.026488738134503365,
-0.009904544800519943,
0.020349819213151932,
-0.05703207477927208,
0.0508853904902935,
0.009628784842789173,
0.06726613640785217,
-0.046523090451955795,
-0.051480188965797424,
0.009554232470691204,
0.007445320021361113,
0.016310764476656914,
-0.03301011025905609,
-0.017567573115229607,
-0.015030662529170513,
0.06082768365740776,
-0.049203164875507355,
0.0241472739726305,
0.006115274969488382,
0.044990185648202896,
-0.07004379481077194,
-0.001255467184819281,
-0.03788517415523529,
0.04419858008623123,
-0.04121459648013115,
0.07555609941482544,
0.0502038411796093,
0.02012578584253788,
0.047499775886535645,
-0.08380433917045593,
-0.034354012459516525,
0.006120546255260706,
0.01869860291481018,
-0.06874032318592072,
0.037040017545223236,
-0.04207414761185646,
0.008932912722229958,
0.01689765229821205,
0.0490923710167408,
0.016491305083036423,
-0.012815278954803944,
-0.036517392843961716
] | -0.026268
|
[[search-aggregations-pipeline-derivative-aggregation]] === Derivative Aggregation A parent pipeline aggregation which calculates the derivative of a specified metric in a parent histogram (or date\_histogram) aggregation. The specified metric must be numeric and the enclosing histogram must have `min\_doc\_count` set to `0` (default for `histogram` aggregations). ==== Syntax A `derivative` aggregation looks like this in isolation: [source,js] -------------------------------------------------- "derivative": { "buckets\_path": "the\_sum" } -------------------------------------------------- // NOTCONSOLE [[derivative-params]] .`derivative` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`buckets\_path` |The path to the buckets we wish to find the derivative for (see <> for more details) |Required | |`gap\_policy` |The policy to apply when gaps are found in the data (see <> for more details)|Optional |`skip` |`format` |format to apply to the output value of this aggregation |Optional | `null` |=== ==== First Order Derivative The following snippet calculates the derivative of the total monthly `sales`: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } }, "sales\_deriv": { "derivative": { "buckets\_path": "sales" <1> } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `buckets\_path` instructs this derivative aggregation to use the output of the `sales` aggregation for the derivative And the following may be the response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "sales": { "value": 550.0 } <1> }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "sales": { "value": 60.0 }, "sales\_deriv": { "value": -490.0 <2> } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, <3> "sales": { "value": 375.0 }, "sales\_deriv": { "value": 315.0 } } ] } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/] <1> No derivative for the first bucket since we need at least 2 data points to calculate the derivative <2> Derivative value units are implicitly defined by the `sales` aggregation and the parent histogram so in this case the units would be $/month assuming the `price` field has units of $. <3> The number of documents in the bucket are represented by the `doc\_count` ==== Second Order Derivative A second order derivative can be calculated by chaining the derivative pipeline aggregation onto the result of another derivative pipeline aggregation as in the following example which will calculate both the first and the second order derivative of the total monthly sales: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } }, "sales\_deriv": { "derivative": { "buckets\_path": "sales" } }, "sales\_2nd\_deriv": { "derivative": { "buckets\_path": "sales\_deriv" <1> } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `buckets\_path` for the second derivative points to the name of the first derivative And the following may be the response: [source,js] -------------------------------------------------- { "took": 50, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "sales": { "value": 550.0 } <1> }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "sales": { "value": 60.0 }, "sales\_deriv": { "value": -490.0 } <1> }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "sales": { "value": 375.0 }, "sales\_deriv": { "value": 315.0 }, "sales\_2nd\_deriv": { "value": 805.0 } } ] } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 50/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/] <1> No second derivative for the first two buckets since we
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/derivative-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.00028332698275335133,
-0.010969609953463078,
0.015844207257032394,
0.029832463711500168,
-0.08298061043024063,
0.027300851419568062,
-0.00037199907819740474,
0.09140502661466599,
0.049664318561553955,
-0.032040443271398544,
-0.042552050203084946,
-0.07715709507465363,
0.050694167613983154,
-0.04878849908709526,
-0.04399656504392624,
0.03567695990204811,
-0.06961049884557724,
0.017944032326340675,
-0.059016153216362,
-0.12586751580238342,
-0.030252043157815933,
0.0577135905623436,
-0.016259660944342613,
-0.07929810881614685,
0.019991854205727577,
0.01685439795255661,
-0.07692016661167145,
-0.04179779067635536,
0.027624066919088364,
0.006956423167139292,
0.035080306231975555,
0.005287542007863522,
-0.01186151709407568,
0.028458859771490097,
0.049940839409828186,
0.06108102574944496,
-0.014522738754749298,
-0.008046227507293224,
0.03553428128361702,
0.02500760555267334,
0.02415597438812256,
0.08164212852716446,
-0.037236109375953674,
-0.09213092923164368,
0.026906147599220276,
-0.10581598430871964,
-0.08629623055458069,
-0.04878813400864601,
-0.029930787160992622,
0.054675471037626266,
-0.032777585089206696,
-0.00765977380797267,
-0.04207178205251694,
-0.06353166699409485,
0.036788467317819595,
0.051858723163604736,
-0.0437929704785347,
-0.04659588262438774,
0.07753877341747284,
-0.05923622101545334,
-0.08176842331886292,
-0.07262805849313736,
0.014130140654742718,
-0.001828242209739983,
0.0614626370370388,
-0.01583114266395569,
0.042000558227300644,
0.0160142220556736,
0.016719480976462364,
0.10938992351293564,
-0.03821093961596489,
0.05053945630788803,
0.045058537274599075,
-0.028952134773135185,
0.02414243295788765,
0.003145694499835372,
0.043716322630643845,
0.05527372285723686,
0.07311595976352692,
-0.08213061839342117,
-0.0521053709089756,
-0.07281666249036789,
0.039582427591085434,
0.0467076376080513,
-0.03665022552013397,
0.016465114429593086,
-0.008134686388075352,
-0.05346091464161873,
0.10045617073774338,
-0.010706410743296146,
-0.03469284251332283,
-0.03811061382293701,
-0.08143354207277298,
0.013104813173413277,
-0.004878054838627577,
0.04725554585456848,
-0.07336394488811493,
-0.00039578357245773077,
0.07850775867700577,
0.04778324440121651,
0.0003015303809661418,
-0.02066398411989212,
-0.039521474391222,
-0.0004077095945831388,
-0.027144819498062134,
0.035309527069330215,
-0.01624610461294651,
0.05171825736761093,
-0.058862194418907166,
0.030076373368501663,
-0.010562844574451447,
-0.010765403509140015,
0.010734876617789268,
-0.06260214745998383,
-0.052964624017477036,
0.0035149247851222754,
0.09334564208984375,
-0.0644911676645279,
0.04726322367787361,
-0.021083354949951172,
0.07322972267866135,
-0.005416779778897762,
-0.00274099875241518,
-0.04638819769024849,
-0.03405630216002464,
0.005275394767522812,
0.006762898527085781,
-9.110398969689435e-34,
-0.026017969474196434,
-0.1570345014333725,
0.0034039707388728857,
-0.06790920346975327,
0.018677376210689545,
0.043195392936468124,
-0.02552199922502041,
0.049064815044403076,
-0.10463334619998932,
0.002867130795493722,
-0.05585368722677231,
0.0780712142586708,
-0.1313287317752838,
-0.07649995386600494,
-0.05174724757671356,
0.026964260265231133,
0.04325041174888611,
0.03798611834645271,
0.025518126785755157,
-0.04326724633574486,
0.009561384096741676,
-0.04986391216516495,
-0.01786305196583271,
0.08209135383367538,
-0.03027302958071232,
-0.010411374270915985,
0.04334045946598053,
0.01721836067736149,
-0.04790334776043892,
0.0076738810166716576,
-0.013634435832500458,
-0.0076707713305950165,
-0.005935973953455687,
-0.01364290714263916,
0.047785479575395584,
-0.007890370674431324,
-0.015885667875409126,
0.06514535844326019,
-0.019551169127225876,
0.012416938319802284,
0.006438122130930424,
-0.008492487482726574,
-0.03119443915784359,
-0.07708389312028885,
-0.1400548815727234,
0.04926101490855217,
0.00256745470687747,
0.0007774404948577285,
0.05416906625032425,
-0.01723659597337246,
-0.08869040757417679,
0.026516875252127647,
0.034121524542570114,
-0.044407814741134644,
0.030160244554281235,
-0.027463216334581375,
-0.01884297840297222,
0.041570037603378296,
0.050546836107969284,
0.06623226404190063,
-0.0358903743326664,
0.05464905872941017,
0.020854488015174866,
0.008403118699789047,
0.04919041693210602,
0.01731075905263424,
0.03861057385802269,
0.09841511398553848,
0.011940025724470615,
0.02036884054541588,
-0.003824006300419569,
0.08692201972007751,
0.03494725748896599,
0.025346357375383377,
0.10478147864341736,
-0.08113540709018707,
0.042340584099292755,
0.05114822834730148,
-0.025186942890286446,
-0.007323742378503084,
-0.016972579061985016,
-0.04740775749087334,
-0.011149825528264046,
0.05286600440740585,
0.02099297195672989,
0.04375320300459862,
-0.03276744484901428,
0.006396295037120581,
-0.1363903433084488,
-0.062283582985401154,
-0.10171637684106827,
-0.016111649572849274,
-0.13131797313690186,
-0.0274527445435524,
0.0183249618858099,
-3.740066335249441e-33,
-0.01787741295993328,
0.1197042465209961,
0.03339136019349098,
0.07269860804080963,
0.0022386612836271524,
-0.03188794478774071,
0.011034379713237286,
0.02101774327456951,
0.11622972786426544,
0.0478859581053257,
-0.03957691416144371,
0.0016962148947641253,
-0.008578885346651077,
-0.07936122268438339,
-0.0468842014670372,
0.050965841859579086,
-0.08673733472824097,
-0.11620578914880753,
-0.03729135915637016,
0.01209562923759222,
-0.06012563034892082,
0.09861481934785843,
-0.06671173125505447,
0.09819053113460541,
-0.0755067840218544,
-0.0002329216804355383,
-0.05412979796528816,
-0.0045469594188034534,
-0.0542500764131546,
0.06562438607215881,
0.004292579833418131,
-0.030680891126394272,
-0.043667588382959366,
0.014083405956625938,
-0.10053550451993942,
-0.04973800852894783,
0.04748372733592987,
0.028272870928049088,
-0.05451206490397453,
0.03369932994246483,
-0.00923653319478035,
0.013122504577040672,
0.025556650012731552,
-0.047366175800561905,
0.06215464696288109,
0.07462868839502335,
0.03747911378741264,
0.004729046020656824,
0.012633103877305984,
-0.041819166392087936,
-0.0459626279771328,
0.04901207610964775,
-0.053398679941892624,
0.13733208179473877,
-0.06390084326267242,
0.009989309124648571,
0.011566346511244774,
-0.06480345875024796,
-0.025857320055365562,
-0.008221914991736412,
0.012437859550118446,
-0.10824455320835114,
-0.00550245214253664,
-0.03476826101541519,
-0.05897591635584831,
-0.015310977585613728,
-0.026277584955096245,
-0.05110613629221916,
-0.012680944055318832,
0.02644805982708931,
-0.005420191679149866,
-0.03394610434770584,
0.11913096904754639,
0.0008699916652403772,
-0.01648590713739395,
-0.018641896545886993,
0.03815346956253052,
-0.05163925141096115,
0.05369029566645622,
0.034569282084703445,
0.014908681623637676,
0.03412027284502983,
0.09550560265779495,
0.086293525993824,
-0.014164328575134277,
-0.02818906307220459,
0.02572074718773365,
0.054132428020238876,
0.01945788972079754,
0.07931122183799744,
-0.020519452169537544,
-0.048177577555179596,
-0.0033102144952863455,
-0.026062102988362312,
-0.04233434051275253,
-5.22594909568852e-8,
-0.07418391853570938,
-0.03221769630908966,
-0.0599013976752758,
-0.011205604299902916,
0.0035893097519874573,
0.007839777506887913,
0.02101730927824974,
0.10775548219680786,
-0.03534241393208504,
-0.020901339128613472,
0.03278672695159912,
0.04602954909205437,
-0.09172970801591873,
0.04228338971734047,
-0.07407984882593155,
-0.0066915759816765785,
-0.008551287464797497,
0.08725956082344055,
-0.011817057617008686,
-0.06591881066560745,
-0.026851892471313477,
0.015548773109912872,
0.11668591946363449,
-0.008807569742202759,
0.04621830955147743,
-0.058974217623472214,
0.03059895895421505,
-0.05042477324604988,
0.04591059312224388,
-0.03240085393190384,
-0.029729075729846954,
0.01211545616388321,
-0.013498003594577312,
-0.006959435995668173,
-0.049751318991184235,
-0.012847039848566055,
0.0018283175304532051,
0.03754180669784546,
-0.0300771351903677,
0.07502985000610352,
-0.02782183140516281,
0.02318549156188965,
-0.05216224491596222,
0.06082907319068909,
0.00427547562867403,
0.020682035014033318,
-0.05101265385746956,
0.037341099232435226,
0.010922329500317574,
0.020207416266202927,
0.08014672249555588,
-0.05470241978764534,
-0.04361144080758095,
-0.025525972247123718,
0.025064757093787193,
-0.07836149632930756,
-0.0010917243780568242,
-0.06143878772854805,
-0.021553704515099525,
0.008570066653192043,
-0.016855452209711075,
-0.01752297952771187,
0.05440327525138855,
-0.09958488494157791
] | 0.034431
|
"2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "sales": { "value": 375.0 }, "sales\_deriv": { "value": 315.0 }, "sales\_2nd\_deriv": { "value": 805.0 } } ] } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 50/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/] <1> No second derivative for the first two buckets since we need at least 2 data points from the first derivative to calculate the second derivative ==== Units The derivative aggregation allows the units of the derivative values to be specified. This returns an extra field in the response `normalized\_value` which reports the derivative value in the desired x-axis units. In the below example we calculate the derivative of the total sales per month but ask for the derivative of the sales as in the units of sales per day: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } }, "sales\_deriv": { "derivative": { "buckets\_path": "sales", "unit": "day" <1> } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `unit` specifies what unit to use for the x-axis of the derivative calculation And the following may be the response: [source,js] -------------------------------------------------- { "took": 50, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "sales": { "value": 550.0 } <1> }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "sales": { "value": 60.0 }, "sales\_deriv": { "value": -490.0, <1> "normalized\_value": -15.806451612903226 <2> } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "sales": { "value": 375.0 }, "sales\_deriv": { "value": 315.0, "normalized\_value": 11.25 } } ] } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 50/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/] <1> `value` is reported in the original units of 'per month' <2> `normalized\_value` is reported in the desired units of 'per day'
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/derivative-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.00612736027687788,
0.05128451809287071,
0.030966633930802345,
0.006886868737637997,
-0.026924962177872658,
-0.053552642464637756,
0.019078535959124565,
0.038670215755701065,
0.10761897265911102,
0.03973349556326866,
0.025855185464024544,
-0.07149417698383331,
0.06901507824659348,
-0.04661397635936737,
0.04102853685617447,
0.0012769299792125821,
-0.08326388895511627,
-0.006957861129194498,
-0.08180025219917297,
0.00005950258127995767,
0.0018516503041610122,
0.04362610727548599,
-0.048898205161094666,
-0.03214428946375847,
-0.03983042389154434,
0.04100308567285538,
-0.07908971607685089,
0.03059028834104538,
0.00295982020907104,
-0.03865895792841911,
0.05428663268685341,
-0.07219216972589493,
-0.039877958595752716,
0.04524178430438042,
0.08461793512105942,
0.003099292516708374,
0.036429207772016525,
-0.05610883608460426,
0.0007497705519199371,
0.022631598636507988,
0.03888905793428421,
-0.029403602704405785,
-0.029385676607489586,
-0.06746799498796463,
0.07767330855131149,
-0.055820778012275696,
-0.04748053848743439,
0.029699241742491722,
0.014120925217866898,
0.01576451025903225,
-0.03935376554727554,
-0.04518216475844383,
-0.01907636597752571,
0.03448322415351868,
0.016432803124189377,
0.054027967154979706,
-0.01667030341923237,
-0.03608662262558937,
-0.01934671960771084,
-0.09002779424190521,
0.027678558602929115,
-0.16422978043556213,
0.04241408035159111,
-0.08088737726211548,
-0.04739752411842346,
-0.03912871703505516,
0.024778718128800392,
-0.04999213293194771,
0.004214397165924311,
0.0744125172495842,
-0.003815628821030259,
0.036395326256752014,
-0.01582503132522106,
0.019851988181471825,
0.025547007098793983,
-0.014862998388707638,
-0.010074108839035034,
-0.027090510353446007,
0.020278936251997948,
-0.0812489464879036,
-0.0639888271689415,
-0.11587391048669815,
-0.03479095920920372,
0.02449924312531948,
-0.054585643112659454,
-0.02187410183250904,
0.010203540325164795,
0.06039608642458916,
-0.02756589464843273,
-0.02098173461854458,
-0.05794128403067589,
0.021462757140398026,
0.03525584936141968,
-0.002939492231234908,
0.012645174749195576,
0.07251788675785065,
-0.03413296490907669,
0.03792042285203934,
0.09054604917764664,
0.06466861814260483,
0.002120137447491288,
0.009417340159416199,
-0.04692663252353668,
-0.07290875166654587,
-0.03519236668944359,
-0.000004113353497814387,
-0.07019438594579697,
0.0510505810379982,
-0.08937983214855194,
0.0056053888984024525,
-0.015504441224038601,
0.0398058220744133,
-0.020992375910282135,
0.009927479550242424,
-0.011112498119473457,
0.01562928594648838,
0.03514482453465462,
-0.06429104506969452,
-0.006891665048897266,
-0.02751874178647995,
0.13509070873260498,
-0.02034776099026203,
0.014289988204836845,
-0.004260422196239233,
-0.04389166086912155,
-0.002647863235324621,
0.020247356966137886,
-2.0496821325509676e-33,
0.000687820662278682,
-0.07258617132902145,
0.02852591499686241,
-0.10671476274728775,
0.05880197510123253,
0.04109567403793335,
0.0168683510273695,
0.09711357206106186,
-0.017178017646074295,
0.01025768369436264,
-0.1051001325249672,
-0.014147879555821419,
-0.025472307577729225,
-0.1488545686006546,
-0.00605015130713582,
-0.010599319823086262,
0.06010596454143524,
0.01670476794242859,
0.028860649093985558,
-0.01691286265850067,
0.05294908210635185,
-0.07739139348268509,
-0.03643570467829704,
0.05976556986570358,
-0.054427508264780045,
-0.009297294542193413,
-0.016428142786026,
-0.033401891589164734,
-0.006716910284012556,
-0.02103564515709877,
0.005357401445508003,
0.0010166531428694725,
-0.04748087376356125,
0.006134228315204382,
0.06435789912939072,
-0.013989398255944252,
0.034730833023786545,
0.024316946044564247,
-0.04602924734354019,
-0.003179846564307809,
-0.028667742386460304,
0.03534689545631409,
0.029979631304740906,
0.007632171735167503,
-0.11011719703674316,
0.049669865518808365,
-0.011878865770995617,
-0.012053304351866245,
0.017663655802607536,
0.012893276289105415,
-0.0629887804389,
0.04011388123035431,
0.0351155586540699,
-0.014198820106685162,
-0.05622442066669464,
-0.0077206906862556934,
-0.03307047486305237,
-0.031947605311870575,
-0.04261384904384613,
0.043584808707237244,
-0.026107285171747208,
0.04788218066096306,
0.054193638265132904,
0.017088325694203377,
0.012970076873898506,
0.02768750861287117,
0.03619876503944397,
0.04829072207212448,
-0.020363619551062584,
0.05164682865142822,
0.040046997368335724,
0.1169411838054657,
0.0453852079808712,
-0.03781385347247124,
0.043543409556150436,
-0.08840670436620712,
0.06194847449660301,
0.047975677996873856,
0.03790128976106644,
-0.01810295693576336,
-0.005913450848311186,
-0.05263901874423027,
-0.014604254625737667,
0.05507666990160942,
-0.046843260526657104,
0.07668781280517578,
-0.018138660117983818,
-0.053193725645542145,
-0.10043491423130035,
-0.12107346206903458,
-0.10747094452381134,
-0.01629626378417015,
-0.0844455435872078,
-0.090709388256073,
-0.008285540156066418,
2.1083820500804613e-34,
0.05629659816622734,
0.0065878513269126415,
0.017550824210047722,
0.07243558019399643,
0.07861872762441635,
-0.03814752772450447,
0.037154313176870346,
0.022508030757308006,
0.05034041404724121,
0.025218892842531204,
0.031389541923999786,
-0.06209102272987366,
-0.025245409458875656,
-0.06324402987957001,
-0.006135170813649893,
0.05393664911389351,
-0.0007278326083905995,
-0.14207278192043304,
0.0014052896294742823,
-0.05178196728229523,
-0.03765125200152397,
0.12014463543891907,
-0.02940027415752411,
0.0904940739274025,
-0.1032591238617897,
-0.0270681194961071,
-0.04662561044096947,
-0.0266338549554348,
-0.0766751691699028,
0.05300004780292511,
-0.0022382172755897045,
0.025815574452280998,
-0.022051669657230377,
0.04809105768799782,
-0.051870688796043396,
-0.06952797621488571,
0.0619252547621727,
0.04622418433427811,
-0.01694021001458168,
0.09826979041099548,
0.07357008010149002,
0.039662569761276245,
-0.011858607642352581,
0.02912873402237892,
0.0487121045589447,
0.06310202181339264,
0.07299334555864334,
0.08872063457965851,
-0.02845911495387554,
0.015828585252165794,
-0.016707418486475945,
0.0031545457895845175,
-0.1166108101606369,
0.1104637160897255,
-0.015562599524855614,
-0.01656395010650158,
-0.034096427261829376,
-0.0709102526307106,
-0.08447130024433136,
-0.025358589366078377,
-0.0033734471071511507,
0.04353020340204239,
-0.010273300111293793,
0.10179741680622101,
0.015215815044939518,
-0.015990998595952988,
-0.030320905148983,
-0.08958060294389725,
-0.013352946378290653,
0.011623243801295757,
-0.04809143766760826,
0.009196775034070015,
0.08977115899324417,
-0.0017176142428070307,
0.04675011336803436,
-0.017454911023378372,
-0.06865208595991135,
-0.032744985073804855,
0.05721917003393173,
0.07138125598430634,
-0.07258356362581253,
0.045305285602808,
0.06890998780727386,
0.10786544531583786,
-0.01793617010116577,
-0.015317042358219624,
0.015356682240962982,
0.0648442879319191,
0.014637011103332043,
0.017674673348665237,
-0.04465402662754059,
0.026589591056108475,
0.015157449059188366,
-0.013263718225061893,
-0.03570268675684929,
-4.8518032258471067e-8,
-0.04131960868835449,
0.00955658033490181,
-0.05445382371544838,
0.0810287594795227,
-0.012778657488524914,
0.04992295801639557,
0.007425770629197359,
0.07874259352684021,
-0.02787860482931137,
-0.0681876465678215,
0.0163920558989048,
-0.0077040777541697025,
-0.06296822428703308,
-0.03048650361597538,
-0.11776246130466461,
0.014480279758572578,
0.029915165156126022,
0.05438660830259323,
-0.020474515855312347,
-0.05683407932519913,
-0.0006685767439194024,
0.033920735120773315,
0.06472916901111603,
-0.024643421173095703,
0.06893458962440491,
0.01685861311852932,
0.040727611631155014,
-0.023149242624640465,
0.03209400549530983,
-0.045810144394636154,
-0.007377288304269314,
-0.05561602860689163,
-0.000023284090275410563,
0.00495889550074935,
0.029000073671340942,
-0.02160479687154293,
-0.007869389839470387,
0.11027826368808746,
-0.03547001630067825,
0.09444422274827957,
-0.03130058944225311,
0.034520894289016724,
-0.06406139582395554,
0.04937409982085228,
0.03593539074063301,
-0.08762086182832718,
-0.04893822222948074,
0.08781404048204422,
0.10092949122190475,
-0.025542108342051506,
0.05530204251408577,
-0.05269746854901314,
0.004931407980620861,
0.0026815275195986032,
0.0012651289580389857,
-0.03314274549484253,
0.04977453127503395,
-0.01341604720801115,
-0.0717848390340805,
0.06344328820705414,
0.09252316504716873,
-0.041999608278274536,
-0.01765556074678898,
-0.01091831550002098
] | -0.006654
|
[[search-aggregations-pipeline-bucket-script-aggregation]] === Bucket Script Aggregation A parent pipeline aggregation which executes a script which can perform per bucket computations on specified metrics in the parent multi-bucket aggregation. The specified metric must be numeric and the script must return a numeric value. [[bucket-script-agg-syntax]] ==== Syntax A `bucket\_script` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "bucket\_script": { "buckets\_path": { "my\_var1": "the\_sum", <1> "my\_var2": "the\_value\_count" }, "script": "params.my\_var1 / params.my\_var2" } } -------------------------------------------------- // NOTCONSOLE <1> Here, `my\_var1` is the name of the variable for this buckets path to use in the script, `the\_sum` is the path to the metrics to use for that variable. [[bucket-script-params]] .`bucket\_script` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`script` |The script to run for this aggregation. The script can be inline, file or indexed. (see <> for more details) |Required | |`buckets\_path` |A map of script variables and their associated path to the buckets we wish to use for the variable (see <> for more details) |Required | |`gap\_policy` |The policy to apply when gaps are found in the data (see <> for more details)|Optional |`skip` |`format` |format to apply to the output value of this aggregation |Optional |`null` |=== The following snippet calculates the ratio percentage of t-shirt sales compared to total sales each month: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "total\_sales": { "sum": { "field": "price" } }, "t-shirts": { "filter": { "term": { "type": "t-shirt" } }, "aggs": { "sales": { "sum": { "field": "price" } } } }, "t-shirt-percentage": { "bucket\_script": { "buckets\_path": { "tShirtSales": "t-shirts>sales", "totalSales": "total\_sales" }, "script": "params.tShirtSales / params.totalSales \* 100" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] And the following may be the response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "total\_sales": { "value": 550.0 }, "t-shirts": { "doc\_count": 1, "sales": { "value": 200.0 } }, "t-shirt-percentage": { "value": 36.36363636363637 } }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "total\_sales": { "value": 60.0 }, "t-shirts": { "doc\_count": 1, "sales": { "value": 10.0 } }, "t-shirt-percentage": { "value": 16.666666666666664 } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "total\_sales": { "value": 375.0 }, "t-shirts": { "doc\_count": 1, "sales": { "value": 175.0 } }, "t-shirt-percentage": { "value": 46.666666666666664 } } ] } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/bucket-script-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.03344760462641716,
-0.035521578043699265,
0.017089396715164185,
0.04911678656935692,
-0.05741684138774872,
0.014752457849681377,
0.010628296993672848,
0.05406642705202103,
0.06530582904815674,
-0.00441684341058135,
-0.07302353531122208,
-0.09049178659915924,
0.027050059288740158,
-0.019144520163536072,
-0.003385334275662899,
0.04961560294032097,
-0.056830376386642456,
0.02798926830291748,
-0.0867287889122963,
-0.15898504853248596,
0.026616942137479782,
0.0320143848657608,
0.0009425258613191545,
-0.051676321774721146,
0.025854356586933136,
-0.009092734195291996,
-0.09518183022737503,
-0.04655424878001213,
0.026864416897296906,
0.050836559385061264,
0.010474376380443573,
-0.007972081191837788,
-0.024607094004750252,
0.03975144773721695,
0.08318887650966644,
0.10943681001663208,
-0.009591510519385338,
-0.015176084823906422,
-0.003945617005228996,
0.00021882003056816757,
0.06857312470674515,
0.046539850533008575,
-0.021007228642702103,
-0.1886204183101654,
0.02365010231733322,
-0.0692157968878746,
-0.07380636781454086,
-0.033577434718608856,
-0.04591939225792885,
0.021247848868370056,
-0.0046347868628799915,
-0.06465976685285568,
-0.030634693801403046,
-0.0013899903278797865,
0.014594698324799538,
0.0171065516769886,
-0.04103371128439903,
-0.006054183468222618,
0.001805767766200006,
-0.07961389422416687,
-0.07437428832054138,
-0.056742481887340546,
0.03745543211698532,
-0.036222588270902634,
0.03994367644190788,
0.006898957770317793,
0.007077505812048912,
0.025920238345861435,
-0.022865425795316696,
0.10231811553239822,
-0.0035417720209807158,
0.006883205845952034,
-0.02702643908560276,
-0.06260980665683746,
0.026942696422338486,
0.040703658014535904,
0.02711535058915615,
0.029032373800873756,
0.03471146523952484,
-0.04361320659518242,
-0.09171749651432037,
-0.08680057525634766,
-0.020360328257083893,
0.030374441295862198,
-0.009609309956431389,
-0.026921620592474937,
-0.0024344834964722395,
-0.049831680953502655,
0.11988811194896698,
-0.05027090758085251,
-0.10155517607927322,
-0.025182001292705536,
0.04724397882819176,
0.015079716220498085,
0.05478115379810333,
0.014224709011614323,
-0.06832220405340195,
-0.025778457522392273,
0.12159263342618942,
-0.010510768741369247,
-0.016443617641925812,
0.03642312437295914,
0.03222944587469101,
-0.07178247720003128,
0.0033881717827171087,
0.05366839841008186,
-0.0409410335123539,
0.026801442727446556,
-0.05072852224111557,
0.028176600113511086,
-0.00009322727419203147,
0.015163833275437355,
0.06531664729118347,
0.03734647482633591,
0.009149810299277306,
0.035299673676490784,
0.07797035574913025,
-0.043228890746831894,
0.04754875972867012,
0.029529994353652,
0.07047446817159653,
0.004287852440029383,
0.011815228499472141,
-0.0333271287381649,
0.027211861684918404,
0.0014936529332771897,
-0.03164827823638916,
-2.4886853752159285e-33,
-0.0151546411216259,
-0.11132700741291046,
0.06837276369333267,
-0.014816309325397015,
0.009049960412085056,
0.10294044017791748,
0.026685385033488274,
0.053866978734731674,
-0.07485251128673553,
0.037965722382068634,
-0.04610709846019745,
0.10202568024396896,
-0.1204257681965828,
-0.05374610796570778,
-0.03229856118559837,
0.03554986044764519,
0.017272619530558586,
0.021732322871685028,
0.0395539253950119,
-0.018854696303606033,
0.04254208132624626,
-0.020150674507021904,
-0.022307148203253746,
0.07593675702810287,
0.010925755836069584,
-0.06994051486253738,
0.005664909724146128,
-0.04532182589173317,
-0.06768862158060074,
0.0006864021997898817,
-0.012153916992247105,
0.009579510428011417,
-0.014796677976846695,
-0.04996335133910179,
0.0024365975987166166,
-0.03640284761786461,
-0.010419164784252644,
0.05657549574971199,
-0.008725984953343868,
0.04544224590063095,
0.0041636331006884575,
-0.02558126486837864,
-0.0006720609380863607,
-0.08308408409357071,
-0.09576541930437088,
-0.01653374917805195,
-0.015833282843232155,
-0.006189316511154175,
0.05793287977576256,
0.010705579072237015,
-0.054050520062446594,
-0.0012878486886620522,
0.0622870959341526,
-0.003096508327871561,
0.05418005585670471,
-0.025909898802638054,
-0.024256616830825806,
0.05144081637263298,
0.005505777895450592,
-0.004597033374011517,
-0.08526279032230377,
0.027961362153291702,
-0.04478440433740616,
0.02156928926706314,
0.056172944605350494,
0.0012130159884691238,
0.0625586211681366,
0.14495885372161865,
0.027504583820700645,
0.06267376989126205,
0.01923753321170807,
0.10501813143491745,
-0.01044869888573885,
0.034650225192308426,
0.06487557291984558,
-0.14035606384277344,
0.09719745069742203,
0.032173242419958115,
-0.01521398313343525,
0.01629149168729782,
-0.02347506582736969,
0.00180677673779428,
-0.005002143792808056,
0.045705873519182205,
-0.00898321345448494,
0.09308619797229767,
-0.060285214334726334,
0.029159970581531525,
-0.12641988694667816,
-0.04966851323843002,
-0.05019964277744293,
-0.03208966180682182,
-0.1003144308924675,
-0.08135935664176941,
-0.04928070306777954,
-7.619324793289673e-34,
0.013167420402169228,
0.08261764794588089,
0.03608190640807152,
0.08566536754369736,
0.049967724829912186,
-0.07810887694358826,
0.06801009923219681,
-0.0709008276462555,
0.0453619509935379,
0.0382668636739254,
-0.09506872296333313,
-0.012959538958966732,
0.025081677362322807,
-0.032755088061094284,
0.013373074121773243,
0.019528822973370552,
-0.1069217100739479,
-0.10201445966959,
0.05716433748602867,
-0.011368642561137676,
-0.026117267087101936,
0.024709273129701614,
0.02749795652925968,
0.0797264501452446,
-0.05956929922103882,
-0.024620987474918365,
-0.050174325704574585,
0.000658841454423964,
-0.03511333465576172,
0.06786313652992249,
-0.0013155294582247734,
0.014071624726057053,
-0.014770965091884136,
0.015142682008445263,
-0.057554539293050766,
-0.13028962910175323,
0.052602820098400116,
0.017465634271502495,
-0.0350625142455101,
0.01148968655616045,
-0.04094807058572769,
-0.013561740517616272,
0.020022975280880928,
-0.004482971038669348,
0.04474899545311928,
0.07112085074186325,
0.06803683191537857,
0.03821587190032005,
-0.05528945103287697,
-0.06516128033399582,
-0.03894423693418503,
-0.006435228977352381,
-0.09022330492734909,
0.1141052171587944,
-0.04345055669546127,
-0.07250984758138657,
0.002817948115989566,
-0.04959876090288162,
-0.05811082199215889,
-0.030145417898893356,
0.008020805194973946,
-0.05379028990864754,
0.024574093520641327,
0.012445461004972458,
-0.02719802036881447,
-0.0386873260140419,
-0.016518495976924896,
-0.06246474012732506,
-0.029094865545630455,
0.012269172817468643,
0.011033912189304829,
-0.059149082750082016,
0.10456287115812302,
0.03172578290104866,
-0.05703131854534149,
0.03511795401573181,
0.015015792101621628,
-0.021428603678941727,
0.10717792809009552,
0.03156960383057594,
-0.022429680451750755,
0.05058855190873146,
0.054250892251729965,
0.029509946703910828,
-0.002541910158470273,
-0.0016595881897956133,
0.049522269517183304,
0.11757398396730423,
-0.01185547560453415,
0.08429156988859177,
-0.05814015492796898,
-0.020607268437743187,
-0.011498833075165749,
-0.03946300968527794,
0.00645999051630497,
-4.228046179832745e-8,
-0.02358350344002247,
0.03402415290474892,
-0.0666925460100174,
0.01375629659742117,
-0.04089638590812683,
-0.021205095574259758,
-0.008521873503923416,
0.15445290505886078,
-0.036852966994047165,
0.00908684078603983,
0.01303778775036335,
-0.013534058816730976,
-0.012188824824988842,
0.06804159283638,
-0.058427877724170685,
-0.004699792247265577,
-0.02447781153023243,
0.020236844196915627,
-0.00522137014195323,
-0.04036128893494606,
-0.008425718173384666,
0.034094493836164474,
0.02293134294450283,
-0.012481127865612507,
0.029821626842021942,
0.0024886394385248423,
0.01714223064482212,
0.0031907560769468546,
0.001499528530985117,
-0.044271357357501984,
-0.0072301169857382774,
-0.011899474076926708,
0.006101967301219702,
0.0005625085323117673,
-0.03155681863427162,
-0.054923251271247864,
-0.012775599956512451,
0.020053308457136154,
-0.010550868697464466,
0.018146095797419548,
0.049358267337083817,
0.07797151058912277,
-0.0378461629152298,
0.02224382385611534,
0.014141839928925037,
0.013588364236056805,
-0.027544913813471794,
0.08410771936178207,
0.017152082175016403,
0.03304434195160866,
0.04103929176926613,
-0.07817383855581284,
-0.017755350098013878,
0.042138416320085526,
0.01541388500481844,
-0.0926101803779602,
0.01742975227534771,
-0.054655641317367554,
0.057555727660655975,
0.04773372784256935,
0.044526487588882446,
-0.06620992720127106,
-0.05647670105099678,
-0.0740443542599678
] | -0.007917
|
[[search-aggregations-pipeline-extended-stats-bucket-aggregation]] === Extended Stats Bucket Aggregation A sibling pipeline aggregation which calculates a variety of stats across all bucket of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation. This aggregation provides a few more statistics (sum of squares, standard deviation, etc) compared to the `stats\_bucket` aggregation. ==== Syntax A `extended\_stats\_bucket` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "extended\_stats\_bucket": { "buckets\_path": "the\_sum" } } -------------------------------------------------- // NOTCONSOLE [[extended-stats-bucket-params]] .`extended\_stats\_bucket` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`buckets\_path` |The path to the buckets we wish to calculate stats for (see <> for more details) |Required | |`gap\_policy` |The policy to apply when gaps are found in the data (see <> for more details)|Optional | `skip` |`format` |format to apply to the output value of this aggregation |Optional | `null` |`sigma` |The number of standard deviations above/below the mean to display |Optional | 2 |=== The following snippet calculates the extended stats for monthly `sales` bucket: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } } } }, "stats\_monthly\_sales": { "extended\_stats\_bucket": { "buckets\_path": "sales\_per\_month>sales" <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `bucket\_paths` instructs this `extended\_stats\_bucket` aggregation that we want the calculate stats for the `sales` aggregation in the `sales\_per\_month` date histogram. And the following may be the response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "sales": { "value": 550.0 } }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "sales": { "value": 60.0 } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "sales": { "value": 375.0 } } ] }, "stats\_monthly\_sales": { "count": 3, "min": 60.0, "max": 550.0, "avg": 328.3333333333333, "sum": 985.0, "sum\_of\_squares": 446725.0, "variance": 41105.55555555556, "std\_deviation": 202.74505063146563, "std\_deviation\_bounds": { "upper": 733.8234345962646, "lower": -77.15676792959795 } } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/extended-stats-bucket-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.053297009319067,
0.009912515990436077,
0.01588437706232071,
0.08579737693071365,
-0.0213130172342062,
0.0062345280312001705,
-0.047844961285591125,
0.04250887781381607,
0.08787775784730911,
-0.02505330927670002,
-0.04138031601905823,
-0.05698210000991821,
0.02638421393930912,
-0.03891997039318085,
0.017914846539497375,
0.02333872579038143,
-0.0065977806225419044,
0.0361206978559494,
-0.0910099521279335,
-0.1304212510585785,
0.013439762406051159,
0.0005405753618106246,
0.01496423501521349,
-0.0710952952504158,
0.08917435258626938,
-0.005076408386230469,
-0.11330974102020264,
-0.01409658882766962,
0.060337133705616,
0.02927013859152794,
-0.012015536427497864,
0.024516059085726738,
0.026249242946505547,
0.028609544038772583,
0.010973271913826466,
0.045248277485370636,
-0.007007145322859287,
-0.01945941522717476,
0.025120513513684273,
-0.0021036944817751646,
0.04811624810099602,
0.06263647973537445,
0.006144453771412373,
-0.14606329798698425,
-0.021837454289197922,
-0.08252724260091782,
-0.11119905859231949,
-0.0791328176856041,
-0.04178817197680473,
0.029672110453248024,
-0.04582756385207176,
-0.04182163253426552,
-0.05054103583097458,
0.012576707638800144,
0.04177999868988991,
0.04604014381766319,
-0.08148489892482758,
-0.019467975944280624,
0.017765916883945465,
-0.05790262296795845,
-0.025707898661494255,
-0.047950830310583115,
0.039044950157403946,
0.01155608706176281,
0.044898223131895065,
-0.026384301483631134,
-0.05082017183303833,
0.03380750119686127,
-0.03096914105117321,
0.05822316184639931,
0.0032156999222934246,
-0.0018812749767675996,
-0.014546179212629795,
-0.03217839449644089,
0.07372363656759262,
0.011671743355691433,
-0.025865131989121437,
0.04243805259466171,
0.04020253196358681,
-0.02014089561998844,
-0.09045594930648804,
-0.0948113203048706,
-0.01701793633401394,
0.06474930047988892,
0.03293536975979805,
0.011844017542898655,
-0.022570570930838585,
-0.07383917272090912,
0.05391652137041092,
-0.09856130927801132,
-0.08784723281860352,
-0.052255112677812576,
0.02943689003586769,
0.06068522855639458,
0.01774057187139988,
0.03059827722609043,
-0.0564025342464447,
-0.03974108025431633,
0.11807197332382202,
0.004830271936953068,
-0.025996573269367218,
0.022422533482313156,
0.048893608152866364,
-0.05465494096279144,
-0.036550067365169525,
0.0058128684759140015,
-0.00863027386367321,
0.059157319366931915,
-0.033908769488334656,
0.004666211549192667,
0.030363641679286957,
-0.005169040989130735,
0.009085043333470821,
0.028699738904833794,
-0.0039569116197526455,
-0.007653925567865372,
0.00828195083886385,
-0.04850349575281143,
0.046846356242895126,
0.03513103723526001,
0.110303595662117,
0.02363758347928524,
0.022683335468173027,
-0.019047101959586143,
0.023375188931822777,
0.033695392310619354,
-0.04877215251326561,
-1.802524159715012e-33,
0.024140959605574608,
-0.11360392719507217,
0.048840079456567764,
-0.023702623322606087,
0.06241849064826965,
0.08843124657869339,
0.006292189005762339,
0.026915105059742928,
-0.08793090283870697,
0.04621083661913872,
-0.03419432416558266,
0.134237140417099,
-0.1173543632030487,
-0.06329244375228882,
-0.008230431005358696,
0.05859088525176048,
0.020632442086935043,
0.04695121571421623,
0.008719151839613914,
0.0035356441512703896,
0.0641288235783577,
-0.005178002640604973,
-0.002979147480800748,
0.06421061605215073,
0.02705753967165947,
-0.02083664759993553,
-0.003437782870605588,
-0.018573341891169548,
-0.08347902446985245,
0.017170647159218788,
0.0148469852283597,
0.010068642906844616,
-0.008470853790640831,
-0.036162298172712326,
0.01731686480343342,
-0.04244106635451317,
0.033339548856019974,
0.028986109420657158,
-0.06957115978002548,
0.0005414144834503531,
-0.008583541959524155,
-0.009834452532231808,
-0.012249132618308067,
-0.11505432426929474,
-0.09936299920082092,
0.010439092293381691,
-0.00010093803575728089,
-0.02746354416012764,
0.08203946799039841,
0.027013389393687248,
-0.07048054039478302,
0.018881194293498993,
0.0756436362862587,
0.030992766842246056,
0.022582104429602623,
0.008360818959772587,
-0.03247550502419472,
0.05498354136943817,
-0.036066558212041855,
0.029489632695913315,
-0.055585019290447235,
0.0583033412694931,
-0.007615346927195787,
0.0039473166689276695,
0.04068441316485405,
0.06820163875818253,
0.013404488563537598,
0.10979986935853958,
0.051885683089494705,
0.06682031601667404,
0.031987983733415604,
0.1088198572397232,
-0.019447792321443558,
0.05420791357755661,
0.032569270581007004,
-0.1198444589972496,
0.03153285011649132,
0.0037891308311372995,
0.007753149140626192,
-0.006543876137584448,
-0.04571843892335892,
-0.04385047033429146,
-0.03317974880337715,
0.04793605953454971,
-0.024166597053408623,
0.08789559453725815,
-0.07670076191425323,
-0.014567690901458263,
-0.07707518339157104,
-0.022428369149565697,
-0.06201992556452751,
-0.032030850648880005,
-0.13629180192947388,
-0.06367726624011993,
-0.08906964957714081,
-2.8151576253217102e-33,
-0.014510024338960648,
0.08628406375646591,
0.03119565173983574,
0.04427309334278107,
0.023700665682554245,
-0.03348338603973389,
0.03434661030769348,
-0.07560958713293076,
0.10409649461507797,
0.023409605026245117,
-0.055253658443689346,
0.030734624713659286,
0.004569819662719965,
-0.0734490379691124,
0.03348269686102867,
0.03936458006501198,
-0.08052876591682434,
-0.1371767669916153,
0.008223912678658962,
-0.024795949459075928,
-0.033765461295843124,
0.011461549438536167,
0.03165196254849434,
0.07420867681503296,
-0.038781240582466125,
-0.013126303441822529,
-0.03964082524180412,
-0.017289509996771812,
-0.015920504927635193,
0.01622682996094227,
0.001080657821148634,
-0.007125028874725103,
-0.06343892216682434,
-0.03768198937177658,
-0.09508443623781204,
-0.11165766417980194,
0.008807923644781113,
-0.016213051974773407,
0.0054205963388085365,
-0.050868526101112366,
-0.014626843854784966,
-0.06307323276996613,
0.010899289511144161,
-0.036493271589279175,
0.0525963269174099,
0.08880101144313812,
0.08014950156211853,
0.019047046080231667,
0.011821971274912357,
-0.10874725133180618,
0.016234034672379494,
0.004127600695937872,
-0.08481619507074356,
0.14948228001594543,
-0.05883200466632843,
-0.019364576786756516,
-0.018507027998566628,
-0.012220114469528198,
-0.09210359305143356,
-0.03761841356754303,
0.025205615907907486,
-0.03592431917786598,
-0.056661538779735565,
0.028436707332730293,
-0.04148178920149803,
-0.043803825974464417,
-0.04941287636756897,
-0.07797922939062119,
0.013669218868017197,
0.00021558710432145745,
-0.0075902631506323814,
-0.04338259622454643,
0.12145005166530609,
0.019189288839697838,
-0.023142389953136444,
0.019076425582170486,
-0.008381688967347145,
-0.08155462145805359,
0.10061631351709366,
0.0030161584727466106,
-0.08702738583087921,
0.024826906621456146,
0.05026303604245186,
0.020723283290863037,
0.059216611087322235,
-0.04265054687857628,
0.029364578425884247,
0.08679867535829544,
0.0026762583293020725,
0.03639793395996094,
-0.05192451924085617,
-0.0137753551825881,
-0.06788945198059082,
-0.03431982547044754,
-0.003737983526661992,
-4.8339998670599016e-8,
-0.03510712832212448,
0.03815886378288269,
-0.09821466356515884,
-0.021220408380031586,
0.0008589692297391593,
0.013457674533128738,
0.03461519628763199,
0.139797642827034,
-0.047709137201309204,
0.027570340782403946,
0.01652553305029869,
0.014391345903277397,
-0.05273006483912468,
0.048929836601018906,
-0.0679217204451561,
-0.02268989197909832,
-0.00958954356610775,
0.05875710770487785,
0.0017365342937409878,
-0.06111708655953407,
-0.030864987522363663,
-0.013474911451339722,
0.02524242363870144,
-0.023061547428369522,
-0.018302535638213158,
-0.003618416842073202,
-0.027835389599204063,
-0.01529172994196415,
0.03487085923552513,
-0.049769144505262375,
-0.006133178249001503,
0.011883220635354519,
0.014794129878282547,
0.008112002164125443,
0.014321462251245975,
-0.01976720057427883,
-0.018262609839439392,
0.024161597713828087,
-0.01756463013589382,
0.03204351291060448,
0.05228574946522713,
0.03873496875166893,
-0.02208876796066761,
0.07769857347011566,
0.0015300828963518143,
0.024954399093985558,
-0.04520279914140701,
0.056612107902765274,
0.04072480648756027,
0.006056970916688442,
0.0650033950805664,
-0.1030527800321579,
-0.05859498307108879,
-0.00013628858141601086,
0.01838480494916439,
-0.058917004615068436,
0.019279370084404945,
-0.06741828471422195,
0.015014510601758957,
0.03769644349813461,
0.06286948919296265,
-0.04777569696307182,
-0.015506056137382984,
-0.03877865895628929
] | 0.023529
|
[[search-aggregations-pipeline-max-bucket-aggregation]] === Max Bucket Aggregation A sibling pipeline aggregation which identifies the bucket(s) with the maximum value of a specified metric in a sibling aggregation and outputs both the value and the key(s) of the bucket(s). The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation. ==== Syntax A `max\_bucket` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "max\_bucket": { "buckets\_path": "the\_sum" } } -------------------------------------------------- // NOTCONSOLE [[max-bucket-params]] .`max\_bucket` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`buckets\_path` |The path to the buckets we wish to find the maximum for (see <> for more details) |Required | |`gap\_policy` |The policy to apply when gaps are found in the data (see <> for more details)|Optional | `skip` |`format` |format to apply to the output value of this aggregation |Optional |`null` |=== The following snippet calculates the maximum of the total monthly `sales`: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } } } }, "max\_monthly\_sales": { "max\_bucket": { "buckets\_path": "sales\_per\_month>sales" <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `buckets\_path` instructs this max\_bucket aggregation that we want the maximum value of the `sales` aggregation in the `sales\_per\_month` date histogram. And the following may be the response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "sales": { "value": 550.0 } }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "sales": { "value": 60.0 } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "sales": { "value": 375.0 } } ] }, "max\_monthly\_sales": { "keys": ["2015/01/01 00:00:00"], <1> "value": 550.0 } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/] <1> `keys` is an array of strings since the maximum value may be present in multiple buckets
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/max-bucket-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.02225194312632084,
0.00007558362995041534,
0.0011087738675996661,
0.0006377063691616058,
-0.057063743472099304,
-0.015618626028299332,
-0.024580247700214386,
0.031076351180672646,
0.02397257648408413,
-0.03334059566259384,
-0.07221479713916779,
-0.062227487564086914,
0.040676549077034,
0.0014276426518335938,
-0.019068695604801178,
0.031547028571367264,
-0.017392994835972786,
0.04383249208331108,
-0.1312144249677658,
-0.16049516201019287,
0.01286185160279274,
0.005424031522125006,
-0.01583688147366047,
-0.05034515634179115,
0.022461282089352608,
0.026125745847821236,
-0.09597420692443848,
-0.04468129202723503,
0.053013723343610764,
-0.0041646938771009445,
-0.02172129414975643,
-0.020387044176459312,
0.0043703350238502026,
0.06958440691232681,
0.07278712838888168,
0.0698150247335434,
-0.047674521803855896,
-0.040315400809049606,
0.029645385220646858,
-0.02482490986585617,
0.02925846539437771,
0.03884012997150421,
-0.012884753756225109,
-0.15197297930717468,
0.011105667799711227,
-0.04810967668890953,
-0.11406872421503067,
-0.058034203946590424,
-0.006775232031941414,
0.022990409284830093,
-0.05942246690392494,
-0.024788666516542435,
-0.010100488550961018,
0.027085287496447563,
0.027865344658493996,
0.03916317597031593,
-0.050525348633527756,
-0.011154650710523129,
0.040761854499578476,
-0.09039582312107086,
-0.04639502242207527,
-0.031489674001932144,
0.048688583076000214,
-0.007704087533056736,
0.04983789101243019,
-0.026866929605603218,
-0.024419477209448814,
0.0030678072944283485,
-0.028167864307761192,
0.1146254688501358,
0.038519639521837234,
-0.026987504214048386,
0.003523280844092369,
-0.06407012790441513,
0.08697546273469925,
0.019735967740416527,
0.027527613565325737,
0.048634789884090424,
0.02994415909051895,
0.0004064289678353816,
-0.08335398882627487,
-0.07812854647636414,
-0.009524326771497726,
0.032153259962797165,
-0.022732680663466454,
-0.03679286688566208,
-0.08544612675905228,
-0.03876497969031334,
0.1333799660205841,
-0.06410003453493118,
-0.126859650015831,
-0.013613253831863403,
0.02610406093299389,
0.052059367299079895,
0.05486857146024704,
0.03956142067909241,
-0.062089599668979645,
-0.03633294254541397,
0.07008077204227448,
0.009175142273306847,
-0.05140630528330803,
-0.006138692144304514,
0.04576175659894943,
-0.0853852704167366,
-0.006045937538146973,
-0.009733825922012329,
-0.05438375100493431,
0.021316053345799446,
-0.023454058915376663,
0.008808200247585773,
0.0216376893222332,
-0.003771483898162842,
0.06038219481706619,
0.007773151621222496,
0.011693389154970646,
0.009665274061262608,
0.06205232813954353,
-0.01200837455689907,
0.04577849060297012,
0.015339148230850697,
0.11316034197807312,
0.004465868230909109,
-0.023346368223428726,
-0.004673050716519356,
0.006563416216522455,
0.021283134818077087,
0.007434309460222721,
-2.8354268213497328e-33,
0.006033694837242365,
-0.12136924266815186,
0.08738910406827927,
-0.048409972339868546,
0.03792935237288475,
0.06843028962612152,
0.03437450900673866,
0.05094105750322342,
-0.10708579421043396,
0.04188288003206253,
-0.056339431554079056,
0.08070523291826248,
-0.13590048253536224,
-0.06314811110496521,
-0.0324728861451149,
0.004770772997289896,
0.009340700693428516,
0.05305106192827225,
-0.026630310341715813,
-0.017292413860559464,
0.04920700937509537,
-0.04484530910849571,
-0.03847424313426018,
0.025718869641423225,
0.006483153440058231,
-0.056315261870622635,
0.02310844324529171,
-0.03284129127860069,
-0.06381446868181229,
0.00560354208573699,
-0.004076835699379444,
0.00274327932856977,
-0.006052551791071892,
-0.03480205684900284,
-0.000014535253285430372,
-0.01767251454293728,
0.016627507284283638,
0.07272364944219589,
-0.06204434111714363,
0.00024769274750724435,
-0.00004741263546748087,
-0.015519434586167336,
0.008404070511460304,
-0.08243438601493835,
-0.06512778997421265,
0.022538399323821068,
0.029271334409713745,
-0.010596639476716518,
0.03221771866083145,
0.024196956306695938,
-0.051468703895807266,
-0.02136797085404396,
0.051833562552928925,
0.010940033942461014,
0.026440469548106194,
-0.007103292271494865,
-0.0006969943060539663,
0.0739498883485794,
-0.003619147464632988,
0.017782535403966904,
-0.05077533796429634,
0.016313955187797546,
-0.028385136276483536,
0.07905540615320206,
0.030278364196419716,
0.04038688540458679,
0.018102720379829407,
0.13054831326007843,
0.06977294385433197,
0.06477715820074081,
-0.00008711681584827602,
0.08833467215299606,
0.030845267698168755,
-0.004569783341139555,
0.042685579508543015,
-0.1430743783712387,
0.07274816185235977,
0.027387673035264015,
0.02323256805539131,
-0.01762690395116806,
-0.05428605154156685,
0.03272175043821335,
0.02474876120686531,
0.04288552701473236,
-0.033610016107559204,
0.0755101889371872,
-0.09562468528747559,
0.027175797149538994,
-0.11555816233158112,
-0.02367008477449417,
-0.08642197400331497,
-0.014351562596857548,
-0.0937856063246727,
-0.06695297360420227,
-0.012468098662793636,
-6.972229387663908e-34,
0.046771131455898285,
0.03957825154066086,
0.050100769847631454,
0.02239840291440487,
0.04023439437150955,
-0.05568131431937218,
0.054081499576568604,
-0.05947784706950188,
0.05550513416528702,
0.03942345455288887,
-0.022684182971715927,
-0.008135128766298294,
0.06011499837040901,
-0.06115813925862312,
-0.006453067064285278,
0.017801418900489807,
-0.08093255758285522,
-0.11636488139629364,
0.0574302040040493,
-0.031221238896250725,
-0.029829295352101326,
0.024076275527477264,
-0.02653341181576252,
0.1177520900964737,
-0.03657490760087967,
-0.009737145155668259,
-0.03507887199521065,
0.011254933662712574,
0.002211255021393299,
0.012232727371156216,
0.01957733929157257,
0.011520867235958576,
-0.04944652318954468,
0.010896783322095871,
-0.062175773084163666,
-0.09373622387647629,
0.02743729203939438,
0.005811326205730438,
-0.00675127562135458,
0.003887545084580779,
-0.0034665162675082684,
-0.047271132469177246,
-0.003174887038767338,
-0.005994381383061409,
0.07644228637218475,
0.03395028039813042,
0.09899792820215225,
-0.0022745218593627214,
0.002083093160763383,
-0.07823345810174942,
-0.008574537001550198,
-0.05236034467816353,
-0.0761181190609932,
0.1336016058921814,
-0.027752649039030075,
-0.03273900970816612,
-0.044440463185310364,
-0.025694014504551888,
-0.011251671239733696,
-0.08622566610574722,
0.031243786215782166,
-0.02790108136832714,
-0.02829536609351635,
0.08904717117547989,
-0.024447230622172356,
-0.03337790071964264,
-0.07416146993637085,
-0.04582922160625458,
-0.0036494217347353697,
0.04374866560101509,
0.009395928122103214,
0.006050784606486559,
0.14228138327598572,
0.017849549651145935,
-0.03656117618083954,
0.016420552507042885,
-0.020467054098844528,
-0.06094159930944443,
0.09774172306060791,
-0.011302134953439236,
-0.07774616777896881,
0.06674426794052124,
0.0724862813949585,
0.09663337469100952,
0.02314511127769947,
-0.023450620472431183,
0.02766835317015648,
0.10157684981822968,
0.018104271963238716,
0.05371880531311035,
-0.0742034912109375,
-0.061765946447849274,
-0.022309113293886185,
-0.05874829366803169,
-0.014884136617183685,
-4.291056399097215e-8,
-0.050959162414073944,
0.04050992429256439,
-0.12255703657865524,
-0.031116224825382233,
0.04599742218852043,
0.0015484265750274062,
0.06285207718610764,
0.1496484875679016,
-0.04168744385242462,
0.023219414055347443,
0.009623090736567974,
0.007270400412380695,
-0.03044116497039795,
0.05323411524295807,
-0.06494288146495819,
-0.028733430430293083,
0.015851544216275215,
0.011279318481683731,
0.01972263865172863,
-0.057564448565244675,
-0.028972717002034187,
-0.004982495680451393,
0.021119387820363045,
-0.0057522570714354515,
0.03215982764959335,
-0.029364297166466713,
0.018035121262073517,
0.025358639657497406,
0.06471751630306244,
-0.025150494650006294,
-0.0493890680372715,
-0.025675851851701736,
-0.0002133614179911092,
0.0006825985619798303,
-0.028256243094801903,
-0.02961590513586998,
-0.04104337468743324,
0.04392772167921066,
-0.031718309968709946,
0.03144783526659012,
0.006005578674376011,
0.062096089124679565,
-0.06349246203899384,
0.003619134658947587,
-0.02648051269352436,
0.04663427919149399,
-0.038972605019807816,
0.08196650445461273,
0.03255496546626091,
0.03182623162865639,
0.026233434677124023,
-0.06752299517393112,
-0.036062393337488174,
-0.009085196070373058,
0.020624617114663124,
-0.08963553607463837,
0.009308845736086369,
-0.016944777220487595,
0.005063401069492102,
0.03633818030357361,
0.07520856708288193,
-0.001415556762367487,
-0.010421098209917545,
-0.022612979635596275
] | -0.010593
|
[[search-aggregations-pipeline-movavg-aggregation]] === Moving Average Aggregation Given an ordered series of data, the Moving Average aggregation will slide a window across the data and emit the average value of that window. For example, given the data `[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]`, we can calculate a simple moving average with windows size of `5` as follows: - (1 + 2 + 3 + 4 + 5) / 5 = 3 - (2 + 3 + 4 + 5 + 6) / 5 = 4 - (3 + 4 + 5 + 6 + 7) / 5 = 5 - etc Moving averages are a simple method to smooth sequential data. Moving averages are typically applied to time-based data, such as stock prices or server metrics. The smoothing can be used to eliminate high frequency fluctuations or random noise, which allows the lower frequency trends to be more easily visualized, such as seasonality. ==== Syntax A `moving\_avg` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "moving\_avg": { "buckets\_path": "the\_sum", "model": "holt", "window": 5, "gap\_policy": "insert\_zeros", "settings": { "alpha": 0.8 } } } -------------------------------------------------- // NOTCONSOLE .`moving\_avg` Parameters |=== |Parameter Name |Description |Required |Default Value |`buckets\_path` |Path to the metric of interest (see <> for more details |Required | |`model` |The moving average weighting model that we wish to use |Optional |`simple` |`gap\_policy` |Determines what should happen when a gap in the data is encountered. |Optional |`insert\_zeros` |`window` |The size of window to "slide" across the histogram. |Optional |`5` |`minimize` |If the model should be algorithmically minimized. See <> for more details |Optional |`false` for most models |`settings` |Model-specific settings, contents which differ depending on the model specified. |Optional | |=== `moving\_avg` aggregations must be embedded inside of a `histogram` or `date\_histogram` aggregation. They can be embedded like any other metric aggregation: [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo":{ <1> "date\_histogram":{ "field":"date", "interval":"1M" }, "aggs":{ "the\_sum":{ "sum":{ "field": "price" } <2> }, "the\_movavg":{ "moving\_avg":{ "buckets\_path": "the\_sum" } <3> } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> A `date\_histogram` named "my\_date\_histo" is constructed on the "timestamp" field, with one-day intervals <2> A `sum` metric is used to calculate the sum of a field. This could be any metric (sum, min, max, etc) <3> Finally, we specify a `moving\_avg` aggregation which uses "the\_sum" metric as its input. Moving averages are built by first specifying a `histogram` or `date\_histogram` over a field. You can then optionally add normal metrics, such as a `sum`, inside of that histogram. Finally, the `moving\_avg` is embedded inside the histogram. The `buckets\_path` parameter is then used to "point" at one of the sibling metrics inside of the histogram (see <> for a description of the syntax for `buckets\_path`. An example response from the above aggregation may look like: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "my\_date\_histo": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "the\_sum": { "value": 550.0 } }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "the\_sum": { "value": 60.0 }, "the\_movavg": { "value": 550.0 } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "the\_sum": { "value": 375.0 }, "the\_movavg": { "value": 305.0 } } ] } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/] ==== Models The `moving\_avg` aggregation includes four different moving average "models". The main difference is how the values in the window are weighted. As data-points become "older" in the window, they may be weighted differently. This will affect the final average for that window. Models are
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/movavg-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.11824077367782593,
-0.03448761627078056,
0.04149448871612549,
0.060558125376701355,
-0.027205219492316246,
-0.05719291418790817,
-0.020560117438435555,
-0.00995323434472084,
0.07399606704711914,
-0.06176304817199707,
-0.06281323730945587,
0.021476421505212784,
0.032398562878370285,
-0.03274107351899147,
-0.08553127199411392,
0.010274160653352737,
-0.09720396995544434,
0.027018457651138306,
-0.015071754343807697,
-0.07808379828929901,
0.03260483220219612,
-0.010148230940103531,
-0.03919075429439545,
-0.08547870814800262,
0.08535546064376831,
0.05961928144097328,
-0.09947537630796432,
0.04442437365651131,
0.10120667517185211,
-0.023978598415851593,
-0.02629668638110161,
0.07965373992919922,
0.04001879319548607,
0.04439307376742363,
-0.08441263437271118,
0.001018776441924274,
-0.009521763771772385,
0.07819406688213348,
-0.025947343558073044,
0.04497835412621498,
-0.0016719648847356439,
0.0335221067070961,
-0.0061812810599803925,
-0.06266221404075623,
-0.018402494490146637,
-0.040156908333301544,
-0.06561634689569473,
-0.07065392285585403,
-0.09367185831069946,
0.04663872718811035,
-0.0861300677061081,
-0.0004403132770676166,
-0.08944807201623917,
0.04123273864388466,
0.0005732345744036138,
0.04392567649483681,
-0.04580628126859665,
-0.03431521728634834,
0.0738421380519867,
-0.06250301003456116,
-0.02382364496588707,
0.010583803057670593,
0.01502592209726572,
0.03624832630157471,
0.05577000603079796,
-0.04508911818265915,
0.05576770752668381,
0.048769716173410416,
0.006436248309910297,
0.06305576860904694,
-0.06333544850349426,
0.006524683907628059,
-0.015007228590548038,
-0.0421818383038044,
-0.027386555448174477,
-0.0012844044249504805,
0.016456477344036102,
0.016373762860894203,
0.07191815227270126,
0.014141609892249107,
0.005291495472192764,
-0.10785214602947235,
-0.06880976259708405,
0.025086382403969765,
-0.022404318675398827,
0.0019295152742415667,
0.024778950959444046,
-0.01206266414374113,
0.0784408450126648,
-0.022608788684010506,
-0.029553920030593872,
0.002617111662402749,
-0.03346797078847885,
0.010067430324852467,
0.06248670816421509,
0.06256519258022308,
-0.019900334998965263,
-0.030018750578165054,
0.14277946949005127,
0.05285424739122391,
0.03231789916753769,
0.03397827222943306,
0.044003307819366455,
0.00862361304461956,
-0.012774372473359108,
-0.07835953682661057,
0.04780181124806404,
0.07080546021461487,
-0.08307167887687683,
-0.011930225417017937,
-0.02572459541261196,
0.07771740108728409,
0.014500467106699944,
-0.025601420551538467,
0.001255695358850062,
0.03434756025671959,
0.03837605565786362,
0.007887876592576504,
-0.03921140730381012,
-0.0035547905135899782,
0.04478682950139046,
-0.014950919896364212,
-0.02033010497689247,
0.015054960735142231,
0.006214287597686052,
0.0699569582939148,
0.07061253488063812,
5.4365746798447066e-33,
0.006058906204998493,
-0.097645103931427,
0.05346396192908287,
-0.06160285323858261,
0.05586083605885506,
0.036286164075136185,
0.019373277202248573,
-0.005436733830720186,
-0.056215062737464905,
0.09642510861158371,
-0.020951563492417336,
0.10662449151277542,
-0.04034551978111267,
0.006815706379711628,
0.001135729718953371,
-0.08453182876110077,
0.022105464711785316,
0.00591025548055768,
0.007036833092570305,
-0.05263989418745041,
0.044768426567316055,
-0.02472575008869171,
0.047720544040203094,
0.009735140018165112,
0.0445871502161026,
0.018245158717036247,
0.0006052210228517652,
0.004179330077022314,
-0.013895902782678604,
-0.008902598172426224,
0.018069328740239143,
0.06057123467326164,
-0.0900716781616211,
-0.05277493968605995,
0.03986313194036484,
-0.007196963299065828,
0.01779436133801937,
-0.04130358621478081,
0.059079479426145554,
-0.028150826692581177,
0.026781361550092697,
-0.016100609675049782,
-0.06423906981945038,
-0.0740891546010971,
-0.09312190860509872,
0.0012575052678585052,
-0.013314811512827873,
0.031536296010017395,
-0.00464193569496274,
0.11390369385480881,
-0.02556329406797886,
0.023091083392500877,
-0.019156375899910927,
-0.06425057351589203,
-0.012284058146178722,
0.0368373729288578,
0.059958554804325104,
0.07583428919315338,
-0.04861260950565338,
0.060581024736166,
-0.08152230829000473,
-0.029255755245685577,
0.03378574177622795,
-0.011842049658298492,
-0.01708235964179039,
-0.011883723549544811,
-0.027158565819263458,
0.08728090673685074,
0.037773486226797104,
0.07047560065984726,
0.08692261576652527,
0.08938925713300705,
-0.031149376183748245,
-0.005023482255637646,
0.10055480897426605,
-0.09994340687990189,
0.029480401426553726,
0.0036193733103573322,
-0.06498976051807404,
-0.044926829636096954,
-0.014199456200003624,
0.004519355949014425,
0.06552303582429886,
-0.05788836628198624,
0.02250153385102749,
0.03253648057579994,
-0.04797251150012016,
0.02439577504992485,
-0.0824001133441925,
-0.07183822989463806,
-0.04902268573641777,
0.006880817469209433,
-0.023644844070076942,
0.042335402220487595,
-0.044018182903528214,
-6.37081865162789e-33,
0.024337897077202797,
0.03613771125674248,
0.05232256278395653,
0.08439653366804123,
0.0258015226572752,
0.025093402713537216,
0.03413563221693039,
-0.010144730098545551,
0.06410250067710876,
-0.05630451813340187,
-0.10619788616895676,
0.06800150871276855,
0.02113214135169983,
-0.020387275144457817,
0.03710560128092766,
-0.0034154329914599657,
0.022699568420648575,
-0.11952303349971771,
0.03527839854359627,
-0.009207119233906269,
-0.006494171917438507,
0.015473629347980022,
-0.05035541579127312,
0.05936453118920326,
-0.007451682351529598,
0.004849644377827644,
-0.008740457706153393,
0.009929937310516834,
-0.06371266394853592,
-0.006116783246397972,
0.00909438543021679,
-0.07318752259016037,
-0.001147590228356421,
-0.03904537484049797,
-0.04167018085718155,
-0.05544228106737137,
0.08184612542390823,
0.0019232311751693487,
-0.04106845334172249,
0.02040078490972519,
-0.016132541000843048,
0.03333507850766182,
0.03103059157729149,
-0.07734057307243347,
0.07554090768098831,
0.13678044080734253,
-0.0018582036718726158,
0.046607643365859985,
-0.02695845626294613,
-0.0512247160077095,
0.00786750391125679,
0.07559692114591599,
-0.11098609864711761,
0.08258618414402008,
-0.03581296280026436,
0.06098860874772072,
-0.04051196947693825,
-0.030090229585766792,
-0.0508698895573616,
-0.024181712418794632,
-0.0017723736818879843,
-0.05716704577207565,
-0.038053613156080246,
-0.07560823112726212,
-0.01120841596275568,
0.06180630996823311,
0.024087879806756973,
-0.1606350839138031,
-0.037285882979631424,
-0.07190138846635818,
0.027492869645357132,
-0.06055612117052078,
0.015655765309929848,
0.025933070108294487,
0.010296673513948917,
-0.11662008613348007,
0.054947011172771454,
-0.04710344970226288,
0.03574893996119499,
0.031132163479924202,
-0.08546708524227142,
0.048794809728860855,
0.06323578953742981,
0.009889164939522743,
-0.12137624621391296,
0.022477054968476295,
0.02146637625992298,
0.005564345512539148,
0.004797591362148523,
0.03840155526995659,
-0.06369706988334656,
0.003980250563472509,
-0.02427348867058754,
-0.03399350121617317,
-0.010461309924721718,
-5.7737715053463035e-8,
-0.009290878660976887,
-0.03932653367519379,
-0.029796797782182693,
0.03767804801464081,
0.033866945654153824,
-0.01104023028165102,
0.033201899379491806,
0.0501461923122406,
0.036831069737672806,
-0.07357913255691528,
0.12056645005941391,
-0.0006737097282893956,
-0.01456382405012846,
0.0427737683057785,
0.020659398287534714,
0.04612716659903526,
-0.009159649722278118,
-0.015066531486809254,
-0.023372696712613106,
-0.05461331456899643,
-0.01903662271797657,
0.03559599071741104,
0.011393524706363678,
0.05870255082845688,
0.05379345640540123,
0.017125798389315605,
-0.009284007363021374,
0.05840165913105011,
0.05269249156117439,
-0.06538550555706024,
-0.027339497581124306,
0.05478997156023979,
0.0625985711812973,
0.010298699140548706,
-0.05173366516828537,
0.041869521141052246,
0.001886834274046123,
0.0041856346651911736,
-0.020234553143382072,
-0.0018757147481665015,
0.01666766032576561,
0.008965446613729,
0.01696767657995224,
-0.042539309710264206,
-0.050424717366695404,
0.04402428865432739,
-0.06892619282007217,
-0.06664540618658066,
0.0711231455206871,
-0.0018350310856476426,
0.12949176132678986,
-0.06425639986991882,
-0.03613399714231491,
0.055158063769340515,
0.043703220784664154,
-0.08711545914411545,
0.019808156415820122,
-0.1250196099281311,
0.06029145419597626,
-0.01426609605550766,
-0.040920455008745193,
-0.040957994759082794,
-0.046360500156879425,
-0.04030584916472435
] | 0.053806
|
// TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/] ==== Models The `moving\_avg` aggregation includes four different moving average "models". The main difference is how the values in the window are weighted. As data-points become "older" in the window, they may be weighted differently. This will affect the final average for that window. Models are specified using the `model` parameter. Some models may have optional configurations which are specified inside the `settings` parameter. ===== Simple The `simple` model calculates the sum of all values in the window, then divides by the size of the window. It is effectively a simple arithmetic mean of the window. The simple model does not perform any time-dependent weighting, which means the values from a `simple` moving average tend to "lag" behind the real data. [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo":{ "date\_histogram":{ "field":"date", "interval":"1M" }, "aggs":{ "the\_sum":{ "sum":{ "field": "price" } }, "the\_movavg":{ "moving\_avg":{ "buckets\_path": "the\_sum", "window" : 30, "model" : "simple" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] A `simple` model has no special settings to configure The window size can change the behavior of the moving average. For example, a small window (`"window": 10`) will closely track the data and only smooth out small scale fluctuations: [[movavg\_10window]] .Moving average with window of size 10 image::images/pipeline\_movavg/movavg\_10window.png[] In contrast, a `simple` moving average with larger window (`"window": 100`) will smooth out all higher-frequency fluctuations, leaving only low-frequency, long term trends. It also tends to "lag" behind the actual data by a substantial amount: [[movavg\_100window]] .Moving average with window of size 100 image::images/pipeline\_movavg/movavg\_100window.png[] ==== Linear The `linear` model assigns a linear weighting to points in the series, such that "older" datapoints (e.g. those at the beginning of the window) contribute a linearly less amount to the total average. The linear weighting helps reduce the "lag" behind the data's mean, since older points have less influence. [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo":{ "date\_histogram":{ "field":"date", "interval":"1M" }, "aggs":{ "the\_sum":{ "sum":{ "field": "price" } }, "the\_movavg": { "moving\_avg":{ "buckets\_path": "the\_sum", "window" : 30, "model" : "linear" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] A `linear` model has no special settings to configure Like the `simple` model, window size can change the behavior of the moving average. For example, a small window (`"window": 10`) will closely track the data and only smooth out small scale fluctuations: [[linear\_10window]] .Linear moving average with window of size 10 image::images/pipeline\_movavg/linear\_10window.png[] In contrast, a `linear` moving average with larger window (`"window": 100`) will smooth out all higher-frequency fluctuations, leaving only low-frequency, long term trends. It also tends to "lag" behind the actual data by a substantial amount, although typically less than the `simple` model: [[linear\_100window]] .Linear moving average with window of size 100 image::images/pipeline\_movavg/linear\_100window.png[] ==== EWMA (Exponentially Weighted) The `ewma` model (aka "single-exponential") is similar to the `linear` model, except older data-points become exponentially less important, rather than linearly less important. The speed at which the importance decays can be controlled with an `alpha` setting. Small values make the weight decay slowly, which provides greater smoothing and takes into account a larger portion of the window. Larger valuers make the weight decay quickly, which reduces the impact of older values on the moving average. This tends to make the moving average track the data more closely but with less smoothing. The default value of `alpha` is `0.3`, and the setting accepts any float from 0-1 inclusive. The EWMA model can be <> [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo":{ "date\_histogram":{ "field":"date", "interval":"1M" }, "aggs":{ "the\_sum":{ "sum":{ "field": "price" } }, "the\_movavg":
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/movavg-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.04384949803352356,
-0.04304927587509155,
-0.017078373581171036,
0.14488188922405243,
0.047585658729076385,
-0.027491291984915733,
-0.049515560269355774,
0.04453390836715698,
0.14825351536273956,
-0.03567032888531685,
-0.0334273986518383,
0.04001720994710922,
-0.007696376647800207,
-0.08391056954860687,
-0.07613857090473175,
-0.09001541137695312,
-0.014990702271461487,
-0.04990893229842186,
-0.11041625589132309,
-0.06354168057441711,
0.005305109545588493,
-0.0766187533736229,
-0.008563635870814323,
-0.04015648737549782,
0.054481931030750275,
0.032932426780462265,
-0.13591694831848145,
0.06631655246019363,
0.09363546222448349,
-0.033895328640937805,
-0.051047131419181824,
0.0032260341104120016,
0.010711198672652245,
-0.00804989319294691,
-0.07348303496837616,
-0.028510715812444687,
0.06949472427368164,
-0.026817481964826584,
-0.014746993780136108,
-0.03629771247506142,
0.026428494602441788,
0.041917864233255386,
-0.026867909356951714,
-0.07270173728466034,
0.03785810247063637,
-0.031230634078383446,
-0.049807146191596985,
-0.0158389825373888,
-0.09163370728492737,
-0.031409282237291336,
-0.0853722020983696,
-0.010062259621918201,
-0.04435673728585243,
0.020454857498407364,
-0.04567209631204605,
0.051545560359954834,
-0.06260697543621063,
-0.017603296786546707,
0.009196585975587368,
-0.012979520484805107,
-0.06408977508544922,
-0.025733163580298424,
0.04054132476449013,
0.039488647133111954,
0.0073679774068295956,
-0.04577994346618652,
-0.015573220327496529,
0.0396733433008194,
-0.02285684272646904,
0.023113861680030823,
-0.05407973378896713,
-0.01985936611890793,
-0.010140402242541313,
-0.05715040862560272,
0.06251933425664902,
-0.04506056383252144,
-0.0928187221288681,
-0.024539412930607796,
0.028574170544743538,
0.044021010398864746,
0.03013485111296177,
-0.12269796431064606,
-0.08366965502500534,
-0.021298307925462723,
-0.011983638629317284,
0.0209546759724617,
0.08421944826841354,
0.010013104416429996,
0.02847389131784439,
-0.0075966729782521725,
-0.014255051501095295,
0.05566906929016113,
-0.03681217506527901,
0.08623528480529785,
0.05468550696969032,
0.05106629431247711,
-0.023854726925492287,
-0.009293858893215656,
0.06137396767735481,
0.062933549284935,
0.013282877393066883,
0.056303720921278,
0.12309384346008301,
0.028453800827264786,
0.0022040249314159155,
-0.05764272063970566,
0.010971983894705772,
0.07601694762706757,
-0.02291508950293064,
0.010945353657007217,
0.0246612336486578,
0.09286267310380936,
-0.0002882036496885121,
0.0055985236540436745,
0.02050083875656128,
-0.056670185178518295,
0.014995411969721317,
-0.03198382258415222,
-0.01373450830578804,
-0.010372450575232506,
0.10530439019203186,
-0.0076823048293590546,
0.018196964636445045,
-0.03696787729859352,
0.11202693730592728,
0.017165888100862503,
0.02980336919426918,
3.0629454059903174e-33,
0.0016865618526935577,
-0.08658808469772339,
0.03186245262622833,
-0.05268939211964607,
0.05746040120720863,
0.023646198213100433,
-0.016339002177119255,
0.07563554495573044,
0.030994415283203125,
0.03544072434306145,
-0.031045936048030853,
0.038309454917907715,
-0.02050221525132656,
-0.03815310075879097,
0.05731610581278801,
0.011803457513451576,
-0.006581898313015699,
0.04206189140677452,
0.0025406035128980875,
0.0019483959767967463,
0.06824272125959396,
-0.041127704083919525,
-0.02016509510576725,
0.053632643073797226,
0.02410959266126156,
0.014068244956433773,
-0.02064366266131401,
0.034910231828689575,
-0.15885120630264282,
-0.012387359514832497,
-0.013173932209610939,
0.08065813779830933,
-0.10426105558872223,
-0.048914872109889984,
0.030205896124243736,
0.004644378088414669,
0.010484286583960056,
-0.028984716162085533,
0.019300119951367378,
0.009402231313288212,
0.006840248592197895,
0.013399341143667698,
-0.04492073878645897,
-0.07249245047569275,
-0.08210733532905579,
-0.01774238608777523,
-0.03722485154867172,
0.06355269253253937,
-0.008036717772483826,
0.08640611916780472,
-0.05807311460375786,
0.004009635653346777,
0.025332631543278694,
0.024041322991251945,
-0.03187626600265503,
0.07368995994329453,
0.012215728871524334,
0.044268153607845306,
-0.06099855899810791,
0.03933587670326233,
-0.028194600716233253,
-0.05880456045269966,
0.002534976927563548,
-0.0028165620751678944,
0.03012760542333126,
0.06758376210927963,
-0.06509082019329071,
0.01427517831325531,
0.005381750408560038,
0.11758853495121002,
0.08008932322263718,
0.07272803783416748,
-0.040794312953948975,
0.0602216012775898,
0.0781954899430275,
-0.09771014750003815,
-0.040188126266002655,
0.056719571352005005,
0.008230376057326794,
0.020915435627102852,
0.07651081681251526,
0.018506823107600212,
-0.012234464287757874,
-0.09196805953979492,
0.0005251105176284909,
0.041400425136089325,
0.0015793007332831621,
-0.016485722735524178,
-0.124630406498909,
-0.09630125015974045,
0.032929837703704834,
0.033088840544223785,
-0.0319206602871418,
-0.030431216582655907,
-0.06074955686926842,
-6.110031189136134e-33,
-0.008889264427125454,
0.027058761566877365,
-0.022827913984656334,
0.08957545459270477,
0.021784190088510513,
0.03972949460148811,
0.004649641457945108,
0.05437959358096123,
0.06264056265354156,
-0.024591168388724327,
-0.031455762684345245,
-0.032657451927661896,
-0.03632855787873268,
0.020723190158605576,
0.05108274891972542,
0.021864712238311768,
0.029473133385181427,
-0.20975752174854279,
0.0309703778475523,
-0.031132575124502182,
0.006839229259639978,
0.008496738038957119,
0.022223083302378654,
0.04504981264472008,
-0.020125873386859894,
-0.06609613448381424,
-0.011499308049678802,
0.00895504280924797,
-0.0676431730389595,
-0.04182961955666542,
0.028526749461889267,
-0.029458368197083473,
-0.026224469766020775,
0.012759659439325333,
-0.049311455339193344,
-0.00543711893260479,
0.042926300317049026,
-0.05827414616942406,
-0.023370925337076187,
0.0366646945476532,
0.030976898968219757,
0.01704946905374527,
-0.0007268025656230748,
-0.018466169014573097,
0.05764657258987427,
0.13435539603233337,
-0.00977674312889576,
-0.015923606231808662,
-0.03491711989045143,
-0.13119034469127655,
0.03405394405126572,
0.003522010985761881,
-0.06031351909041405,
0.08527927845716476,
0.005319396033883095,
-0.02271808683872223,
-0.02966216579079628,
-0.02790766954421997,
-0.10537450760602951,
-0.020452195778489113,
0.03317146375775337,
-0.01628117822110653,
-0.06478093564510345,
-0.02207958698272705,
-0.04962191730737686,
0.008343441411852837,
0.02913614548742771,
-0.15201471745967865,
0.03910508379340172,
-0.011844891123473644,
0.025073055177927017,
-0.02265911176800728,
0.05557858943939209,
0.028990816324949265,
-0.027993397787213326,
-0.02141667902469635,
0.05455205217003822,
-0.04204031452536583,
-0.017389029264450073,
-0.015246485359966755,
-0.07938326150178909,
-0.02036239393055439,
0.049580350518226624,
0.020183535292744637,
-0.10255981236696243,
0.009357926435768604,
0.039011649787425995,
0.02711915597319603,
-0.05113387852907181,
0.0633777529001236,
-0.0512910932302475,
0.07156970351934433,
-0.006685147061944008,
0.006751154083758593,
0.002756547648459673,
-6.057364743128346e-8,
-0.041090354323387146,
-0.000932395807467401,
-0.05994635447859764,
0.04048047959804535,
-0.07005093991756439,
0.028728662058711052,
0.042161036282777786,
0.00885558407753706,
-0.02395164780318737,
-0.059556685388088226,
0.043113064020872116,
-0.02826588600873947,
0.03590374439954758,
0.05221559479832649,
-0.02059939131140709,
0.0006992151029407978,
-0.047749437391757965,
0.009672645479440689,
-0.0034606498666107655,
-0.0450921393930912,
-0.001497803837992251,
0.02061089687049389,
0.0462765246629715,
-0.028551191091537476,
0.055480148643255234,
0.035741932690143585,
-0.022185886278748512,
0.062668576836586,
-0.029488656669855118,
-0.06762471050024033,
-0.0026965069118887186,
0.011299850419163704,
0.04924884811043739,
0.06244178116321564,
-0.0070896935649216175,
0.012975804507732391,
0.02640424482524395,
0.03642156720161438,
-0.046232592314481735,
0.03113708831369877,
0.03213231638073921,
-0.021888667717576027,
-0.04113839194178581,
-0.012735041789710522,
0.011368351988494396,
0.039680592715740204,
-0.06159428134560585,
-0.028705278411507607,
0.08180154114961624,
-0.1021045669913292,
0.12800493836402893,
-0.035035695880651474,
-0.09554143995046616,
-0.018418991938233376,
0.024450095370411873,
-0.045517560094594955,
0.03191075101494789,
-0.041546501219272614,
0.04191988334059715,
-0.02081516571342945,
0.03276583552360535,
0.0014781063655391335,
-0.08117852360010147,
0.03783990070223808
] | 0.039193
|
more closely but with less smoothing. The default value of `alpha` is `0.3`, and the setting accepts any float from 0-1 inclusive. The EWMA model can be <> [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo":{ "date\_histogram":{ "field":"date", "interval":"1M" }, "aggs":{ "the\_sum":{ "sum":{ "field": "price" } }, "the\_movavg": { "moving\_avg":{ "buckets\_path": "the\_sum", "window" : 30, "model" : "ewma", "settings" : { "alpha" : 0.5 } } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] [[single\_0.2alpha]] .EWMA with window of size 10, alpha = 0.2 image::images/pipeline\_movavg/single\_0.2alpha.png[] [[single\_0.7alpha]] .EWMA with window of size 10, alpha = 0.7 image::images/pipeline\_movavg/single\_0.7alpha.png[] ==== Holt-Linear The `holt` model (aka "double exponential") incorporates a second exponential term which tracks the data's trend. Single exponential does not perform well when the data has an underlying linear trend. The double exponential model calculates two values internally: a "level" and a "trend". The level calculation is similar to `ewma`, and is an exponentially weighted view of the data. The difference is that the previously smoothed value is used instead of the raw value, which allows it to stay close to the original series. The trend calculation looks at the difference between the current and last value (e.g. the slope, or trend, of the smoothed data). The trend value is also exponentially weighted. Values are produced by multiplying the level and trend components. The default value of `alpha` is `0.3` and `beta` is `0.1`. The settings accept any float from 0-1 inclusive. The Holt-Linear model can be <> [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo":{ "date\_histogram":{ "field":"date", "interval":"1M" }, "aggs":{ "the\_sum":{ "sum":{ "field": "price" } }, "the\_movavg": { "moving\_avg":{ "buckets\_path": "the\_sum", "window" : 30, "model" : "holt", "settings" : { "alpha" : 0.5, "beta" : 0.5 } } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] In practice, the `alpha` value behaves very similarly in `holt` as `ewma`: small values produce more smoothing and more lag, while larger values produce closer tracking and less lag. The value of `beta` is often difficult to see. Small values emphasize long-term trends (such as a constant linear trend in the whole series), while larger values emphasize short-term trends. This will become more apparently when you are predicting values. [[double\_0.2beta]] .Holt-Linear moving average with window of size 100, alpha = 0.5, beta = 0.2 image::images/pipeline\_movavg/double\_0.2beta.png[] [[double\_0.7beta]] .Holt-Linear moving average with window of size 100, alpha = 0.5, beta = 0.7 image::images/pipeline\_movavg/double\_0.7beta.png[] ==== Holt-Winters The `holt\_winters` model (aka "triple exponential") incorporates a third exponential term which tracks the seasonal aspect of your data. This aggregation therefore smooths based on three components: "level", "trend" and "seasonality". The level and trend calculation is identical to `holt` The seasonal calculation looks at the difference between the current point, and the point one period earlier. Holt-Winters requires a little more handholding than the other moving averages. You need to specify the "periodicity" of your data: e.g. if your data has cyclic trends every 7 days, you would set `period: 7`. Similarly if there was a monthly trend, you would set it to `30`. There is currently no periodicity detection, although that is planned for future enhancements. There are two varieties of Holt-Winters: additive and multiplicative. ===== "Cold Start" Unfortunately, due to the nature of Holt-Winters, it requires two periods of data to "bootstrap" the algorithm. This means that your `window` must always be \*at least\* twice the size of your period. An exception will be thrown if it isn't. It also means that Holt-Winters will not emit a value for the first `2 \* period` buckets; the current algorithm does not backcast.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/movavg-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.005837812554091215,
0.08468439429998398,
0.005872356705367565,
0.10546079277992249,
-0.0014907526783645153,
0.022301146760582924,
-0.012307915836572647,
0.0032934597693383694,
-0.011146670207381248,
-0.003774539101868868,
-0.02448691986501217,
-0.07748118042945862,
-0.02343636006116867,
-0.01210104115307331,
-0.010899579152464867,
0.024195358157157898,
-0.06834166496992111,
-0.02748812735080719,
-0.06720700114965439,
-0.08141601830720901,
0.010926679708063602,
-0.012526401318609715,
0.026820149272680283,
-0.07459057122468948,
0.027556220069527626,
0.02501552924513817,
-0.03836145997047424,
0.023582089692354202,
0.037727709859609604,
-0.015159902162849903,
-0.04917638748884201,
-0.04804094508290291,
0.05568000301718712,
0.08319409936666489,
-0.031999796628952026,
-0.030450738966464996,
0.000452253851108253,
-0.004038641694933176,
-0.021053189411759377,
0.04812163487076759,
0.04048069566488266,
0.035946570336818695,
-0.03195762634277344,
-0.07468932121992111,
-0.013776992447674274,
-0.0457877516746521,
-0.03452149033546448,
-0.030419325456023216,
-0.006200018804520369,
0.09569233655929565,
-0.04782472550868988,
-0.06991514563560486,
-0.048918094485998154,
-0.019229920580983162,
0.0007034849841147661,
0.06400664150714874,
-0.04964926093816757,
-0.036428555846214294,
0.013221560046076775,
-0.07869435101747513,
-0.03720488026738167,
-0.05628935620188713,
-0.044248875230550766,
0.002549001481384039,
0.04314206913113594,
-0.045627664774656296,
-0.00445741368457675,
-0.004782180301845074,
-0.031187962740659714,
0.04265643283724785,
0.02000342682003975,
0.0018063278403133154,
0.004300703760236502,
-0.03639627993106842,
-0.003772107418626547,
0.013281590305268764,
0.04244299232959747,
0.025633957237005234,
0.09138511121273041,
0.02646210603415966,
-0.021613191813230515,
-0.10800424218177795,
-0.04199666529893875,
-0.00980650819838047,
0.0002936545934062451,
-0.04541338235139847,
-0.04704214259982109,
-0.06331635266542435,
0.11916603893041611,
-0.027849549427628517,
-0.0501263327896595,
-0.09372512996196747,
-0.090603306889534,
0.058898210525512695,
0.010455443523824215,
0.10879480838775635,
0.018086275085806847,
-0.011313731782138348,
0.05574283003807068,
0.06280672550201416,
0.07987932115793228,
0.020089086145162582,
0.023084623739123344,
0.01696033403277397,
0.03880402445793152,
-0.009047557599842548,
0.026720721274614334,
0.10519781708717346,
-0.09031765162944794,
0.04540471360087395,
-0.005320776253938675,
0.00985427014529705,
-0.007347017992287874,
-0.07831774652004242,
-0.010174519382417202,
0.09453488886356354,
0.04097556322813034,
-0.013778911903500557,
-0.0416695699095726,
0.005310198292136192,
0.05277193337678909,
0.01842014491558075,
-0.0012894318206235766,
0.007182789966464043,
0.007845926098525524,
-0.003044399432837963,
-0.030163096264004707,
-2.315416222207777e-33,
0.06352636963129044,
-0.07149108499288559,
0.0002631185343489051,
-0.07790037989616394,
0.05786954611539841,
0.1088133454322815,
-0.014885754324495792,
0.03678257018327713,
-0.020697686821222305,
0.008247792720794678,
-0.03569163382053375,
0.1212121918797493,
-0.09061925858259201,
-0.050626467913389206,
-0.002606622176244855,
-0.04329501837491989,
-0.02499578520655632,
0.04135524481534958,
0.00046992418356239796,
-0.014915245585143566,
0.023297322914004326,
-0.07631624490022659,
-0.04823916032910347,
-0.018387287855148315,
0.010418334975838661,
0.01801915280520916,
-0.003295297734439373,
0.012526962906122208,
-0.07969386130571365,
0.018869733437895775,
0.006805649027228355,
0.06098753958940506,
-0.03980378061532974,
-0.039449118077754974,
0.027186688035726547,
-0.0025963352527469397,
-0.09904588758945465,
0.059932466596364975,
0.026990670710802078,
-0.000874363468028605,
0.05249685421586037,
0.013243499211966991,
-0.026985781267285347,
-0.12158921360969543,
-0.0944305807352066,
0.019381167367100716,
0.03038625232875347,
-0.01730065606534481,
-0.00709503423422575,
0.008866571821272373,
-0.043163422495126724,
0.0422767698764801,
-0.06542805582284927,
-0.03757210820913315,
0.02990797534584999,
-0.001232873764820397,
0.07405468821525574,
0.05910148844122887,
0.015993166714906693,
-0.07216590642929077,
-0.05170312896370888,
0.07741611450910568,
0.10224606841802597,
-0.02298334613442421,
-0.006305852439254522,
0.06308142095804214,
0.05095801502466202,
0.07737860828638077,
-0.029427973553538322,
0.05577181279659271,
0.06985189020633698,
0.0877903550863266,
0.00977540947496891,
-0.004904082976281643,
0.02983548678457737,
-0.1088378056883812,
0.06193463131785393,
0.027616458013653755,
-0.011229665949940681,
0.0095595084130764,
-0.005321821663528681,
-0.013746670447289944,
0.018075264990329742,
0.0007913298322819173,
-0.004285146482288837,
-0.00435170391574502,
-0.028480766341090202,
0.04471383988857269,
-0.0770132914185524,
-0.08759582787752151,
-0.03773852065205574,
0.059397801756858826,
-0.054430246353149414,
-0.0584314726293087,
-0.041500065475702286,
8.824115585741321e-34,
0.028551757335662842,
-0.0018105357885360718,
0.049833811819553375,
0.09965243190526962,
0.002170038176700473,
-0.01993320882320404,
0.09765887260437012,
0.09845118224620819,
0.11627094447612762,
0.0738726332783699,
-0.022552035748958588,
-0.004457483533769846,
-0.018542611971497536,
-0.0835481807589531,
0.02037813328206539,
-0.0009128731326200068,
-0.03764309361577034,
-0.0780787467956543,
0.009171805344522,
-0.025526138022542,
-0.039417099207639694,
0.05154182389378548,
-0.05907246097922325,
0.13252240419387817,
-0.003551372094079852,
-0.05997524783015251,
0.0004675084201153368,
0.013244972564280033,
-0.10875548422336578,
-0.04029539227485657,
-0.030726304277777672,
-0.05531984940171242,
-0.03318344056606293,
-0.04481480270624161,
-0.0790528878569603,
-0.03708592429757118,
0.06383474916219711,
0.06752774119377136,
-0.021855428814888,
0.0731956958770752,
-0.006865557748824358,
0.04581519961357117,
-0.055879510939121246,
-0.01564275100827217,
0.020435651764273643,
0.0907500833272934,
0.07365115731954575,
0.016216691583395004,
0.005694032181054354,
-0.03498752787709236,
0.010108019225299358,
0.008341431617736816,
-0.09050891548395157,
0.12694455683231354,
-0.020842313766479492,
0.02799927070736885,
-0.04790402203798294,
-0.07649178057909012,
-0.10295091569423676,
0.01505080796778202,
-0.021757399663329124,
-0.04950582981109619,
-0.06068265810608864,
-0.013032977469265461,
0.00586335826665163,
-0.044819172471761703,
0.008372653275728226,
-0.06157245859503746,
0.01880597323179245,
-0.018856899812817574,
-0.0027141193859279156,
-0.08334518224000931,
0.09210629016160965,
0.013629049062728882,
0.006866376847028732,
-0.01634148322045803,
0.11920464783906937,
0.006521923467516899,
0.11703411489725113,
-0.03242563083767891,
-0.06212027370929718,
0.0518055260181427,
0.055260468274354935,
0.11290505528450012,
0.006539122201502323,
0.01657509244978428,
-0.06381222605705261,
0.05069871246814728,
-0.06785564124584198,
0.10137161612510681,
-0.07432908564805984,
0.006673908792436123,
-0.0013979558134451509,
0.028661014512181282,
-0.00781219033524394,
-5.480865183926653e-8,
-0.0895296260714531,
0.0081167072057724,
0.00012041798618156463,
0.05155685916543007,
0.033884670585393906,
0.006698000244796276,
0.07109899818897247,
0.05532030016183853,
0.035561129450798035,
-0.03711940348148346,
0.07409977167844772,
0.042193055152893066,
-0.04831330478191376,
0.057527150958776474,
-0.031151099130511284,
-0.061600830405950546,
-0.01481088437139988,
0.04137548804283142,
-0.023707853630185127,
-0.01769237220287323,
0.03191537410020828,
0.005708028562366962,
0.06566060334444046,
0.03538331016898155,
0.09669319540262222,
0.008832764811813831,
-0.031179938465356827,
0.09333037585020065,
0.03859442099928856,
-0.011726181954145432,
-0.09175951778888702,
-0.002595840487629175,
0.03608781099319458,
0.024677284061908722,
-0.07824455946683884,
-0.04313316568732262,
0.030612971633672714,
0.016396252438426018,
-0.1001923456788063,
0.07015106081962585,
0.04354485124349594,
0.01646173931658268,
-0.016105065122246742,
-0.004803450778126717,
0.00720099126920104,
0.06030187010765076,
0.04027478024363518,
-0.030346011742949486,
0.04682615026831627,
-0.022944170981645584,
0.03859854117035866,
-0.01969035714864731,
0.005770736373960972,
-0.0033481887076050043,
0.0074574900791049,
-0.07771609723567963,
0.03192802518606186,
-0.022808393463492393,
-0.016418112441897392,
0.041116852313280106,
0.037787433713674545,
-0.10491955280303955,
-0.0984937846660614,
0.010898963548243046
] | 0.017625
|
"bootstrap" the algorithm. This means that your `window` must always be \*at least\* twice the size of your period. An exception will be thrown if it isn't. It also means that Holt-Winters will not emit a value for the first `2 \* period` buckets; the current algorithm does not backcast. [[holt\_winters\_cold\_start]] .Holt-Winters showing a "cold" start where no values are emitted image::images/pipeline\_movavg/triple\_untruncated.png[] Because the "cold start" obscures what the moving average looks like, the rest of the Holt-Winters images are truncated to not show the "cold start". Just be aware this will always be present at the beginning of your moving averages! ===== Additive Holt-Winters Additive seasonality is the default; it can also be specified by setting `"type": "add"`. This variety is preferred when the seasonal affect is additive to your data. E.g. you could simply subtract the seasonal effect to "de-seasonalize" your data into a flat trend. The default values of `alpha` and `gamma` are `0.3` while `beta` is `0.1`. The settings accept any float from 0-1 inclusive. The default value of `period` is `1`. The additive Holt-Winters model can be <> [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo":{ "date\_histogram":{ "field":"date", "interval":"1M" }, "aggs":{ "the\_sum":{ "sum":{ "field": "price" } }, "the\_movavg": { "moving\_avg":{ "buckets\_path": "the\_sum", "window" : 30, "model" : "holt\_winters", "settings" : { "type" : "add", "alpha" : 0.5, "beta" : 0.5, "gamma" : 0.5, "period" : 7 } } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] [[holt\_winters\_add]] .Holt-Winters moving average with window of size 120, alpha = 0.5, beta = 0.7, gamma = 0.3, period = 30 image::images/pipeline\_movavg/triple.png[] ===== Multiplicative Holt-Winters Multiplicative is specified by setting `"type": "mult"`. This variety is preferred when the seasonal affect is multiplied against your data. E.g. if the seasonal affect is x5 the data, rather than simply adding to it. The default values of `alpha` and `gamma` are `0.3` while `beta` is `0.1`. The settings accept any float from 0-1 inclusive. The default value of `period` is `1`. The multiplicative Holt-Winters model can be <> [WARNING] ====== Multiplicative Holt-Winters works by dividing each data point by the seasonal value. This is problematic if any of your data is zero, or if there are gaps in the data (since this results in a divid-by-zero). To combat this, the `mult` Holt-Winters pads all values by a very small amount (1\*10^-10^) so that all values are non-zero. This affects the result, but only minimally. If your data is non-zero, or you prefer to see `NaN` when zero's are encountered, you can disable this behavior with `pad: false` ====== [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo":{ "date\_histogram":{ "field":"date", "interval":"1M" }, "aggs":{ "the\_sum":{ "sum":{ "field": "price" } }, "the\_movavg": { "moving\_avg":{ "buckets\_path": "the\_sum", "window" : 30, "model" : "holt\_winters", "settings" : { "type" : "mult", "alpha" : 0.5, "beta" : 0.5, "gamma" : 0.5, "period" : 7, "pad" : true } } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] ==== Prediction experimental[] All the moving average model support a "prediction" mode, which will attempt to extrapolate into the future given the current smoothed, moving average. Depending on the model and parameter, these predictions may or may not be accurate. Predictions are enabled by adding a `predict` parameter to any moving average aggregation, specifying the number of predictions you would like appended to the end of the series. These predictions will be spaced out at the same interval as your buckets: [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo":{ "date\_histogram":{ "field":"date", "interval":"1M" }, "aggs":{ "the\_sum":{ "sum":{ "field": "price" } }, "the\_movavg": { "moving\_avg":{
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/movavg-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.060256227850914,
-0.023343883454799652,
0.0742325633764267,
0.11061999946832657,
0.05198269337415695,
-0.05015458166599274,
-0.11533152312040329,
0.003737474326044321,
-0.04346100613474846,
-0.05442861095070839,
-0.11256033927202225,
-0.001640822971239686,
0.04580426588654518,
-0.01935405656695366,
-0.07475314289331436,
-0.046678557991981506,
-0.1442990005016327,
-0.047442059963941574,
0.03655443340539932,
-0.04978647455573082,
0.01976202428340912,
0.010647820308804512,
-0.007062557619065046,
-0.030822576954960823,
0.022227425128221512,
0.06473539024591446,
-0.1148710548877716,
0.008353875018656254,
0.0781385749578476,
0.01715071313083172,
-0.04029310122132301,
0.008363645523786545,
0.009922626428306103,
-0.04273960366845131,
0.02751302905380726,
0.05399875342845917,
0.04246381297707558,
-0.006645886693149805,
-0.10090038180351257,
0.030759867280721664,
0.07327848672866821,
-0.02297521010041237,
0.020129390060901642,
-0.09111721068620682,
0.025979870930314064,
-0.056219831109046936,
-0.030216341838240623,
-0.03529319912195206,
-0.012758874334394932,
0.08124657720327377,
-0.04910657927393913,
-0.01844054087996483,
-0.0898631289601326,
0.11529989540576935,
-0.062059808522462845,
0.022508926689624786,
-0.020098814740777016,
-0.024475570768117905,
0.012445884756743908,
-0.11920466274023056,
-0.011405518278479576,
0.05029376223683357,
-0.04975156858563423,
0.0348878838121891,
0.07457070797681808,
0.029474254697561264,
-0.04616507515311241,
-0.08919597417116165,
0.022158967331051826,
0.01711304485797882,
-0.06587596237659454,
0.027813062071800232,
0.05439082160592079,
-0.012342825531959534,
-0.04372476786375046,
-0.013468812219798565,
0.03649597987532616,
0.06862316280603409,
0.08283645659685135,
-0.04090156778693199,
0.02101142890751362,
-0.12501837313175201,
-0.016006164252758026,
0.027193952351808548,
-0.03818169981241226,
-0.04425438866019249,
-0.012624702416360378,
-0.10079184174537659,
0.02669455111026764,
0.016157424077391624,
0.004495586734265089,
-0.030055826529860497,
-0.0721135213971138,
0.09923503547906876,
0.022626090794801712,
0.06679286807775497,
-0.009878287091851234,
0.06277669966220856,
0.025699432939291,
0.05254630744457245,
-0.03920480236411095,
-0.009508652612566948,
0.02533317357301712,
0.051063016057014465,
0.02576921507716179,
-0.0559874065220356,
-0.03262417018413544,
-0.060967832803726196,
-0.06474997848272324,
-0.019917143508791924,
0.033019986003637314,
0.0671011433005333,
-0.029746219515800476,
-0.010574417188763618,
0.11309852451086044,
0.01482830848544836,
-0.04530167579650879,
0.022059857845306396,
-0.0173612330108881,
0.01838812232017517,
0.0034636184573173523,
0.020248180255293846,
-0.024429021403193474,
0.0030691996216773987,
0.07619132846593857,
-0.016367970034480095,
0.011421089991927147,
2.90892331993795e-33,
0.031078051775693893,
-0.039692558348178864,
0.061766039580106735,
-0.03463139757514,
0.10789738595485687,
0.010248919017612934,
-0.012742389924824238,
-0.018007272854447365,
-0.024792158976197243,
0.08431418240070343,
-0.0385819673538208,
0.12795977294445038,
-0.04576478525996208,
0.028328008949756622,
0.008162712678313255,
-0.02492029033601284,
0.018180670216679573,
-0.03988396003842354,
0.024808332324028015,
-0.001138187013566494,
0.050784882158041,
-0.029720183461904526,
-0.017392070963978767,
-0.01873074658215046,
-0.035117775201797485,
0.03461475297808647,
0.001955778570845723,
-0.02112601324915886,
0.005472189746797085,
0.021316513419151306,
0.07398398965597153,
0.04141199588775635,
-0.007326302584260702,
-0.028962228447198868,
0.010675549507141113,
-0.10271011292934418,
-0.026462426409125328,
0.01645275019109249,
-0.023505033925175667,
0.033824384212493896,
0.050031017512083054,
-0.03754872828722,
-0.004061518236994743,
-0.07148086279630661,
-0.01204307284206152,
0.011257283389568329,
0.014833775348961353,
0.041472166776657104,
0.046236198395490646,
0.0464780330657959,
0.053956832736730576,
-0.006834479980170727,
0.003168002236634493,
-0.055531349033117294,
-0.07447604089975357,
0.004328773822635412,
0.022541560232639313,
0.04561310261487961,
-0.009997835382819176,
-0.01249634474515915,
-0.07526081055402756,
-0.04586047679185867,
0.15808571875095367,
-0.0098198764026165,
-0.03932729735970497,
-0.042068686336278915,
0.03034145012497902,
0.0957164466381073,
-0.03363507613539696,
0.07297714054584503,
0.03965442255139351,
0.025822637602686882,
0.0565219484269619,
0.05079688876867294,
0.1324327439069748,
-0.055028729140758514,
0.13645721971988678,
0.0222320556640625,
-0.023863503709435463,
0.014400539919734001,
-0.009100723080337048,
-0.030405214056372643,
0.0637085884809494,
-0.10585664957761765,
-0.007025034632533789,
-0.046963464468717575,
-0.01155591756105423,
0.04360277205705643,
-0.04272308573126793,
0.004091842565685511,
-0.03746994957327843,
0.00771667342633009,
-0.005442008841782808,
0.06413893401622772,
-0.047309208661317825,
-4.454597555894477e-33,
0.07931026816368103,
0.04062890633940697,
0.010339480824768543,
-0.03812896087765694,
-0.07045965641736984,
0.043242890387773514,
0.05574192479252815,
0.021004755049943924,
0.06165090948343277,
0.005582437850534916,
0.06432558596134186,
0.0248495452105999,
-0.06656055152416229,
-0.0013364625629037619,
-0.03750648349523544,
-0.04582589119672775,
0.051939405500888824,
-0.04159068688750267,
0.003564469050616026,
-0.0018113023834303021,
-0.007166195195168257,
0.015314687043428421,
-0.13927556574344635,
0.03427467867732048,
-0.005838469136506319,
0.041546668857336044,
0.04957844316959381,
0.06607465445995331,
-0.0782756507396698,
-0.019923416897654533,
0.018920842558145523,
-0.022114640101790428,
-0.003121539717540145,
-0.014244056306779385,
-0.036727286875247955,
0.03791557997465134,
-0.0024398211389780045,
-0.03200605884194374,
0.005749589763581753,
-0.03666037693619728,
0.10201643407344818,
-0.010828627273440361,
-0.003130535827949643,
-0.0391208678483963,
0.07652142643928528,
-0.028814299032092094,
-0.01933036372065544,
-0.03665751591324806,
0.05831471458077431,
0.04539787769317627,
0.017746321856975555,
-0.03924713656306267,
-0.08415985852479935,
0.07555409520864487,
0.012471677735447884,
0.03890448808670044,
-0.06518802791833878,
-0.0233500637114048,
-0.06613107770681381,
0.013110297732055187,
0.008383208885788918,
-0.04711846262216568,
-0.05643273517489433,
-0.1552913784980774,
0.0024809734895825386,
-0.019063040614128113,
0.014396646060049534,
-0.11373884975910187,
0.030238846316933632,
0.02319924347102642,
-0.00902094878256321,
-0.012348871678113937,
0.045127205550670624,
0.015080176293849945,
0.009941868484020233,
0.029231352731585503,
0.09182081371545792,
-0.03883131593465805,
0.014157597906887531,
-0.03781639784574509,
-0.04617023095488548,
-0.002044547349214554,
-0.040460407733917236,
0.01922115683555603,
-0.02886800654232502,
0.02416451834142208,
0.0396377295255661,
0.03278417885303497,
0.057357899844646454,
0.033422525972127914,
0.012590420432388783,
0.04514138028025627,
-0.010937178507447243,
0.026355817914009094,
0.031736183911561966,
-6.224320259207161e-8,
-0.0007678127731196582,
0.03575959429144859,
-0.03421209380030632,
0.08751630038022995,
0.046433884650468826,
-0.06361211091279984,
-0.025765469297766685,
-0.03609010577201843,
-0.05188041925430298,
-0.12252500653266907,
0.06333331763744354,
-0.021070532500743866,
-0.006652644835412502,
0.010640059597790241,
0.018583333119750023,
0.017089739441871643,
-0.05039180815219879,
-0.02885475568473339,
-0.024859968572854996,
-0.13744096457958221,
-0.09057734161615372,
-0.06333720684051514,
0.013799184933304787,
0.03993403911590576,
0.04981091991066933,
0.00007435701263602823,
0.024092108011245728,
0.009335116483271122,
0.05089395493268967,
0.004531275946646929,
-0.04436276853084564,
0.0011313155991956592,
0.03869713470339775,
-0.017608625814318657,
-0.08118816465139389,
0.022313756868243217,
0.061756931245326996,
-0.009160073474049568,
-0.036850642412900925,
-0.0051729921251535416,
0.055071309208869934,
0.01619071327149868,
0.027277501299977303,
-0.07838331162929535,
-0.0472891628742218,
0.04521679878234863,
-0.03880118206143379,
0.04285706579685211,
0.03441615030169487,
0.0675889328122139,
0.06012147665023804,
-0.0633590891957283,
0.009353244677186012,
0.06524539738893509,
0.07335839420557022,
-0.08665362745523453,
0.025795094668865204,
-0.030035512521862984,
0.05832001566886902,
0.045834898948669434,
-0.07069418579339981,
-0.09965633600950241,
-0.08738289773464203,
-0.0018405739683657885
] | -0.047044
|
number of predictions you would like appended to the end of the series. These predictions will be spaced out at the same interval as your buckets: [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo":{ "date\_histogram":{ "field":"date", "interval":"1M" }, "aggs":{ "the\_sum":{ "sum":{ "field": "price" } }, "the\_movavg": { "moving\_avg":{ "buckets\_path": "the\_sum", "window" : 30, "model" : "simple", "predict" : 10 } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] The `simple`, `linear` and `ewma` models all produce "flat" predictions: they essentially converge on the mean of the last value in the series, producing a flat: [[simple\_prediction]] .Simple moving average with window of size 10, predict = 50 image::images/pipeline\_movavg/simple\_prediction.png[] In contrast, the `holt` model can extrapolate based on local or global constant trends. If we set a high `beta` value, we can extrapolate based on local constant trends (in this case the predictions head down, because the data at the end of the series was heading in a downward direction): [[double\_prediction\_local]] .Holt-Linear moving average with window of size 100, predict = 20, alpha = 0.5, beta = 0.8 image::images/pipeline\_movavg/double\_prediction\_local.png[] In contrast, if we choose a small `beta`, the predictions are based on the global constant trend. In this series, the global trend is slightly positive, so the prediction makes a sharp u-turn and begins a positive slope: [[double\_prediction\_global]] .Double Exponential moving average with window of size 100, predict = 20, alpha = 0.5, beta = 0.1 image::images/pipeline\_movavg/double\_prediction\_global.png[] The `holt\_winters` model has the potential to deliver the best predictions, since it also incorporates seasonal fluctuations into the model: [[holt\_winters\_prediction\_global]] .Holt-Winters moving average with window of size 120, predict = 25, alpha = 0.8, beta = 0.2, gamma = 0.7, period = 30 image::images/pipeline\_movavg/triple\_prediction.png[] [[movavg-minimizer]] ==== Minimization Some of the models (EWMA, Holt-Linear, Holt-Winters) require one or more parameters to be configured. Parameter choice can be tricky and sometimes non-intuitive. Furthermore, small deviations in these parameters can sometimes have a drastic effect on the output moving average. For that reason, the three "tunable" models can be algorithmically \*minimized\*. Minimization is a process where parameters are tweaked until the predictions generated by the model closely match the output data. Minimization is not fullproof and can be susceptible to overfitting, but it often gives better results than hand-tuning. Minimization is disabled by default for `ewma` and `holt\_linear`, while it is enabled by default for `holt\_winters`. Minimization is most useful with Holt-Winters, since it helps improve the accuracy of the predictions. EWMA and Holt-Linear are not great predictors, and mostly used for smoothing data, so minimization is less useful on those models. Minimization is enabled/disabled via the `minimize` parameter: [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo":{ "date\_histogram":{ "field":"date", "interval":"1M" }, "aggs":{ "the\_sum":{ "sum":{ "field": "price" } }, "the\_movavg": { "moving\_avg":{ "buckets\_path": "the\_sum", "model" : "holt\_winters", "window" : 30, "minimize" : true, <1> "settings" : { "period" : 7 } } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> Minimization is enabled with the `minimize` parameter When enabled, minimization will find the optimal values for `alpha`, `beta` and `gamma`. The user should still provide appropriate values for `window`, `period` and `type`. [WARNING] ====== Minimization works by running a stochastic process called \*simulated annealing\*. This process will usually generate a good solution, but is not guaranteed to find the global optimum. It also requires some amount of additional computational power, since the model needs to be re-run multiple times as the values are tweaked. The run-time of minimization is linear to the size of the window being processed: excessively large windows may cause latency. Finally, minimization fits the model
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/movavg-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.07475223392248154,
0.01796800084412098,
0.03376319259405136,
0.09740757942199707,
0.012509993277490139,
0.028188815340399742,
-0.04866191744804382,
0.0156752560287714,
0.06170868128538132,
-0.05494198203086853,
-0.08412183076143265,
-0.0567239448428154,
0.002493651583790779,
-0.04195905476808548,
-0.09235046058893204,
-0.0018058319110423326,
-0.12840372323989868,
-0.02862064726650715,
-0.03645441308617592,
-0.14693646132946014,
0.058458101004362106,
0.016742544248700142,
-0.0007928163977339864,
-0.03185749799013138,
0.032410845160484314,
0.036176081746816635,
-0.0626121386885643,
0.03590621054172516,
0.01228396873921156,
0.014943510293960571,
-0.029495198279619217,
-0.03502392768859863,
0.06217728927731514,
0.04136085510253906,
-0.04065490886569023,
0.01358944270759821,
-0.07613500952720642,
0.02066047117114067,
0.008738740347325802,
-0.006785139441490173,
0.08507826924324036,
0.03226548805832863,
-0.024524513632059097,
-0.0897611528635025,
0.02897440269589424,
-0.043761979788541794,
-0.028991226106882095,
-0.10205303132534027,
0.016169613227248192,
0.05591917037963867,
-0.10060103237628937,
-0.059333305805921555,
-0.006899567786604166,
-0.029685869812965393,
-0.04894062131643295,
0.015689929947257042,
-0.030826298519968987,
-0.02232694998383522,
0.012444896623492241,
-0.12660351395606995,
0.009596156887710094,
-0.06249592453241348,
-0.038653891533613205,
-0.011726452969014645,
0.031779009848833084,
-0.0319073311984539,
0.00842096284031868,
0.08316753804683685,
-0.029018696397542953,
0.08761950582265854,
0.05255398526787758,
0.03256380558013916,
-0.029350582510232925,
-0.038199711591005325,
0.048817094415426254,
0.023715607821941376,
0.010640040040016174,
0.0386246033012867,
0.051162801682949066,
0.041071049869060516,
-0.07101073861122131,
-0.12538696825504303,
0.028704624623060226,
-0.03153292462229729,
-0.04739862680435181,
-0.03837702050805092,
0.021709199994802475,
-0.01459741685539484,
0.04879575967788696,
-0.05161947011947632,
-0.07876668870449066,
-0.1215885803103447,
0.001190991373732686,
0.0524018332362175,
0.011635996401309967,
0.1279079169034958,
0.009786248207092285,
-0.045125775039196014,
0.07982560247182846,
0.020927779376506805,
0.05651705339550972,
0.010825062170624733,
0.01992882788181305,
-0.03259268403053284,
0.07127892225980759,
0.012033043429255486,
-0.06274762749671936,
0.06364233046770096,
-0.061144765466451645,
-0.009066956117749214,
0.050198886543512344,
0.039095502346754074,
0.027503853663802147,
-0.025614658370614052,
-0.026864174753427505,
0.08204067498445511,
-0.04368389770388603,
-0.0066556381061673164,
-0.027821045368909836,
0.08158279210329056,
0.11052341759204865,
0.04767395555973053,
0.014445250853896141,
-0.027874965220689774,
-0.0007048023981042206,
-0.01954115927219391,
-0.031226111575961113,
-6.737314280327263e-33,
-0.004712329246103764,
-0.1254204958677292,
0.07252740859985352,
-0.01519953552633524,
0.06919905543327332,
0.07426273822784424,
-0.039869274944067,
0.08339099586009979,
0.009034901857376099,
-0.03737756237387657,
-0.052223775535821915,
0.0721125602722168,
-0.06488610059022903,
-0.06807013601064682,
-0.043810393661260605,
0.0024314401671290398,
0.009588692337274551,
0.02146548219025135,
0.012946508824825287,
-0.019834013655781746,
0.01186224166303873,
-0.06738743931055069,
-0.058178868144750595,
-0.014891876839101315,
0.020360449329018593,
-0.012170529924333096,
0.012152946554124355,
-0.005846605636179447,
-0.1085287556052208,
0.007439702283591032,
-0.021131597459316254,
0.07608318328857422,
-0.04333553463220596,
-0.036665089428424835,
0.0278694499284029,
-0.008247307501733303,
-0.05674558877944946,
0.03020041435956955,
0.021580442786216736,
-0.000922628038097173,
0.015256376937031746,
-0.014017106965184212,
-0.050056830048561096,
-0.09008059650659561,
-0.09111938625574112,
0.01168096624314785,
0.014015501365065575,
-0.006991397123783827,
-0.010045760311186314,
0.09792673587799072,
-0.04829046502709389,
-0.03397494927048683,
-0.03381527215242386,
-0.03352950140833855,
0.023593727499246597,
0.003342128824442625,
0.03421787917613983,
0.026003383100032806,
0.016728036105632782,
-0.0321209542453289,
-0.04634563997387886,
0.07171009480953217,
0.03356824815273285,
-0.008753541857004166,
-0.02036990225315094,
0.06857633590698242,
0.022864794358611107,
0.13657493889331818,
0.014192876406013966,
0.0780152827501297,
0.05676979571580887,
0.0628894716501236,
0.0067721158266067505,
-0.00012932150275446475,
0.057261377573013306,
-0.1260959506034851,
0.03279707953333855,
-0.01544095203280449,
-0.061364274471998215,
0.03952351212501526,
0.06395333260297775,
-0.02406640350818634,
-0.022322427481412888,
0.029956480488181114,
0.00805021170526743,
0.041423968970775604,
-0.020678160712122917,
0.014240135438740253,
-0.1277731955051422,
-0.0625944659113884,
-0.08526189625263214,
0.026255611330270767,
-0.020286638289690018,
-0.04800467938184738,
-0.05270834639668465,
2.773294965411067e-33,
0.05339548736810684,
0.01802937127649784,
0.05230797827243805,
0.06112337484955788,
0.04506021365523338,
-0.03656737506389618,
0.05812099575996399,
0.09802091121673584,
0.016272813081741333,
0.04087982326745987,
-0.06973163038492203,
-0.024623440578579903,
0.016139043495059013,
-0.014969982206821442,
-0.04127539321780205,
0.032418668270111084,
-0.019784221425652504,
-0.11639740318059921,
-0.0067241801880300045,
-0.07663048803806305,
-0.0407070629298687,
0.00023531449551228434,
-0.027635296806693077,
0.08726931363344193,
-0.023067528381943703,
-0.06547988951206207,
0.041171491146087646,
0.03607073426246643,
-0.09891056269407272,
0.04247236251831055,
-0.002018784871324897,
-0.062462396919727325,
-0.02452385053038597,
-0.04416731745004654,
-0.04039643332362175,
-0.013528676703572273,
0.0972365140914917,
0.021083999425172806,
-0.002574554178863764,
0.06450336426496506,
0.023518051952123642,
-0.009204466827213764,
-0.027407407760620117,
-0.054855745285749435,
0.041551027446985245,
0.03792225196957588,
0.04464837536215782,
0.06021355837583542,
0.028808841481804848,
-0.03931693732738495,
-0.029321765527129173,
0.04952778294682503,
-0.13573415577411652,
0.08277932554483414,
-0.007735285442322493,
-0.013944672420620918,
-0.018934212625026703,
-0.04028093069791794,
-0.04963899031281471,
-0.008481943979859352,
-0.05193890258669853,
-0.0327945314347744,
0.0343000553548336,
0.0019346779445186257,
0.009838399477303028,
-0.038517508655786514,
-0.022150088101625443,
-0.049189891666173935,
0.01961541548371315,
0.001240369863808155,
-0.0263498704880476,
-0.0016673747450113297,
0.08528152853250504,
0.008087133057415485,
-0.0036895088851451874,
-0.000039699683838989586,
0.09483842551708221,
-0.017991872504353523,
0.14197422564029694,
-0.0454828217625618,
-0.07738185673952103,
-0.013690696097910404,
0.06924650073051453,
0.08056961745023727,
-0.010468675754964352,
0.014634602703154087,
0.0030816716607660055,
0.09178191423416138,
-0.015069946646690369,
0.07877418398857117,
-0.07735239714384079,
0.028282232582569122,
0.019972188398241997,
0.03873308002948761,
-0.003939774353057146,
-4.856354607341018e-8,
-0.04303773120045662,
0.022379232570528984,
-0.003748785238713026,
0.037970300763845444,
0.043442122638225555,
0.04886537417769432,
0.015587596222758293,
0.08656205981969833,
0.02236206829547882,
-0.03835156559944153,
0.1069682389497757,
0.014934686943888664,
-0.06716416776180267,
0.07148659974336624,
-0.05115493759512901,
-0.024959636852145195,
-0.05205037444829941,
-0.012240210548043251,
-0.006131690926849842,
-0.02805590070784092,
0.06902909278869629,
-0.00755878072232008,
0.022903790697455406,
0.023710059002041817,
0.08199747651815414,
-0.03547235205769539,
-0.019204214215278625,
0.08008042722940445,
0.016115766018629074,
-0.04784020408987999,
-0.04667448252439499,
-0.014272721484303474,
-0.03072827123105526,
0.019559595733880997,
-0.04562737047672272,
-0.09120731800794601,
0.011264363303780556,
0.04028339684009552,
0.011463655158877373,
0.06857948005199432,
0.04835306107997894,
0.013781942427158356,
-0.026148324832320213,
0.03733154386281967,
0.026640063151717186,
0.0032455814070999622,
0.025953102856874466,
0.03987265005707741,
0.05170989781618118,
-0.01175597682595253,
0.04481901228427887,
-0.05822308734059334,
0.0014257658040151,
0.020154545083642006,
0.06988095492124557,
-0.07088025659322739,
0.033070050179958344,
-0.03621378540992737,
-0.02783581055700779,
0.027579570189118385,
0.017652953043580055,
-0.07597199827432632,
-0.0967666283249855,
0.022862646728754044
] | -0.038729
|
global optimum. It also requires some amount of additional computational power, since the model needs to be re-run multiple times as the values are tweaked. The run-time of minimization is linear to the size of the window being processed: excessively large windows may cause latency. Finally, minimization fits the model to the last `n` values, where `n = window`. This generally produces better forecasts into the future, since the parameters are tuned around the end of the series. It can, however, generate poorer fitting moving averages at the beginning of the series. ======
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/movavg-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.045496851205825806,
-0.01955081708729267,
0.0363982729613781,
0.06657524406909943,
-0.003215181175619364,
-0.012233893387019634,
-0.1264539211988449,
0.04450766369700432,
0.11410527676343918,
-0.0007453672587871552,
-0.1283232420682907,
0.07084809988737106,
-0.06471529603004456,
0.01923878863453865,
-0.0852954089641571,
-0.0677550807595253,
0.03053801879286766,
-0.0625290721654892,
-0.049789782613515854,
-0.07668636739253998,
0.013595149852335453,
-0.023729823529720306,
-0.03131387010216713,
-0.01804804615676403,
0.014259681105613708,
-0.025750422850251198,
-0.07765170931816101,
0.03665342554450035,
0.0932748019695282,
0.026006856933236122,
-0.0331089049577713,
0.05437426641583443,
0.06371623277664185,
0.0030883727595210075,
-0.10314100235700607,
-0.021243251860141754,
-0.03534970059990883,
-0.03779255598783493,
0.006572726182639599,
0.000871058611664921,
0.0182833019644022,
0.05310029163956642,
-0.021570594981312752,
-0.0177531149238348,
-0.0030982571188360453,
-0.0041228123009204865,
0.028026770800352097,
-0.02079157717525959,
-0.02561631053686142,
-0.007601762190461159,
-0.022982008755207062,
0.026748744770884514,
-0.08118358254432678,
0.016044991090893745,
-0.008298283442854881,
0.00007963631651364267,
-0.051238205283880234,
-0.03348055109381676,
0.08379814773797989,
-0.011943859979510307,
-0.013665076345205307,
-0.047118231654167175,
0.0009716814383864403,
0.019558986648917198,
0.07347682118415833,
-0.018050827085971832,
0.04525897279381752,
0.00099790352396667,
0.00430623535066843,
0.0236918106675148,
-0.0020211562514305115,
0.029542740434408188,
0.026176655665040016,
-0.06334464251995087,
0.012360977940261364,
-0.06654758006334305,
0.07798875868320465,
-0.08623506128787994,
0.020782632753252983,
0.022957246750593185,
0.06450147181749344,
0.013388480991125107,
-0.03524153679609299,
-0.025030061602592468,
0.04523685202002525,
0.020291820168495178,
-0.04980737715959549,
-0.058820828795433044,
0.12384393066167831,
-0.005808754358440638,
0.03142150491476059,
0.01679903082549572,
-0.07616368681192398,
0.018154170364141464,
0.030301179736852646,
0.0669388547539711,
0.05308259278535843,
0.003790054004639387,
0.015601087361574173,
0.008618905209004879,
0.053932227194309235,
-0.022955141961574554,
0.1789579689502716,
0.08983724564313889,
0.058006659150123596,
-0.107263945043087,
0.010135951451957226,
0.03295266628265381,
-0.026544148102402687,
-0.03550593927502632,
-0.013719961047172546,
0.0459597185254097,
0.03949911892414093,
-0.026234494522213936,
0.013607186265289783,
0.0009448370547033846,
0.01873941533267498,
0.04771781712770462,
-0.037756480276584625,
0.11451846361160278,
-0.024586452171206474,
-0.003862876445055008,
0.013535377569496632,
-0.007978217676281929,
0.01171153225004673,
0.033950649201869965,
-0.058676909655332565,
2.885020376997948e-33,
-0.06004492938518524,
-0.02310810796916485,
0.03201756998896599,
-0.08343324810266495,
0.04177290201187134,
0.03830048814415932,
-0.0020903446711599827,
0.008734459988772869,
0.06275543570518494,
-0.038889940828084946,
-0.04153712838888168,
0.012649334967136383,
-0.05565306171774864,
0.059113334864377975,
0.09257414937019348,
-0.07081370055675507,
0.011409622617065907,
0.09122437983751297,
-0.05073581635951996,
0.005076033528894186,
0.030091388151049614,
-0.059181224554777145,
0.01688593067228794,
-0.04769289866089821,
-0.002821390051394701,
0.023138297721743584,
0.12291112542152405,
0.015032484196126461,
-0.08808393031358719,
0.025679823011159897,
0.0027630170807242393,
-0.0035490524023771286,
-0.09446059167385101,
-0.003093162551522255,
0.07428901642560959,
0.02704438380897045,
-0.02035912685096264,
-0.01167602650821209,
0.09718272089958191,
0.01521697174757719,
-0.02995498664677143,
0.06993512064218521,
0.0012278164504095912,
-0.014369098469614983,
0.04390235245227814,
-0.029505426064133644,
0.023887567222118378,
0.08406256139278412,
-0.0512559600174427,
0.04869067296385765,
0.022641316056251526,
-0.01673790067434311,
-0.05941053852438927,
-0.038871973752975464,
-0.002155026188120246,
-0.003392756450921297,
0.07399339973926544,
-0.09544625133275986,
-0.061219722032547,
0.025285104289650917,
-0.07585722208023071,
-0.09392843395471573,
-0.0389133058488369,
0.018738174811005592,
0.05227641761302948,
0.012427951209247112,
0.03666459023952484,
0.07288173586130142,
-0.031366776674985886,
0.003245746251195669,
0.009902861900627613,
-0.01789960265159607,
0.013685942627489567,
0.006063361186534166,
0.08203151822090149,
-0.05803539231419563,
0.10899464786052704,
0.06844190508127213,
-0.03889966756105423,
0.002667012857273221,
-0.04396142065525055,
0.14352740347385406,
-0.03278334066271782,
-0.08982332795858383,
-0.03205622732639313,
-0.004731033928692341,
0.03077057935297489,
0.07307761162519455,
-0.08897862583398819,
-0.06333457678556442,
-0.018651360645890236,
0.00821861531585455,
0.002084497595205903,
0.12051066011190414,
-0.048914048820734024,
-4.2680186844281476e-33,
0.07909896969795227,
-0.07329344004392624,
0.026493778452277184,
0.031107790768146515,
-0.014892904087901115,
0.007799642160534859,
-0.047846823930740356,
-0.04400939494371414,
0.009345454163849354,
-0.03375082090497017,
-0.020686542615294456,
0.009707789868116379,
0.056392837315797806,
0.02134229615330696,
-0.0025742193683981895,
-0.010995023883879185,
0.057251378893852234,
-0.1406959593296051,
0.054115068167448044,
-0.08070093393325806,
0.040858253836631775,
-0.03463010489940643,
-0.05456547066569328,
0.03935886546969414,
0.020433444529771805,
-0.07166719436645508,
-0.0886223092675209,
0.027980700135231018,
-0.0423860177397728,
0.012115620076656342,
-0.05184805020689964,
-0.030913783237338066,
-0.0032711036037653685,
0.009917009621858597,
-0.031890906393527985,
0.11315204203128815,
0.017649564892053604,
-0.010584038682281971,
-0.0035886012483388186,
0.08931165933609009,
0.014842720702290535,
0.07591588795185089,
0.05404997989535332,
0.030605722218751907,
0.03408598154783249,
0.08790432661771774,
-0.024943355470895767,
-0.037018053233623505,
0.00504772923886776,
0.00345919793471694,
0.028788138180971146,
0.017520641908049583,
-0.04184596613049507,
-0.008926782757043839,
-0.03737533465027809,
0.04568834230303764,
-0.10038725286722183,
0.0258167777210474,
-0.060192108154296875,
-0.03421736881136894,
0.04305844381451607,
-0.020548058673739433,
-0.028124485164880753,
-0.01177517045289278,
-0.13309906423091888,
0.04694918543100357,
0.032811008393764496,
-0.04069980978965759,
0.052832312881946564,
-0.05258265137672424,
-0.01489343587309122,
-0.018039952963590622,
-0.016271013766527176,
0.04272305592894554,
-0.12125586718320847,
-0.0006768546300008893,
0.06709898263216019,
-0.04565566033124924,
-0.044110193848609924,
0.0217437781393528,
-0.0974322259426117,
0.029253017157316208,
0.028555508702993393,
-0.024271704256534576,
-0.09005948156118393,
-0.059669092297554016,
0.08933699131011963,
-0.006207696627825499,
-0.017869390547275543,
-0.01668098196387291,
-0.026449168100953102,
-0.02163022942841053,
0.006383146625012159,
0.011952422559261322,
-0.07777509838342667,
-5.5321631720062214e-8,
-0.09672420471906662,
0.0034228975418955088,
0.04081309586763382,
-0.035927560180425644,
-0.021902183070778847,
-0.027467690408229828,
0.0596868135035038,
0.011284328065812588,
0.044861674308776855,
-0.018844561651349068,
0.11200696229934692,
-0.037957072257995605,
-0.05128025263547897,
0.05573584511876106,
0.022084001451730728,
-0.01242772676050663,
-0.04149683937430382,
-0.03580547869205475,
-0.0015661068027839065,
-0.03083019144833088,
0.03731682896614075,
0.013688155449926853,
-0.04609542712569237,
-0.03290858119726181,
0.08138617128133774,
-0.026016652584075928,
0.03392905369400978,
0.05265814810991287,
-0.035122111439704895,
0.009616229683160782,
-0.029610702767968178,
0.065113365650177,
0.011598169803619385,
0.06759355962276459,
-0.09178227931261063,
0.0717013031244278,
-0.011959172785282135,
0.05457542836666107,
-0.047563500702381134,
-0.012109690345823765,
0.05178344249725342,
-0.002832412254065275,
-0.07105014473199844,
-0.05822591483592987,
-0.004561054985970259,
-0.017542792484164238,
-0.02420313097536564,
-0.033348359167575836,
0.06420920044183731,
-0.02771877683699131,
0.10948807746171951,
-0.0208584014326334,
0.02852628193795681,
0.010205766186118126,
0.07607493549585342,
0.010030820965766907,
-0.0068405065685510635,
-0.054955434054136276,
0.005578027106821537,
0.001471668016165495,
-0.07790759205818176,
0.01956319995224476,
-0.059969089925289154,
0.07262250036001205
] | 0.127834
|
[[search-aggregations-pipeline-sum-bucket-aggregation]] === Sum Bucket Aggregation A sibling pipeline aggregation which calculates the sum across all bucket of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation. ==== Syntax A `sum\_bucket` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "sum\_bucket": { "buckets\_path": "the\_sum" } } -------------------------------------------------- // NOTCONSOLE [[sum-bucket-params]] .`sum\_bucket` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`buckets\_path` |The path to the buckets we wish to find the sum for (see <> for more details) |Required | |`gap\_policy` |The policy to apply when gaps are found in the data (see <> for more details)|Optional | `skip` |`format` |format to apply to the output value of this aggregation |Optional |`null` |=== The following snippet calculates the sum of all the total monthly `sales` buckets: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } } } }, "sum\_monthly\_sales": { "sum\_bucket": { "buckets\_path": "sales\_per\_month>sales" <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `buckets\_path` instructs this sum\_bucket aggregation that we want the sum of the `sales` aggregation in the `sales\_per\_month` date histogram. And the following may be the response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "sales": { "value": 550.0 } }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "sales": { "value": 60.0 } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "sales": { "value": 375.0 } } ] }, "sum\_monthly\_sales": { "value": 985.0 } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/sum-bucket-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.047887299209833145,
0.02023528330028057,
-0.01735631749033928,
0.03996837139129639,
-0.04445149376988411,
0.0030176632571965456,
0.021141741424798965,
0.00628778338432312,
0.044105976819992065,
-0.03576231002807617,
-0.05427609756588936,
-0.15084508061408997,
0.03623972088098526,
-0.006077534984797239,
-0.023814432322978973,
0.023619510233402252,
-0.01814689114689827,
0.00015350406465586275,
-0.08949527889490128,
-0.1346079260110855,
-0.0024995433632284403,
0.019168812781572342,
-0.009801296517252922,
-0.06845176964998245,
0.03260315954685211,
-0.021319488063454628,
-0.0866655483841896,
-0.03493066132068634,
0.034904513508081436,
0.006892265286296606,
-0.01271144486963749,
-0.01021526288241148,
-0.0357641875743866,
0.0479089729487896,
0.07067447155714035,
0.05881360173225403,
-0.03479105979204178,
0.0056919832713902,
0.011082236655056477,
-0.006399510428309441,
0.026415014639496803,
0.047312915325164795,
-0.036741096526384354,
-0.1340826451778412,
0.0015532446559518576,
-0.05682394653558731,
-0.0948297530412674,
-0.0361778624355793,
-0.0027053705416619778,
0.0077600195072591305,
-0.03310553357005119,
-0.03246891498565674,
-0.029707936570048332,
0.0031009973026812077,
0.04581669345498085,
0.059910114854574203,
-0.07717025279998779,
-0.007899411022663116,
0.009861312806606293,
-0.08132103830575943,
-0.08218830823898315,
-0.07158855348825455,
0.037025533616542816,
-0.021271929144859314,
0.06009044870734215,
0.012526577338576317,
-0.023316647857427597,
0.01259321067482233,
-0.028954995796084404,
0.12061448395252228,
0.017118152230978012,
-0.005967625882476568,
-0.015211259946227074,
-0.052302051335573196,
0.041079360991716385,
0.04031895473599434,
0.03479164093732834,
0.05549924820661545,
0.02036477066576481,
-0.018208038061857224,
-0.06277462095022202,
-0.049516867846250534,
-0.05587928742170334,
0.04832324758172035,
-0.01787988469004631,
-0.013127293437719345,
-0.04999140650033951,
-0.05512647703289986,
0.10092071443796158,
-0.09286746382713318,
-0.08882065117359161,
-0.023966338485479355,
0.030473079532384872,
0.009435710497200489,
0.04892744868993759,
0.02316093258559704,
-0.07210756838321686,
-0.022784888744354248,
0.06634306907653809,
0.02253936603665352,
-0.04651051014661789,
-0.02442746050655842,
0.04535619914531708,
-0.08983894437551498,
-0.021051619201898575,
0.0006800879491493106,
-0.00036635767901316285,
0.05156027153134346,
-0.024924244731664658,
0.04736776277422905,
0.028665009886026382,
-0.015659736469388008,
0.010445271618664265,
0.024874569848179817,
-0.011105744168162346,
-0.00025009646196849644,
0.13041196763515472,
-0.07920907437801361,
0.0430351123213768,
-0.026601942256093025,
0.09716320782899857,
0.03514791280031204,
-0.0009552946430630982,
-0.04604719579219818,
-0.006344595458358526,
-0.02067737840116024,
-0.020644310861825943,
-3.6208847997294926e-33,
0.006732788402587175,
-0.1281934231519699,
0.06367389857769012,
0.012829498387873173,
0.022487403824925423,
0.09357956051826477,
0.04594285041093826,
0.042317185550928116,
-0.059885889291763306,
0.044350940734148026,
-0.04059331491589546,
0.07298747450113297,
-0.1447070837020874,
-0.08149158954620361,
-0.012148109264671803,
0.012768078595399857,
0.009017103351652622,
0.06278494000434875,
0.012904658913612366,
-0.0035743198823183775,
0.07233040779829025,
-0.03540884703397751,
-0.016734914854168892,
0.040394846349954605,
0.00150705361738801,
-0.031325098127126694,
0.034834932535886765,
-0.05893803387880325,
-0.07183736562728882,
0.00021968944929540157,
0.02481895126402378,
0.009759786538779736,
-0.02064390480518341,
-0.02029782347381115,
-0.0006323946290649474,
-0.0193948857486248,
-0.014882112853229046,
0.06065835803747177,
-0.034784235060214996,
0.004377090372145176,
-0.011515559628605843,
-0.009176408872008324,
-0.006223635282367468,
-0.09908761084079742,
-0.12105295807123184,
-0.002094836672767997,
0.044206202030181885,
-0.01812095008790493,
0.07007937133312225,
0.01908988691866398,
-0.05471857264637947,
0.0033715732861310244,
0.05229048803448677,
0.001342926872894168,
0.018095970153808594,
-0.001271284301765263,
-0.014558326452970505,
0.08258086442947388,
0.034791022539138794,
-0.006619997788220644,
-0.06323014944791794,
0.024504654109477997,
-0.030114907771348953,
0.04764743894338608,
0.06278380006551743,
0.054125186055898666,
0.03264102712273598,
0.10530873388051987,
0.06116706505417824,
0.030105577781796455,
-0.011975040659308434,
0.06465564668178558,
0.024469831958413124,
0.029876939952373505,
0.061421819031238556,
-0.11941416561603546,
0.0430886335670948,
0.0013494541635736823,
0.010218467563390732,
0.015449877828359604,
-0.018511343747377396,
-0.003290350316092372,
0.0016380604356527328,
0.04907052218914032,
0.01545867882668972,
0.049962058663368225,
-0.05294106528162956,
0.03165876120328903,
-0.12088026106357574,
-0.04593554511666298,
-0.056199632585048676,
-0.014603661373257637,
-0.12051986157894135,
-0.04437533766031265,
-0.02973271906375885,
-7.056709319757125e-34,
0.011834414675831795,
0.03899702802300453,
0.05752944201231003,
0.055055875331163406,
0.07403707504272461,
-0.011833949014544487,
0.05852966755628586,
-0.06703855097293854,
0.060909055173397064,
0.04581531137228012,
-0.07253817468881607,
-0.004918668884783983,
0.016731349751353264,
-0.05114321783185005,
-0.00024375146313104779,
0.05936102196574211,
-0.13522209227085114,
-0.1190892904996872,
0.0473233163356781,
-0.001788499066606164,
-0.034704793244600296,
0.027372905984520912,
-0.00871037133038044,
0.06725288927555084,
-0.05896930396556854,
0.01023307628929615,
-0.018318433314561844,
0.017857626080513,
-0.013833966106176376,
0.040009502321481705,
0.019441768527030945,
0.0018489628564566374,
-0.049618709832429886,
-0.015335130505263805,
-0.05780136212706566,
-0.1257575899362564,
0.054420504719018936,
0.04975459352135658,
-0.027366390451788902,
0.022189075127243996,
-0.030885715037584305,
-0.02858745865523815,
0.015021879225969315,
-0.031738102436065674,
0.030750297009944916,
0.055059343576431274,
0.09044197201728821,
-0.03454718366265297,
-0.04552469402551651,
-0.07352343201637268,
-0.0009389484184794128,
-0.01809162087738514,
-0.13158966600894928,
0.13925431668758392,
-0.03533352166414261,
-0.011590196751058102,
-0.026386551558971405,
-0.019346658140420914,
-0.01670946180820465,
-0.05141821131110191,
-0.0055276378989219666,
-0.047246385365724564,
-0.019941017031669617,
0.016317058354616165,
-0.017633045092225075,
-0.0344805046916008,
-0.02498820424079895,
-0.10144165903329849,
-0.027772488072514534,
0.06653620302677155,
-0.007689759600907564,
-0.03837832063436508,
0.1344662457704544,
-0.01016254723072052,
-0.00161043053958565,
0.026452597230672836,
0.021638087928295135,
-0.07138663530349731,
0.12095116823911667,
0.011672833934426308,
-0.06815177202224731,
0.015067297965288162,
0.0651293620467186,
0.06842987984418869,
0.030616244301199913,
-0.03274257481098175,
0.03615947067737579,
0.133257195353508,
-0.016626017168164253,
0.09161160886287689,
-0.05339342728257179,
-0.036774128675460815,
0.00532416719943285,
-0.04491698369383812,
-0.028115874156355858,
-4.470502545927957e-8,
-0.026153387501835823,
0.017931126058101654,
-0.10059650987386703,
-0.031238865107297897,
-0.010657713748514652,
-0.013037255965173244,
0.04214885085821152,
0.1322380006313324,
-0.060589466243982315,
0.010435903444886208,
0.028717877343297005,
0.005570848938077688,
-0.017442073673009872,
0.07220333069562912,
-0.09139605611562729,
-0.027184974402189255,
-0.006290386896580458,
0.0633380189538002,
0.007411952130496502,
-0.05906982719898224,
0.0016653210623189807,
0.00004124790211790241,
0.019882548600435257,
-0.011727260425686836,
0.043863147497177124,
-0.022098710760474205,
-0.0023896058555692434,
0.021272294223308563,
0.03557274490594864,
-0.013142780400812626,
-0.01138707809150219,
0.013282423838973045,
0.002630822593346238,
0.013416933827102184,
-0.0419740155339241,
-0.042767513543367386,
-0.030046135187149048,
0.02479366771876812,
-0.014348763972520828,
0.03061428666114807,
0.022830279543995857,
0.07411426305770874,
-0.050639811903238297,
0.02128680981695652,
0.03896652162075043,
0.04861858859658241,
-0.06460604816675186,
0.062877357006073,
-0.01774231530725956,
0.014458045363426208,
0.04810957610607147,
-0.07223869115114212,
-0.03205539658665657,
-0.008428544737398624,
0.050552401691675186,
-0.07958026230335236,
0.03639154136180878,
-0.07280757278203964,
0.0750742182135582,
0.03679830953478813,
0.05759317800402641,
-0.049766089767217636,
-0.022434476763010025,
-0.06319953501224518
] | -0.01126
|
[[search-aggregations-pipeline-percentiles-bucket-aggregation]] === Percentiles Bucket Aggregation A sibling pipeline aggregation which calculates percentiles across all bucket of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation. ==== Syntax A `percentiles\_bucket` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "percentiles\_bucket": { "buckets\_path": "the\_sum" } } -------------------------------------------------- // NOTCONSOLE [[percentiles-bucket-params]] .`percentiles\_bucket` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`buckets\_path` |The path to the buckets we wish to find the percentiles for (see <> for more details) |Required | |`gap\_policy` |The policy to apply when gaps are found in the data (see <> for more details)|Optional | `skip` |`format` |format to apply to the output value of this aggregation |Optional | `null` |`percents` |The list of percentiles to calculate |Optional | `[ 1, 5, 25, 50, 75, 95, 99 ]` |=== The following snippet calculates the percentiles for the total monthly `sales` buckets: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } } } }, "percentiles\_monthly\_sales": { "percentiles\_bucket": { "buckets\_path": "sales\_per\_month>sales", <1> "percents": [ 25.0, 50.0, 75.0 ] <2> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `buckets\_path` instructs this percentiles\_bucket aggregation that we want to calculate percentiles for the `sales` aggregation in the `sales\_per\_month` date histogram. <2> `percents` specifies which percentiles we wish to calculate, in this case, the 25th, 50th and 75th percentiles. And the following may be the response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "sales": { "value": 550.0 } }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "sales": { "value": 60.0 } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "sales": { "value": 375.0 } } ] }, "percentiles\_monthly\_sales": { "values" : { "25.0": 375.0, "50.0": 375.0, "75.0": 550.0 } } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/] ==== Percentiles\_bucket implementation The Percentile Bucket returns the nearest input data point that is not greater than the requested percentile; it does not interpolate between data points. The percentiles are calculated exactly and is not an approximation (unlike the Percentiles Metric). This means the implementation maintains an in-memory, sorted list of your data to compute the percentiles, before discarding the data. You may run into memory pressure issues if you attempt to calculate percentiles over many millions of data-points in a single `percentiles\_bucket`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/percentiles-bucket-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.05304421856999397,
0.04647992178797722,
-0.02132549323141575,
0.02821997180581093,
-0.048208341002464294,
-0.026744402945041656,
-0.000979976262897253,
0.04473351314663887,
0.030892018228769302,
-0.02574382908642292,
-0.042504165321588516,
-0.12131822109222412,
0.03380865603685379,
-0.027525344863533974,
-0.0037963350769132376,
-0.016308486461639404,
-0.05138922110199928,
0.03278918191790581,
-0.11139021813869476,
-0.12422861903905869,
-0.04209177568554878,
0.03876785188913345,
-0.0061292825266718864,
-0.08421961218118668,
0.050276219844818115,
0.030147893354296684,
-0.07399848103523254,
-0.011209707707166672,
0.03418133407831192,
0.007247547153383493,
-0.008400337770581245,
-0.013036144897341728,
-0.033636197447776794,
0.050399743020534515,
0.03017362952232361,
0.047973595559597015,
-0.013109231367707253,
-0.02229134738445282,
0.011386163532733917,
-0.001512926653958857,
0.008680691942572594,
0.06095438823103905,
-0.05263214930891991,
-0.15619990229606628,
-0.0029689588118344545,
-0.07542753219604492,
-0.1237020194530487,
-0.02684888243675232,
-0.023362701758742332,
0.017453661188483238,
-0.08199183642864227,
-0.015574267134070396,
-0.0010823026532307267,
0.00673848669975996,
0.017265474423766136,
0.05824793502688408,
-0.04940228909254074,
-0.03337983787059784,
0.048232950270175934,
-0.06443885713815689,
-0.09705433249473572,
-0.04802519828081131,
0.049533747136592865,
-0.033009547740221024,
0.050836071372032166,
-0.018554821610450745,
-0.0417502298951149,
0.030671752989292145,
-0.00837473850697279,
0.06652986258268356,
0.037442807108163834,
-0.012519587762653828,
0.008973811753094196,
-0.06386298686265945,
0.08260536938905716,
0.04023713991045952,
0.034267038106918335,
0.06329251080751419,
0.04285639524459839,
-0.05656996741890907,
-0.05932063236832619,
-0.05264463648200035,
-0.09033921360969543,
0.032589662820100784,
-0.024668512865900993,
-0.04564570635557175,
-0.04541689530014992,
-0.036190345883369446,
0.08469171077013016,
-0.08569926768541336,
-0.0875808373093605,
0.03915552422404289,
-0.03302449360489845,
0.011497506871819496,
0.04868732765316963,
0.06370612978935242,
-0.050382815301418304,
-0.07406177371740341,
0.0536038763821125,
0.017541594803333282,
-0.041679684072732925,
-0.04576271027326584,
0.03403787314891815,
-0.06308887898921967,
-0.06034725904464722,
-0.0680808275938034,
0.011585874482989311,
0.07760509103536606,
-0.0269448384642601,
0.0069853076711297035,
0.0008466436411254108,
0.0120729124173522,
0.015641944482922554,
0.021725550293922424,
-0.012020623311400414,
-0.0522310696542263,
0.11748490482568741,
-0.06289684772491455,
0.0856497585773468,
-0.02976115420460701,
0.07847344875335693,
0.0675596371293068,
-0.018109509721398354,
-0.03896099701523781,
0.005176384933292866,
-0.005138595122843981,
-0.01200849562883377,
-9.792257324853365e-34,
-0.01542231347411871,
-0.12448662519454956,
0.047876354306936264,
-0.013414193876087666,
0.031418196856975555,
0.06467301398515701,
0.023474711924791336,
0.018068797886371613,
-0.047008316963911057,
0.012781770899891853,
-0.046580951660871506,
0.06255736202001572,
-0.14544251561164856,
-0.0692826509475708,
-0.028440896421670914,
0.007898975163698196,
0.00822618417441845,
0.047980912029743195,
0.003850464476272464,
-0.03210749104619026,
0.03543413057923317,
-0.018888458609580994,
-0.016831127926707268,
0.03716978803277016,
-0.019650785252451897,
-0.04020192474126816,
0.023111490532755852,
-0.061378348618745804,
-0.09987512230873108,
0.015090515837073326,
0.031107967719435692,
0.04658172279596329,
-0.012583184987306595,
-0.06731104105710983,
0.026090718805789948,
-0.0014103392604738474,
0.009307187981903553,
0.08338196575641632,
-0.06230355426669121,
0.02860584668815136,
-0.03700811415910721,
-0.014369305223226547,
0.02713254652917385,
-0.07022586464881897,
-0.07144234329462051,
0.020393213257193565,
0.03441012278199196,
0.030292561277747154,
0.04620307311415672,
0.014006603509187698,
-0.06753461807966232,
0.02824331633746624,
0.062386929988861084,
-0.011211177334189415,
0.013982904143631458,
0.0034822658635675907,
-0.01044260524213314,
0.0784771665930748,
0.017479324713349342,
-0.022763656452298164,
-0.02238995023071766,
0.05467652529478073,
-0.035118091851472855,
0.015301142819225788,
0.042203955352306366,
0.03547421097755432,
0.022870637476444244,
0.08968013525009155,
0.04904327169060707,
0.07869003713130951,
0.00005661019167746417,
0.07287213951349258,
0.0725875273346901,
0.0041369907557964325,
0.047833267599344254,
-0.10270635783672333,
0.032962873578071594,
0.06722602248191833,
0.019216280430555344,
-0.03375206142663956,
0.010496688075363636,
0.015546065755188465,
-0.011458655819296837,
0.02456066757440567,
0.05373194068670273,
-0.0028027535881847143,
-0.0585881769657135,
0.04087803512811661,
-0.11516748368740082,
-0.025066016241908073,
-0.04894426465034485,
-0.03251801058650017,
-0.08589673787355423,
-0.061388127505779266,
-0.03788279742002487,
-2.838965059345708e-33,
0.00716702826321125,
0.06258777529001236,
0.08376257866621017,
0.059959735721349716,
0.055339738726615906,
-0.04188600182533264,
0.037126168608665466,
-0.05807698145508766,
0.06385689228773117,
0.0527411550283432,
-0.05482605844736099,
-0.0032220035791397095,
0.02998083271086216,
-0.05867987871170044,
-0.01508684828877449,
0.06975623220205307,
-0.0987643450498581,
-0.09353089332580566,
0.041954267770051956,
-0.007328354753553867,
-0.039637863636016846,
0.017196252942085266,
-0.012954617850482464,
0.11221862584352493,
-0.04381223022937775,
-0.03426660597324371,
-0.049612175673246384,
0.034953437745571136,
-0.0361715704202652,
-0.012534147128462791,
0.0048746676184237,
-0.0004330016381572932,
-0.04746660590171814,
-0.017426850274205208,
-0.05115252360701561,
-0.14538127183914185,
0.022226573899388313,
-0.0028140151407569647,
-0.029536327347159386,
-0.010178772732615471,
-0.04415414109826088,
-0.07877010107040405,
-0.021144283935427666,
-0.03299364447593689,
0.05188577249646187,
0.07265908271074295,
0.14370907843112946,
0.014733118005096912,
-0.03526877611875534,
-0.07411663979291916,
0.00930778682231903,
0.045488979667425156,
-0.06655097752809525,
0.13500089943408966,
0.0050897179171442986,
-0.018109340220689774,
-0.04950321838259697,
-0.022908354178071022,
-0.011523722670972347,
-0.036272380501031876,
0.013838279992341995,
-0.06196201965212822,
0.007302379701286554,
0.027531810104846954,
-0.0019749936182051897,
-0.030541807413101196,
-0.035162121057510376,
-0.04095795378088951,
-0.011023567989468575,
0.047285422682762146,
0.014475012198090553,
-0.020880570635199547,
0.1865784227848053,
-0.05771894380450249,
-0.014031339436769485,
0.030329182744026184,
0.011587449349462986,
-0.06168118119239807,
0.11907108128070831,
0.0422673374414444,
-0.06736011803150177,
0.030647551640868187,
0.021029723808169365,
0.07793959975242615,
0.0015289155999198556,
-0.05020290985703468,
0.05087641626596451,
0.09605251252651215,
-0.006732256151735783,
0.010378614068031311,
-0.029003217816352844,
-0.03618083521723747,
0.01485474407672882,
-0.024416906759142876,
0.0009356656228192151,
-4.6986034618612393e-8,
-0.026037918403744698,
0.011966262012720108,
-0.10260811448097229,
-0.016174934804439545,
-0.002683451399207115,
0.03884277120232582,
-0.007430515252053738,
0.12112265825271606,
-0.04121345654129982,
0.007046903017908335,
0.050058308988809586,
-0.011012386530637741,
-0.03297526761889458,
0.03771403431892395,
-0.07603972405195236,
-0.06419439613819122,
-0.012735513038933277,
0.06372092664241791,
0.0165689866989851,
-0.05570513755083084,
0.005317320115864277,
0.011739793233573437,
0.04373890534043312,
-0.0042921691201627254,
0.056373488157987595,
-0.014249157160520554,
-0.0121918311342597,
-0.035332344472408295,
0.062050655484199524,
-0.018773704767227173,
-0.021718736737966537,
-0.03501742333173752,
0.01405323576182127,
0.0409652441740036,
-0.01813303492963314,
-0.06037250533699989,
-0.033905234187841415,
0.0703292265534401,
-0.009334254078567028,
-0.007193466182798147,
0.0349859893321991,
0.050040218979120255,
-0.06936697661876678,
0.031476281583309174,
0.0199668537825346,
0.05758512765169144,
-0.0531611405313015,
0.09582190215587616,
0.019711649045348167,
0.015913184732198715,
0.03250237554311752,
-0.07630417495965958,
-0.0184234119951725,
-0.02870720624923706,
0.05201410874724388,
-0.07846765220165253,
0.03558475896716118,
-0.051178399473428726,
0.03071870282292366,
0.044094495475292206,
0.057509712874889374,
-0.019272470846772194,
-0.04325486347079277,
0.0021904355380684137
] | -0.061765
|
[[search-aggregations-pipeline-bucket-sort-aggregation]] === Bucket Sort Aggregation A parent pipeline aggregation which sorts the buckets of its parent multi-bucket aggregation. Zero or more sort fields may be specified together with the corresponding sort order. Each bucket may be sorted based on its `\_key`, `\_count` or its sub-aggregations. In addition, parameters `from` and `size` may be set in order to truncate the result buckets. NOTE: The `bucket\_sort` aggregation, like all pipeline aggregations, is executed after all other non-pipeline aggregations. This means the sorting only applies to whatever buckets are already returned from the parent aggregation. For example, if the parent aggregation is `terms` and its `size` is set to `10`, the `bucket\_sort` will only sort over those 10 returned term buckets. ==== Syntax A `bucket\_sort` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "bucket\_sort": { "sort": [ {"sort\_field\_1": {"order": "asc"}},<1> {"sort\_field\_2": {"order": "desc"}}, "sort\_field\_3" ], "from": 1, "size": 3 } } -------------------------------------------------- // NOTCONSOLE <1> Here, `sort\_field\_1` is the bucket path to the variable to be used as the primary sort and its order is ascending. [[bucket-sort-params]] .`bucket\_sort` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`sort` |The list of fields to sort on. See <> for more details. |Optional | |`from` |Buckets in positions prior to the set value will be truncated. |Optional | `0` |`size` |The number of buckets to return. Defaults to all buckets of the parent aggregation. |Optional | |`gap\_policy` |The policy to apply when gaps are found in the data (see <> for more details)|Optional |`skip` |=== The following snippet returns the buckets corresponding to the 3 months with the highest total sales in descending order: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "total\_sales": { "sum": { "field": "price" } }, "sales\_bucket\_sort": { "bucket\_sort": { "sort": [ {"total\_sales": {"order": "desc"}}<1> ], "size": 3<2> } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `sort` is set to use the values of `total\_sales` in descending order <2> `size` is set to `3` meaning only the top 3 months in `total\_sales` will be returned And the following may be the response: [source,js] -------------------------------------------------- { "took": 82, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "total\_sales": { "value": 550.0 } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "total\_sales": { "value": 375.0 }, }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "total\_sales": { "value": 60.0 }, } ] } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 82/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/] ==== Truncating without sorting It is also possible to use this aggregation in order to truncate the result buckets without doing any sorting. To do so, just use the `from` and/or `size` parameters without specifying `sort`. The following example simply truncates the result so that only the second bucket is returned: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "bucket\_truncate": { "bucket\_sort": { "from": 1, "size": 1 } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] Response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2 } ] } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/bucket-sort-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.038399048149585724,
0.011880679056048393,
0.06717491894960403,
0.015303906984627247,
-0.017131293192505836,
-0.016434913501143456,
-0.03775715082883835,
0.015750816091895103,
0.09243124723434448,
-0.015975847840309143,
-0.03760360926389694,
0.050851985812187195,
-0.013246064074337482,
-0.04747416824102402,
-0.09017879515886307,
0.045844994485378265,
-0.06532400846481323,
0.03233865275979042,
-0.09952405095100403,
-0.18374985456466675,
0.0347515270113945,
0.012051797471940517,
-0.03387763351202011,
-0.08133817464113235,
0.0299508236348629,
0.030046438798308372,
-0.11436416953802109,
-0.0342421680688858,
0.048815157264471054,
-0.033715371042490005,
-0.03122170828282833,
0.03803225979208946,
0.035695724189281464,
0.07700687646865845,
-0.030215155333280563,
0.01462564617395401,
-0.03201967477798462,
-0.02893166057765484,
0.03849503770470619,
0.0009577089222148061,
0.013068543747067451,
0.05520913377404213,
0.021134579554200172,
-0.15609396994113922,
-0.015119314193725586,
0.006711205467581749,
-0.08829235285520554,
-0.07518838346004486,
-0.0578819215297699,
-0.000593754812143743,
-0.05199483782052994,
-0.0031553369481116533,
-0.05335596576333046,
0.07684450596570969,
-0.027300231158733368,
0.043597329407930374,
-0.06360518932342529,
-0.032432831823825836,
-0.007993732579052448,
-0.025255119428038597,
-0.10784055292606354,
-0.03786338120698929,
0.02189416065812111,
-0.02098838798701763,
0.08537089079618454,
-0.01749398559331894,
0.09152965247631073,
0.015659630298614502,
0.028978360816836357,
0.04493848606944084,
0.07609648257493973,
-0.016416022554039955,
-0.03876356780529022,
-0.06253332644701004,
0.017579874023795128,
0.0407971516251564,
-0.02062215469777584,
0.019464105367660522,
-0.05098794773221016,
0.029346056282520294,
-0.09740263223648071,
-0.05358253791928291,
-0.025232622399926186,
-0.002384949242696166,
-0.008915195241570473,
-0.04576015844941139,
-0.04378746449947357,
-0.10779552906751633,
0.08406754583120346,
0.0056181675754487514,
-0.13725408911705017,
-0.06680457293987274,
0.038527585566043854,
0.07383086532354355,
0.045452315360307693,
-0.008072009310126305,
0.04416411742568016,
-0.007041851058602333,
0.04739505052566528,
-0.006775697693228722,
-0.012501106597483158,
0.020159956067800522,
0.06697610020637512,
-0.0772567018866539,
0.019130662083625793,
0.006078704725950956,
-0.09816597402095795,
0.021948060020804405,
-0.028482649475336075,
0.023863203823566437,
0.010946854948997498,
0.00827933568507433,
0.024154387414455414,
0.058349866420030594,
-0.05717797204852104,
0.05377122014760971,
0.02091858722269535,
-0.04155902937054634,
0.002357679884880781,
-0.00920437928289175,
0.08626320958137512,
0.04775940626859665,
-0.0022912421263754368,
-0.013891017995774746,
0.021855827420949936,
0.108650803565979,
0.03481125086545944,
5.760096439129924e-33,
-0.00011684642231557518,
-0.050254885107278824,
0.10862038284540176,
-0.047729045152664185,
0.021650411188602448,
0.09683969616889954,
0.012337354943156242,
0.029469937086105347,
-0.10800938308238983,
0.05561389774084091,
-0.013492143712937832,
0.13966920971870422,
-0.09446262568235397,
-0.04755782335996628,
-0.045149482786655426,
-0.05051650106906891,
0.0652293711900711,
0.0188409723341465,
-0.03166734427213669,
-0.0037796238902956247,
-0.006476223468780518,
0.0030641299672424793,
-0.0476238988339901,
0.013886520639061928,
0.014776220545172691,
-0.06683392822742462,
-0.017825555056333542,
-0.052126552909612656,
-0.05755923315882683,
0.008853879757225513,
-0.0645391121506691,
0.04614702984690666,
-0.024647917598485947,
-0.04798135533928871,
0.07334931939840317,
-0.007228785194456577,
0.0012663461966440082,
0.039009518921375275,
-0.026190824806690216,
-0.019788021221756935,
0.017828308045864105,
-0.01986241713166237,
-0.033390164375305176,
-0.1286390721797943,
-0.05467597395181656,
-0.004214351065456867,
0.02172301895916462,
-0.015296146273612976,
0.07872816920280457,
0.04944911226630211,
-0.05733627825975418,
-0.00965064112097025,
0.0887676551938057,
0.055111173540353775,
0.09459828585386276,
-0.044688351452350616,
0.052267976105213165,
0.057319965213537216,
-0.03378453105688095,
0.01879550889134407,
0.0013583869440481067,
0.012461141683161259,
-0.030719736590981483,
0.01850215345621109,
0.017487045377492905,
-0.043742526322603226,
0.039537884294986725,
0.12042617797851562,
0.08906242996454239,
0.050219640135765076,
0.007330178748816252,
0.13354168832302094,
0.017335714772343636,
0.06742310523986816,
0.06609157472848892,
-0.04341166839003563,
0.04491959139704704,
-0.008596336469054222,
-0.004123050253838301,
-0.04203539341688156,
0.014250654727220535,
0.016692353412508965,
0.03611665219068527,
0.05727160722017288,
-0.041036300361156464,
0.0786559134721756,
-0.053845178335905075,
0.04924360290169716,
-0.06450917571783066,
-0.06169417127966881,
-0.07911478728055954,
-0.00806998461484909,
-0.03112325444817543,
-0.024021049961447716,
-0.025088656693696976,
-7.298549650023548e-33,
0.030362438410520554,
0.029655396938323975,
0.020071586593985558,
0.06737577170133591,
0.04338797554373741,
-0.09790695458650589,
0.029971294105052948,
-0.02647225931286812,
0.047975607216358185,
-0.009650493040680885,
-0.04075911268591881,
0.028926555067300797,
0.03827529773116112,
-0.0434979572892189,
0.09550164639949799,
0.03034527413547039,
-0.08727206289768219,
-0.1209433302283287,
-0.01171928271651268,
-0.008891633711755276,
-0.020435580983757973,
-0.010407770052552223,
0.012938199564814568,
0.09211070835590363,
-0.08366266638040543,
-0.0030335946939885616,
0.023963769897818565,
-0.01524035818874836,
0.0016954997554421425,
0.018057920038700104,
0.03079778142273426,
0.003077093744650483,
-0.017325662076473236,
-0.03842531889677048,
-0.08214455097913742,
-0.1240115612745285,
0.029543153941631317,
0.08023020625114441,
-0.008387258276343346,
0.011155466549098492,
-0.06492317467927933,
-0.012384296394884586,
0.012978887185454369,
-0.042872555553913116,
0.03993506729602814,
0.019999871030449867,
0.055774491280317307,
0.042290303856134415,
-0.018705356866121292,
-0.05871787294745445,
-0.010149753652513027,
0.0766105204820633,
-0.08554018288850784,
0.07656561583280563,
-0.03977244719862938,
-0.039983343333005905,
-0.010412156581878662,
0.01887141540646553,
-0.06840382516384125,
-0.045457929372787476,
0.012672396376729012,
-0.020204240456223488,
0.027884414419531822,
-0.03833289444446564,
-0.062240950763225555,
-0.011364688165485859,
-0.07328277826309204,
-0.05396612733602524,
-0.012083284556865692,
0.017710668966174126,
0.03945447504520416,
-0.07172473520040512,
0.08038851618766785,
0.015346383675932884,
-0.021611584350466728,
-0.01738278940320015,
-0.0020870366133749485,
-0.015537380240857601,
0.11933601647615433,
-0.03270336985588074,
-0.02973630651831627,
0.05999436974525452,
0.03301287442445755,
0.10438217967748642,
0.02182493358850479,
-0.019185513257980347,
0.050472695380449295,
0.038450825959444046,
-0.011775226332247257,
0.06649060547351837,
-0.0020492852199822664,
-0.0625026747584343,
-0.014818510971963406,
-0.022817064076662064,
0.0036064768210053444,
-5.1374371423662524e-8,
-0.008098307065665722,
-0.0486658550798893,
-0.08188585937023163,
0.05507192015647888,
0.0014072154881432652,
-0.051539670675992966,
0.0667743906378746,
0.16110265254974365,
-0.0243009552359581,
0.007920986972749233,
0.04420822113752365,
0.06800124794244766,
-0.07459751516580582,
0.04107479751110077,
0.024370400235056877,
0.026497213169932365,
-0.02265116386115551,
-0.033557336777448654,
-0.031563468277454376,
-0.07008096575737,
-0.05605452135205269,
-0.014498266391456127,
0.04325978830456734,
-0.0007681534625589848,
0.006875044200569391,
-0.009295501746237278,
0.04752565920352936,
0.051713570952415466,
0.02644149400293827,
-0.01644744724035263,
-0.025996008887887,
0.03531678020954132,
-0.002765860641375184,
-0.024566570296883583,
-0.0013096455950289965,
-0.02019082009792328,
-0.05951303616166115,
-0.014448112808167934,
-0.019193800166249275,
-0.031757015734910965,
-0.007102153263986111,
0.043738968670368195,
0.0046978844329714775,
0.021201688796281815,
0.00016400369349867105,
0.012075466103851795,
0.009967351332306862,
0.06506304442882538,
0.06846051663160324,
0.016770746558904648,
-0.00956185907125473,
-0.05406162515282631,
-0.05239024758338928,
0.028307218104600906,
0.02691013738512993,
-0.008496587164700031,
0.01077102031558752,
-0.036861684173345566,
0.03416121378540993,
0.005547126289457083,
0.0798254981637001,
-0.04594585299491882,
-0.021966705098748207,
-0.007880915887653828
] | -0.003083
|
"buckets": [ { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2 } ] } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/bucket-sort-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.04720542952418327,
0.07388408482074738,
0.057574111968278885,
0.02453118935227394,
-0.024943556636571884,
-0.012317939661443233,
0.015493690967559814,
0.023457223549485207,
0.1194959506392479,
0.02233177423477173,
0.0034982729703187943,
-0.05732516571879387,
0.04136908799409866,
-0.0043997010216116905,
0.007362721487879753,
-0.02490287274122238,
-0.09455013275146484,
-0.003990990575402975,
-0.05478217452764511,
-0.03685157373547554,
0.03957618772983551,
0.0543314665555954,
0.0016210641479119658,
-0.028442615643143654,
-0.03474034368991852,
0.03507891669869423,
-0.09615371376276016,
0.015422007068991661,
0.015084381215274334,
0.027960559353232384,
0.07506537437438965,
-0.05257090553641319,
-0.004470778163522482,
0.02602582424879074,
0.08951030671596527,
0.047203660011291504,
0.0718979761004448,
-0.07205229997634888,
0.0074660335667431355,
0.01515950821340084,
0.019757607951760292,
-0.0661277249455452,
-0.04975629597902298,
-0.050310008227825165,
0.03588474541902542,
-0.004398773889988661,
-0.03590192273259163,
0.0003435658582020551,
-0.04331997409462929,
0.014758237637579441,
-0.047022584825754166,
-0.07357907295227051,
-0.023315275087952614,
0.057691577821969986,
0.015165431424975395,
0.03478392958641052,
-0.07225657254457474,
0.015542590990662575,
-0.01593097485601902,
-0.1295638233423233,
0.05229486525058746,
-0.12489251047372818,
0.008564439602196217,
-0.06345522403717041,
-0.035741277039051056,
-0.011319133453071117,
-0.009250067174434662,
0.025981739163398743,
0.04418128728866577,
0.03650015965104103,
-0.011898312717676163,
0.03803171589970589,
-0.034364014863967896,
0.012557021342217922,
0.02346283569931984,
0.03435460478067398,
-0.0777662917971611,
-0.030631273984909058,
-0.00021763295808341354,
-0.025363605469465256,
-0.08440496772527695,
-0.1432669460773468,
0.002939982106909156,
0.03332565724849701,
0.00007760378503007814,
0.018357258290052414,
-0.02221834473311901,
0.038873277604579926,
-0.036740947514772415,
-0.04066714271903038,
-0.11473536491394043,
-0.02502848394215107,
0.10383116453886032,
-0.0002821424277499318,
0.018284296616911888,
0.07881762087345123,
-0.05024450644850731,
0.001957788597792387,
0.09389757364988327,
0.05252835899591446,
0.0052760750986635685,
0.043169792741537094,
-0.01615688018500805,
-0.07131179422140121,
-0.013679218478500843,
0.06242222338914871,
-0.09433111548423767,
0.040237098932266235,
-0.04450896382331848,
0.020645728334784508,
0.031636036932468414,
0.04812052473425865,
-0.004880082793533802,
0.01158789824694395,
0.0021369592286646366,
0.0074560875073075294,
0.003723668633028865,
-0.04024562984704971,
0.020935462787747383,
0.04131875932216644,
0.1495307981967926,
-0.012413456104695797,
-0.01119711808860302,
-0.013229857198894024,
-0.020097186788916588,
-0.015309329144656658,
0.043203629553318024,
1.0315389045167746e-33,
0.06317032873630524,
-0.029737936332821846,
0.059784866869449615,
-0.06304538995027542,
0.03987221047282219,
0.011041860096156597,
0.022306429222226143,
0.10180535167455673,
0.042256906628608704,
0.02326313965022564,
-0.10001891851425171,
-0.03214552253484726,
0.023718249052762985,
-0.13644495606422424,
-0.011536210775375366,
-0.011005113832652569,
0.008688054047524929,
0.030054036527872086,
-0.01920136995613575,
0.0010655006626620889,
0.017057685181498528,
-0.02680039405822754,
-0.01534945797175169,
-0.013106275349855423,
-0.010900450870394707,
-0.02961702086031437,
-0.027093075215816498,
-0.07694946974515915,
-0.026150232180953026,
-0.02618287317454815,
0.042941946536302567,
-0.030201608315110207,
-0.03883339837193489,
0.00010498196934349835,
0.0913744866847992,
0.025853941217064857,
0.032881349325180054,
0.0364803820848465,
-0.09617157280445099,
-0.0063646771013736725,
-0.013559222221374512,
-0.027552403509616852,
0.01702728495001793,
-0.009967638179659843,
-0.053730275481939316,
0.003377103479579091,
-0.05881691724061966,
-0.039699893444776535,
0.020003609359264374,
0.013010529801249504,
-0.0057905614376068115,
0.03464231640100479,
0.03417176380753517,
-0.01401619054377079,
0.0066910674795508385,
-0.016072669997811317,
-0.029503928497433662,
0.02907581813633442,
-0.05152811110019684,
0.018236804753541946,
0.015304598025977612,
0.06083428114652634,
0.05486057326197624,
0.031455207616090775,
0.04141179472208023,
-0.02237839438021183,
0.04906128719449043,
0.07749401777982712,
-0.0051111760549247265,
0.08831441402435303,
0.02143946848809719,
0.10819606482982635,
-0.013714476488530636,
0.004757072776556015,
-0.022795863449573517,
-0.11092094331979752,
0.04063322767615318,
-0.014062914997339249,
-0.009109236299991608,
0.03790530189871788,
0.06057098135352135,
-0.07119575142860413,
-0.012931065633893013,
0.04891347140073776,
-0.07495296746492386,
0.09810251742601395,
-0.013838556595146656,
-0.053524818271398544,
-0.05033868923783302,
-0.10814759135246277,
-0.04531180113554001,
-0.055448517203330994,
-0.09913124144077301,
-0.12820114195346832,
-0.06505893170833588,
-1.683271359850045e-33,
0.09869644045829773,
-0.0004249984922353178,
0.0037499871104955673,
0.07199104130268097,
0.07023610919713974,
-0.04767533391714096,
0.08330590277910233,
0.048319946974515915,
0.016051018610596657,
0.04467473924160004,
0.03789963573217392,
-0.05903581157326698,
-0.012855520471930504,
-0.031092926859855652,
0.017771292477846146,
0.006876848172396421,
-0.05666417255997658,
-0.13603372871875763,
0.010754615068435669,
-0.07073765248060226,
-0.04997582733631134,
0.02173800580203533,
0.016676386818289757,
0.06807192414999008,
-0.07117165625095367,
-0.02290336787700653,
0.010976874269545078,
-0.05490013584494591,
-0.04146396741271019,
0.03559938445687294,
0.022614736109972,
0.03392171487212181,
-0.005479243118315935,
0.012756336480379105,
-0.033138785511255264,
-0.07449402660131454,
0.026948323473334312,
0.06555905938148499,
0.010686351917684078,
0.023457294330000877,
0.04672982543706894,
0.022689690813422203,
-0.044465113431215286,
0.01052761822938919,
0.005970243830233812,
0.03344430774450302,
0.05171697586774826,
0.10251706838607788,
-0.046694543212652206,
-0.01413674559444189,
0.013590232469141483,
-0.03125978261232376,
-0.09255882352590561,
0.07975629717111588,
0.0300768930464983,
-0.028672542423009872,
-0.019282087683677673,
-0.07148689031600952,
-0.11572835594415665,
-0.0227721706032753,
-0.043729301542043686,
0.07171925157308578,
0.011386765167117119,
0.07039155066013336,
0.04988794028759003,
-0.06295908242464066,
-0.05666770040988922,
-0.1048661470413208,
-0.08294782042503357,
-0.04459619149565697,
0.007114098872989416,
-0.017770783975720406,
-0.003496954683214426,
0.01757625676691532,
0.06536158174276352,
-0.012699971906840801,
-0.06998705118894577,
0.03290112316608429,
0.03133796900510788,
0.07568281143903732,
-0.05681825801730156,
0.009041320532560349,
0.021194037050008774,
0.13931626081466675,
0.01794951781630516,
-0.01363026350736618,
-0.0029877631459385157,
0.0660889521241188,
-0.04829084873199463,
0.01479602511972189,
-0.010817683301866055,
0.04761940985918045,
-0.027547167614102364,
0.013449343852698803,
0.04102281108498573,
-4.0344001916992056e-8,
-0.049887239933013916,
0.028362246230244637,
-0.07052502781152725,
0.03422015905380249,
-0.05553930997848511,
0.0894620344042778,
0.019629785791039467,
0.07751837372779846,
-0.02894345298409462,
-0.0521744079887867,
0.020987816154956818,
-0.04790705442428589,
-0.02345075085759163,
-0.06253084540367126,
-0.0930052176117897,
0.0017962277634069324,
-0.009132747538387775,
0.03574705123901367,
-0.031194668263196945,
-0.035656191408634186,
0.05308683216571808,
0.000413690839195624,
0.03986736014485359,
-0.06150570511817932,
0.035440217703580856,
0.06815651804208755,
-0.014276229776442051,
0.057391952723264694,
-0.04567652568221092,
-0.059361089020967484,
0.036709316074848175,
-0.0295292679220438,
0.002633910859003663,
-0.05705776438117027,
-0.015598381869494915,
0.013738897629082203,
-0.0241496991366148,
0.047769345343112946,
-0.05397611856460571,
0.08534519374370575,
0.011523736640810966,
0.03564354032278061,
-0.04794323071837425,
0.055943116545677185,
0.014501736499369144,
-0.09528054296970367,
0.0048059565015137196,
0.11458202451467514,
0.042507193982601166,
-0.012421605177223682,
0.03432951867580414,
-0.0542941577732563,
0.0411737821996212,
-0.021026790142059326,
-0.056349292397499084,
0.02538938634097576,
0.10645013302564621,
-0.023965001106262207,
-0.0618862509727478,
0.08385974168777466,
0.13450458645820618,
-0.016775602474808693,
-0.02948019467294216,
0.04628019034862518
] | -0.0042
|
[[search-aggregations-pipeline-cumulative-sum-aggregation]] === Cumulative Sum Aggregation A parent pipeline aggregation which calculates the cumulative sum of a specified metric in a parent histogram (or date\_histogram) aggregation. The specified metric must be numeric and the enclosing histogram must have `min\_doc\_count` set to `0` (default for `histogram` aggregations). ==== Syntax A `cumulative\_sum` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "cumulative\_sum": { "buckets\_path": "the\_sum" } } -------------------------------------------------- // NOTCONSOLE [[cumulative-sum-params]] .`cumulative\_sum` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`buckets\_path` |The path to the buckets we wish to find the cumulative sum for (see <> for more details) |Required | |`format` |format to apply to the output value of this aggregation |Optional |`null` |=== The following snippet calculates the cumulative sum of the total monthly `sales`: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } }, "cumulative\_sales": { "cumulative\_sum": { "buckets\_path": "sales" <1> } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `buckets\_path` instructs this cumulative sum aggregation to use the output of the `sales` aggregation for the cumulative sum And the following may be the response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "sales": { "value": 550.0 }, "cumulative\_sales": { "value": 550.0 } }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "sales": { "value": 60.0 }, "cumulative\_sales": { "value": 610.0 } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "sales": { "value": 375.0 }, "cumulative\_sales": { "value": 985.0 } } ] } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/cumulative-sum-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.01438720803707838,
0.022076552733778954,
0.01808137819170952,
0.040592361241579056,
-0.10085710883140564,
0.03122512251138687,
-0.01717287488281727,
0.0697212889790535,
0.056051142513751984,
-0.038291215896606445,
-0.061471253633499146,
-0.12065793573856354,
0.04758452624082565,
-0.019468553364276886,
-0.05467519909143448,
0.009994087740778923,
-0.06591811031103134,
0.010388944298028946,
-0.026028631255030632,
-0.1966654509305954,
0.0017358243931084871,
0.02734612487256527,
-0.009552927687764168,
-0.10571208596229553,
0.0641830638051033,
0.007519581820815802,
-0.10820277780294418,
-0.06795447319746017,
0.03721733018755913,
0.06216869875788689,
-0.005221778526902199,
0.010600055567920208,
0.041188567876815796,
0.03424225002527237,
0.014251410029828548,
0.03444904461503029,
-0.034665316343307495,
0.01813436485826969,
0.040929004549980164,
0.01373536977916956,
0.026180192828178406,
0.06061716750264168,
-0.03377895429730415,
-0.12703661620616913,
0.006510536652058363,
-0.07759417593479156,
-0.08991380035877228,
-0.06879711896181107,
-0.014371701516211033,
0.03792412206530571,
-0.032456040382385254,
0.015818452462553978,
-0.004668595269322395,
-0.03379824757575989,
0.022899888455867767,
0.035404425114393234,
-0.01703859306871891,
-0.056745801120996475,
0.032936688512563705,
-0.0961708277463913,
-0.02655845694243908,
-0.06397124379873276,
-0.010658632032573223,
-0.004890614189207554,
0.10498788207769394,
-0.02066790498793125,
0.00788865052163601,
0.07473722100257874,
-0.002037965226918459,
0.09534464031457901,
0.024764681234955788,
0.04604262113571167,
0.039598558098077774,
-0.01047730166465044,
0.04538005217909813,
0.016322549432516098,
0.009889747947454453,
0.05273209512233734,
0.04547225683927536,
-0.03291478380560875,
-0.07856528460979462,
-0.047764625400304794,
0.019139142706990242,
0.06415068358182907,
-0.012949945405125618,
0.003893351648002863,
-0.013899396173655987,
-0.05944943055510521,
0.08783227950334549,
-0.05239517241716385,
-0.0761500895023346,
-0.029098352417349815,
-0.01807413622736931,
0.008110265247523785,
0.00911025796085596,
0.0283783171325922,
-0.032449424266815186,
-0.003522454760968685,
0.09101872146129608,
0.013613231480121613,
0.02589934878051281,
0.00035231781657785177,
-0.014138108119368553,
-0.07280689477920532,
-0.014462984167039394,
0.0580325648188591,
-0.0339941643178463,
0.05010998621582985,
-0.07925352454185486,
0.015481793321669102,
0.04677091911435127,
-0.03966432809829712,
0.03242073208093643,
-0.02551506832242012,
-0.006758197210729122,
0.052642643451690674,
0.033001940697431564,
-0.05407519266009331,
0.03042522631585598,
0.02095947042107582,
0.0837191715836525,
0.033298708498477936,
-0.010852179490029812,
-0.017655055969953537,
-0.032952480018138885,
-0.030910328030586243,
0.013969533145427704,
-8.186324493408803e-34,
-0.009773867204785347,
-0.12546835839748383,
0.05716375634074211,
-0.07585206627845764,
0.01087738387286663,
0.037146277725696564,
0.0046125976368784904,
0.033896543085575104,
-0.0847664549946785,
0.0339367538690567,
-0.03842140734195709,
0.11845149099826813,
-0.12707015872001648,
-0.06594745069742203,
-0.056915368884801865,
0.020347386598587036,
0.015099656768143177,
0.034841012209653854,
0.013980484567582607,
-0.04588734358549118,
-0.005738241132348776,
-0.03962136059999466,
0.00947732012718916,
0.038177747279405594,
0.02878878265619278,
-0.035586725920438766,
0.003911952953785658,
-0.034228790551424026,
-0.10601186007261276,
0.014680645428597927,
-0.04048463702201843,
0.040271636098623276,
-0.010788996703922749,
-0.05466323345899582,
0.03399662300944328,
-0.04776214435696602,
0.019105220213532448,
0.07262551039457321,
-0.036724526435136795,
0.010973511263728142,
0.026594338938593864,
0.012673884630203247,
-0.02911805920302868,
-0.11435019224882126,
-0.10294536501169205,
0.017983026802539825,
0.001838787691667676,
-0.0034253299236297607,
0.051819976419210434,
0.07056376338005066,
-0.025672147050499916,
0.03253403678536415,
0.009783186949789524,
-0.018733326345682144,
0.028366392478346825,
0.014104552567005157,
0.03506280481815338,
0.08385305851697922,
0.04087520390748978,
0.036415550857782364,
-0.015084289014339447,
0.03211606666445732,
0.0043308790773153305,
0.05555287376046181,
0.0060318526811897755,
0.03557712584733963,
0.03333320468664169,
0.09896770119667053,
0.04801956191658974,
0.08135925978422165,
-0.0002911966585088521,
0.08417893946170807,
0.012340975925326347,
0.023330610245466232,
0.11260058730840683,
-0.11377525329589844,
0.062246933579444885,
0.014223440550267696,
-0.0583624392747879,
-0.01032737735658884,
-0.007727558724582195,
-0.04929255694150925,
-0.01499827578663826,
0.020727304741740227,
0.0030259282793849707,
0.11047738790512085,
-0.015273056924343109,
0.04563746973872185,
-0.11733657121658325,
-0.05025049299001694,
-0.052055757492780685,
-0.040454182773828506,
-0.1137814074754715,
-0.03272078558802605,
-0.004330873489379883,
-3.739260386935159e-33,
-0.0033136254642158747,
0.10334943979978561,
0.07363758981227875,
0.021801363676786423,
0.0417327918112278,
-0.03782318904995918,
0.07274072617292404,
-0.01264606136828661,
0.10488524287939072,
0.07930641621351242,
-0.026655593886971474,
0.012623244896531105,
-0.0004688641638495028,
-0.0478210523724556,
-0.013645164668560028,
0.04499939829111099,
-0.05808050557971001,
-0.09971792250871658,
-0.016663989052176476,
0.0019189806189388037,
-0.037079233676195145,
0.04786732420325279,
-0.033618632704019547,
0.09261556714773178,
-0.048872821033000946,
-0.015289021655917168,
-0.03997715935111046,
-0.00972585380077362,
-0.03544224426150322,
0.013039533980190754,
0.024769771844148636,
-0.035981759428977966,
-0.064372219145298,
-0.010501474142074585,
-0.08246970921754837,
-0.10313006490468979,
0.03669549524784088,
0.01418469287455082,
-0.038654908537864685,
-0.03140506148338318,
-0.014962438493967056,
-0.028030604124069214,
-0.006014637649059296,
-0.05125246196985245,
0.05899421498179436,
0.05731963366270065,
0.06172577291727066,
0.017527002841234207,
0.010819509625434875,
-0.08073734492063522,
-0.009512562304735184,
0.009249917231500149,
-0.06306231021881104,
0.15284839272499084,
-0.029754845425486565,
0.012869908474385738,
0.015675809234380722,
-0.06663293391466141,
-0.05561290681362152,
-0.027713844552636147,
-0.035206183791160583,
-0.10207746177911758,
-0.022710874676704407,
-0.02599376253783703,
-0.026598474010825157,
-0.05674785375595093,
-0.04588242992758751,
-0.06438980996608734,
-0.03623809292912483,
0.015489181503653526,
0.023665552958846092,
0.023954031988978386,
0.12216413766145706,
-0.022005509585142136,
-0.03778838738799095,
0.061880722641944885,
0.020365897566080093,
-0.0434940904378891,
0.0627809688448906,
0.02012406848371029,
-0.07505515217781067,
0.015429895371198654,
0.09041760861873627,
0.05434324964880943,
-0.011943149380385876,
-0.017026562243700027,
0.024752959609031677,
0.03106246516108513,
-0.02642853558063507,
0.0981680303812027,
-0.050713423639535904,
-0.04349660873413086,
-0.02722007781267166,
-0.052594102919101715,
0.010895108804106712,
-5.0358071490563816e-8,
-0.06732441484928131,
-0.023108182474970818,
-0.09865697473287582,
-0.025883890688419342,
0.04828687012195587,
0.009691729210317135,
0.014462131075561047,
0.08934461325407028,
-0.03186587244272232,
-0.025486230850219727,
0.04664599150419235,
0.0072512077167630196,
-0.05607219040393829,
0.05647234618663788,
-0.09342572838068008,
-0.0347251296043396,
0.013963708654046059,
0.036450792104005814,
0.0041247340850532055,
-0.08796555548906326,
0.02443397045135498,
-0.011143626645207405,
0.08427391946315765,
-0.02833569049835205,
-0.04089809209108353,
-0.01973898336291313,
-0.0029800443444401026,
0.030357321724295616,
0.044749848544597626,
-0.04308345913887024,
-0.019873639568686485,
0.003403404960408807,
-0.018695028498768806,
0.003799131140112877,
-0.020874936133623123,
-0.0352405421435833,
0.010726628825068474,
0.03454829379916191,
-0.05066966265439987,
0.023834919556975365,
0.03121100179851055,
0.04799506068229675,
-0.058440882712602615,
0.051062650978565216,
-0.008080109022557735,
0.034872282296419144,
-0.057289768010377884,
0.06009107455611229,
0.030763424932956696,
-0.0254514180123806,
0.05408652499318123,
-0.09103239327669144,
-0.025837408378720284,
-0.05345618724822998,
0.02271612361073494,
-0.06615114212036133,
0.020942678675055504,
-0.0761207640171051,
-0.03213642165064812,
0.04155083745718002,
0.018153168261051178,
-0.052717484533786774,
-0.0009284952539019287,
-0.05729066580533981
] | 0.033093
|
[[search-aggregations-pipeline-stats-bucket-aggregation]] === Stats Bucket Aggregation A sibling pipeline aggregation which calculates a variety of stats across all bucket of a specified metric in a sibling aggregation. The specified metric must be numeric and the sibling aggregation must be a multi-bucket aggregation. ==== Syntax A `stats\_bucket` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "stats\_bucket": { "buckets\_path": "the\_sum" } } -------------------------------------------------- // NOTCONSOLE [[stats-bucket-params]] .`stats\_bucket` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`buckets\_path` |The path to the buckets we wish to calculate stats for (see <> for more details) |Required | |`gap\_policy` |The policy to apply when gaps are found in the data (see <> for more details)|Optional | `skip` |`format` |format to apply to the output value of this aggregation |Optional | `null` |=== The following snippet calculates the stats for monthly `sales`: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } } } }, "stats\_monthly\_sales": { "stats\_bucket": { "buckets\_path": "sales\_per\_month>sales" <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> `bucket\_paths` instructs this `stats\_bucket` aggregation that we want the calculate stats for the `sales` aggregation in the `sales\_per\_month` date histogram. And the following may be the response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "sales": { "value": 550.0 } }, { "key\_as\_string": "2015/02/01 00:00:00", "key": 1422748800000, "doc\_count": 2, "sales": { "value": 60.0 } }, { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "sales": { "value": 375.0 } } ] }, "stats\_monthly\_sales": { "count": 3, "min": 60.0, "max": 550.0, "avg": 328.3333333333333, "sum": 985.0 } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/]
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/stats-bucket-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.03910398855805397,
0.03169950842857361,
-0.021424680948257446,
0.05550708994269371,
-0.02419000305235386,
0.008052574470639229,
-0.0005396001506596804,
0.02593744546175003,
0.028697140514850616,
-0.025540530681610107,
-0.030512964352965355,
-0.12479069828987122,
0.05285434052348137,
-0.023377688601613045,
0.01947566494345665,
0.028960324823856354,
-0.02722480706870556,
-0.003924129530787468,
-0.1048421561717987,
-0.12992721796035767,
-0.011371754109859467,
0.04905194416642189,
0.0010592954931780696,
-0.06999333947896957,
0.029515044763684273,
0.004176408052444458,
-0.08958190679550171,
-0.024817144498229027,
0.030864013358950615,
0.0003620985080488026,
-0.009605444967746735,
-0.004109605681151152,
-0.04172269254922867,
0.04954899474978447,
0.0674796774983406,
0.06063419580459595,
-0.021871820092201233,
-0.014151040464639664,
0.0236396212130785,
0.010523020289838314,
0.035146407783031464,
0.06348409503698349,
-0.05160971358418465,
-0.1588553935289383,
-0.007863813079893589,
-0.06095794960856438,
-0.11271373927593231,
-0.035650212317705154,
-0.013603721745312214,
0.004696145188063383,
-0.06035416200757027,
-0.06813134998083115,
-0.018104227259755135,
0.010339171625673771,
0.05586984008550644,
0.06257040053606033,
-0.08095389604568481,
-0.019757768139243126,
0.022414417937397957,
-0.06949646770954132,
-0.0731082633137703,
-0.06315936893224716,
0.03322838991880417,
-0.006629405543208122,
0.03802667185664177,
-0.0024032818619161844,
-0.041379958391189575,
0.025704577565193176,
-0.022886769846081734,
0.10494321584701538,
-0.0141476234421134,
-0.012204290367662907,
-0.02530665509402752,
-0.05042417719960213,
0.05885985866189003,
0.033716410398483276,
-0.014246691018342972,
0.02976905182003975,
0.01629156991839409,
-0.04204876348376274,
-0.08824702352285385,
-0.08023376017808914,
-0.054416634142398834,
0.05884195491671562,
-0.003676327643916011,
-0.03448973968625069,
-0.044185202568769455,
-0.03870410472154617,
0.0905061662197113,
-0.1009926125407219,
-0.09903721511363983,
-0.04089870676398277,
0.01794891618192196,
0.023897245526313782,
0.03134002164006233,
0.051802873611450195,
-0.07451797276735306,
-0.04979507252573967,
0.07482166588306427,
0.018885256722569466,
-0.042492013424634933,
-0.018894700333476067,
0.04853533208370209,
-0.05386160686612129,
-0.04034046828746796,
-0.011375964619219303,
-0.008090733550488949,
0.05749958008527756,
-0.019055712968111038,
0.037380196154117584,
0.010541641153395176,
0.01897641085088253,
-0.0008601985173299909,
0.03212074190378189,
-0.001005866564810276,
0.015125329606235027,
0.08949209004640579,
-0.06495795398950577,
0.01890917681157589,
-0.0012380247935652733,
0.12152334302663803,
0.04622993618249893,
-0.011336107738316059,
-0.00024200860934797674,
0.002245191717520356,
0.018353890627622604,
-0.039485592395067215,
-4.246741501994295e-33,
0.04005913436412811,
-0.1262441873550415,
0.037132568657398224,
0.017995603382587433,
0.040144871920347214,
0.12119163572788239,
0.042760398238897324,
0.026516035199165344,
-0.04918591305613518,
0.05753251910209656,
-0.04165826365351677,
0.09235348552465439,
-0.13563840091228485,
-0.07735800743103027,
-0.013222630135715008,
0.037429895251989365,
-0.002467129146680236,
0.07106776535511017,
0.003898437600582838,
0.005283611360937357,
0.07253269106149673,
-0.011539111845195293,
-0.03275430575013161,
0.03431728482246399,
0.009142939001321793,
-0.03586821258068085,
0.0218823105096817,
-0.053912919014692307,
-0.08278998732566833,
0.0018178931204602122,
0.02812996879220009,
0.015300363302230835,
-0.012032413855195045,
-0.008186127059161663,
0.012490506283938885,
-0.04848938062787056,
-0.010409251786768436,
0.057666078209877014,
-0.06294159591197968,
0.025266239419579506,
-0.012395097874104977,
-0.01044203620404005,
-0.004429655149579048,
-0.08662679046392441,
-0.09513483941555023,
-0.008826006203889847,
0.028246652334928513,
-0.010989660397171974,
0.0762251690030098,
0.006809969432651997,
-0.06692379713058472,
0.011238455772399902,
0.08251342177391052,
0.0019076603930443525,
0.02614748664200306,
-0.013427957892417908,
-0.03425060957670212,
0.05739881098270416,
0.004346946254372597,
-0.01774788461625576,
-0.03515149652957916,
0.02733239345252514,
-0.04157961532473564,
0.012180457822978497,
0.06728793680667877,
0.06577996164560318,
0.03079693764448166,
0.13251641392707825,
0.048827145248651505,
0.04743749275803566,
0.010136209428310394,
0.090706005692482,
-0.013716243207454681,
0.018869083374738693,
0.05717412382364273,
-0.11493378132581711,
0.035077981650829315,
0.012814256362617016,
0.015134748071432114,
-0.007179984822869301,
-0.0038251110818237066,
-0.004505769815295935,
-0.043544795364141464,
0.04976920783519745,
0.00557336863130331,
0.03402980417013168,
-0.05154780298471451,
0.014984228648245335,
-0.12586885690689087,
-0.033365197479724884,
-0.069148950278759,
-0.016806378960609436,
-0.11142347753047943,
-0.07541971653699875,
-0.04636029899120331,
-2.6185213435758907e-34,
0.015159792266786098,
0.04123475030064583,
0.07397393137216568,
0.057403963059186935,
0.06576880812644958,
-0.02663004957139492,
0.062079090625047684,
-0.07802001386880875,
0.07418065518140793,
0.03312292695045471,
-0.07057072222232819,
0.007558870129287243,
0.008440399542450905,
-0.07224743068218231,
0.02107027918100357,
0.08271130919456482,
-0.12022052705287933,
-0.11115442216396332,
0.022585473954677582,
-0.02630927599966526,
-0.050780266523361206,
0.02706173248589039,
-0.0070510669611394405,
0.0566478855907917,
-0.06093336641788483,
-0.000517037755344063,
-0.026324409991502762,
0.00484981806948781,
0.015515130944550037,
0.036910686641931534,
-0.01686464250087738,
0.021730974316596985,
-0.06303370743989944,
0.00932417530566454,
-0.05615486577153206,
-0.11015445739030838,
0.029858259484171867,
0.024311698973178864,
-0.016948038712143898,
0.011575632728636265,
-0.023630041629076004,
-0.0298817940056324,
0.0032863756641745567,
-0.028237147256731987,
0.03942447155714035,
0.08743821084499359,
0.0887654572725296,
0.00035301418392919004,
-0.0294001717120409,
-0.08198690414428711,
-0.007320092525333166,
0.003484099404886365,
-0.1151001900434494,
0.13522836565971375,
-0.03795968368649483,
-0.02817315235733986,
-0.03322526067495346,
-0.02070927433669567,
-0.06087786331772804,
-0.03257112205028534,
0.036422859877347946,
-0.02628381736576557,
-0.015213143080472946,
0.02637108787894249,
-0.03386987745761871,
-0.043196000158786774,
-0.03287329152226448,
-0.07066960632801056,
-0.01771422103047371,
0.05100124329328537,
-0.02156445011496544,
-0.06591611355543137,
0.14649933576583862,
-0.02616424858570099,
-0.009093120694160461,
0.011611863039433956,
-0.0038803997449576855,
-0.08189818263053894,
0.11557255685329437,
0.015728753060102463,
-0.07212100923061371,
0.023631298914551735,
0.04662951081991196,
0.03212238475680351,
0.04301884397864342,
-0.03892263397574425,
0.04226149618625641,
0.12919582426548004,
0.01357884518802166,
0.05082711949944496,
-0.0386025607585907,
-0.041378576308488846,
0.011563966982066631,
-0.025183457881212234,
-0.01711980067193508,
-4.5845279572631625e-8,
-0.0016414964338764548,
0.024401318281888962,
-0.08418640494346619,
-0.007686719764024019,
-0.021834753453731537,
0.021802237257361412,
0.0318138487637043,
0.14683520793914795,
-0.03896165266633034,
0.026751887053251266,
0.04027233272790909,
0.016479553654789925,
-0.019919564947485924,
0.05705809220671654,
-0.0821697935461998,
-0.062414854764938354,
-0.019467592239379883,
0.06479485332965851,
0.010308339260518551,
-0.06065835431218147,
-0.017202576622366905,
-0.0052793556824326515,
0.02817634306848049,
-0.017956553027033806,
0.04654212296009064,
-0.019622668623924255,
-0.00578416557982564,
-0.0054695503786206245,
0.0520411916077137,
-0.02880278043448925,
-0.015249866992235184,
-0.009657447226345539,
0.006253649014979601,
-0.00040217829518951476,
-0.021779397502541542,
-0.04519040510058403,
-0.022400235757231712,
0.03953974321484566,
0.0009765104623511434,
0.010960227809846401,
0.029631884768605232,
0.06334787607192993,
-0.05386791750788689,
0.05234109237790108,
0.03435322269797325,
0.01961316354572773,
-0.03058711811900139,
0.07011950761079788,
0.03497626259922981,
0.025260716676712036,
0.03183136135339737,
-0.08104175329208374,
-0.017044613137841225,
-0.015526995062828064,
0.050119075924158096,
-0.06623228639364243,
0.0389731228351593,
-0.06488817185163498,
0.03898817300796509,
0.02874624915421009,
0.057831112295389175,
-0.04797682911157608,
-0.03574750944972038,
-0.033512577414512634
] | -0.022311
|
[[search-aggregations-pipeline-serialdiff-aggregation]] === Serial Differencing Aggregation Serial differencing is a technique where values in a time series are subtracted from itself at different time lags or periods. For example, the datapoint f(x) = f(x~t~) - f(x~t-n~), where n is the period being used. A period of 1 is equivalent to a derivative with no time normalization: it is simply the change from one point to the next. Single periods are useful for removing constant, linear trends. Single periods are also useful for transforming data into a stationary series. In this example, the Dow Jones is plotted over ~250 days. The raw data is not stationary, which would make it difficult to use with some techniques. By calculating the first-difference, we de-trend the data (e.g. remove a constant, linear trend). We can see that the data becomes a stationary series (e.g. the first difference is randomly distributed around zero, and doesn't seem to exhibit any pattern/behavior). The transformation reveals that the dataset is following a random-walk; the value is the previous value +/- a random amount. This insight allows selection of further tools for analysis. [[serialdiff\_dow]] .Dow Jones plotted and made stationary with first-differencing image::images/pipeline\_serialdiff/dow.png[] Larger periods can be used to remove seasonal / cyclic behavior. In this example, a population of lemmings was synthetically generated with a sine wave + constant linear trend + random noise. The sine wave has a period of 30 days. The first-difference removes the constant trend, leaving just a sine wave. The 30th-difference is then applied to the first-difference to remove the cyclic behavior, leaving a stationary series which is amenable to other analysis. [[serialdiff\_lemmings]] .Lemmings data plotted made stationary with 1st and 30th difference image::images/pipeline\_serialdiff/lemmings.png[] ==== Syntax A `serial\_diff` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "serial\_diff": { "buckets\_path": "the\_sum", "lag": "7" } } -------------------------------------------------- // NOTCONSOLE [[serial-diff-params]] .`serial\_diff` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`buckets\_path` |Path to the metric of interest (see <> for more details |Required | |`lag` |The historical bucket to subtract from the current value. E.g. a lag of 7 will subtract the current value from the value 7 buckets ago. Must be a positive, non-zero integer |Optional |`1` |`gap\_policy` |Determines what should happen when a gap in the data is encountered. |Optional |`insert\_zero` |`format` |Format to apply to the output value of this aggregation |Optional | `null` |=== `serial\_diff` aggregations must be embedded inside of a `histogram` or `date\_histogram` aggregation: [source,js] -------------------------------------------------- POST /\_search { "size": 0, "aggs": { "my\_date\_histo": { <1> "date\_histogram": { "field": "timestamp", "interval": "day" }, "aggs": { "the\_sum": { "sum": { "field": "lemmings" <2> } }, "thirtieth\_difference": { "serial\_diff": { <3> "buckets\_path": "the\_sum", "lag" : 30 } } } } } } -------------------------------------------------- // CONSOLE <1> A `date\_histogram` named "my\_date\_histo" is constructed on the "timestamp" field, with one-day intervals <2> A `sum` metric is used to calculate the sum of a field. This could be any metric (sum, min, max, etc) <3> Finally, we specify a `serial\_diff` aggregation which uses "the\_sum" metric as its input. Serial differences are built by first specifying a `histogram` or `date\_histogram` over a field. You can then optionally add normal metrics, such as a `sum`, inside of that histogram. Finally, the `serial\_diff` is embedded inside the histogram. The `buckets\_path` parameter is then used to "point" at one of the sibling metrics inside of the histogram (see <> for a description of the syntax for `buckets\_path`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/serial-diff-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.10817443579435349,
0.009762189351022243,
0.03034379705786705,
0.05708804726600647,
-0.02029673382639885,
-0.05804881826043129,
-0.10445372760295868,
-0.018694356083869934,
0.09264746308326721,
-0.05900540575385094,
-0.023000644519925117,
0.08199751377105713,
-0.040735721588134766,
-0.04463473707437515,
-0.03708673641085625,
-0.0915125235915184,
-0.12034158408641815,
0.022578250616788864,
0.009764724411070347,
0.014236261136829853,
0.012906834483146667,
-0.03487749770283699,
-0.08966092020273209,
-0.014526842162013054,
0.005924067460000515,
0.05894363671541214,
-0.06448128074407578,
0.034357815980911255,
0.059919893741607666,
-0.0070155165158212185,
0.01459694467484951,
0.09755801409482956,
0.0786474198102951,
0.05926256999373436,
-0.06467900425195694,
-0.08566082268953323,
0.06436249613761902,
0.05328833684325218,
0.00860724225640297,
-0.003532713046297431,
0.04484288766980171,
-0.013146639801561832,
-0.018627595156431198,
-0.03859112784266472,
-0.02816995419561863,
-0.0686458870768547,
-0.03125448152422905,
-0.04357292130589485,
-0.04878770932555199,
0.03912866488099098,
-0.008292674086987972,
0.07311008870601654,
-0.06821709126234055,
0.06617166101932526,
0.08246008306741714,
0.058886460959911346,
0.008057145401835442,
-0.03483075648546219,
0.02158891223371029,
-0.09159428626298904,
-0.0021586227230727673,
0.026428189128637314,
-0.007503317669034004,
-0.0010543104726821184,
0.043341539800167084,
-0.014526483602821827,
0.05390366166830063,
0.03211938962340355,
0.09679055958986282,
0.0070126596838235855,
-0.004467741586267948,
0.014968848787248135,
-0.008348981849849224,
-0.005943364929407835,
0.04814388230443001,
0.05658014863729477,
-0.0012550230603665113,
-0.020342867821455002,
0.0010136894416064024,
-0.07494090497493744,
0.008964508771896362,
-0.008826961740851402,
0.028055917471647263,
-0.014600416645407677,
-0.037607260048389435,
0.0001963973045349121,
0.03308842331171036,
-0.013916191644966602,
0.0023278063163161278,
-0.03602302446961403,
0.024836864322423935,
0.05972164869308472,
-0.0025224650744348764,
-0.03926083818078041,
0.012936340644955635,
0.044159822165966034,
-0.03201012313365936,
0.0556538924574852,
0.16651540994644165,
0.05059249699115753,
0.06006805598735809,
0.031890396028757095,
0.02809736877679825,
-0.019506609067320824,
-0.0360480472445488,
-0.035709064453840256,
0.003809749847277999,
0.005508909001946449,
-0.04083077609539032,
-0.0012835590168833733,
-0.013882934115827084,
0.003712477395310998,
-0.025643950328230858,
-0.01642916165292263,
0.010672589763998985,
-0.05405789613723755,
-0.06784550845623016,
0.009497514925897121,
-0.005705180577933788,
0.04778161644935608,
0.07589374482631683,
-0.04395389184355736,
-0.04373643919825554,
0.04647088050842285,
0.03905176743865013,
0.05563867837190628,
-0.004129559732973576,
2.746986850826687e-33,
0.010189198888838291,
-0.08751840144395828,
0.019687624648213387,
-0.035858649760484695,
-0.015518701635301113,
0.010118294507265091,
-0.036590561270713806,
0.01427018828690052,
-0.005906194914132357,
0.1037244126200676,
0.011290894821286201,
0.13595597445964813,
-0.05172707140445709,
-0.0007154231425374746,
0.03378477692604065,
-0.014374984428286552,
0.03121284767985344,
-0.028125686571002007,
0.11952976882457733,
-0.050793230533599854,
0.036879412829875946,
-0.020823735743761063,
0.005781071726232767,
0.010285113006830215,
0.01427698228508234,
0.0018271817825734615,
-0.04335496202111244,
-0.007814157754182816,
0.02628730982542038,
0.014137636870145798,
-0.035802341997623444,
0.08057226240634918,
-0.07425323873758316,
-0.017984798178076744,
0.09014225006103516,
-0.008005229756236076,
0.07712405920028687,
-0.003655350534245372,
-0.03431236371397972,
-0.023179085925221443,
-0.035164907574653625,
0.007942098192870617,
-0.06714846193790436,
-0.06569584459066391,
-0.06851701438426971,
0.047970641404390335,
0.009046459570527077,
0.0002550833742134273,
-0.03214786574244499,
0.10537321120500565,
-0.05146575719118118,
0.01692916639149189,
0.030763590708374977,
-0.0748370885848999,
-0.014043482951819897,
0.03725246340036392,
0.07650887221097946,
-0.06748317927122116,
-0.0534064806997776,
0.0478266216814518,
0.011269325390458107,
-0.02461851015686989,
0.03048987127840519,
0.058722980320453644,
0.01174576859921217,
0.11738570779561996,
0.0007117263739928603,
0.049707818776369095,
0.009477559477090836,
0.06431470811367035,
-0.03526843711733818,
0.07307291030883789,
-0.01017027348279953,
-0.04004247114062309,
0.04504762962460518,
-0.08550384640693665,
0.04226725921034813,
0.05975568667054176,
-0.06586860865354538,
-0.03271763026714325,
-0.06340521574020386,
-0.01081585418432951,
0.02380537986755371,
-0.011134825646877289,
-0.0344504676759243,
0.029047250747680664,
0.01125358510762453,
0.026164431124925613,
-0.0241603534668684,
-0.12355931103229523,
0.005155890714377165,
0.0389164537191391,
-0.04716622829437256,
0.08245159685611725,
0.025458166375756264,
-4.899971059585933e-33,
-0.04558052867650986,
0.04803019016981125,
-0.03468263894319534,
0.04697655513882637,
-0.007508560549467802,
0.011490022763609886,
-0.00008695371798239648,
0.01415166724473238,
0.09002068638801575,
-0.04578455910086632,
-0.039041485637426376,
-0.015291569754481316,
-0.0031957041937857866,
-0.049137357622385025,
-0.00492812879383564,
0.0005148174823261797,
0.055899400264024734,
-0.09956002980470657,
-0.037002284079790115,
-0.0029548003803938627,
0.0076828948222100735,
0.046246130019426346,
-0.09377297759056091,
-0.04394269362092018,
-0.005948172882199287,
-0.023445624858140945,
-0.09697628766298294,
-0.019451167434453964,
-0.030731070786714554,
-0.009171820245683193,
0.002654770854860544,
-0.002184760058298707,
0.07444068789482117,
-0.06732027232646942,
-0.09897162020206451,
0.0832688957452774,
0.013330026529729366,
-0.04538910463452339,
0.03673964738845825,
-0.02495163306593895,
-0.012855753302574158,
0.050589755177497864,
0.1071455329656601,
-0.05516012758016586,
0.08971726149320602,
0.08493686467409134,
-0.043611302971839905,
0.047174952924251556,
0.05779752880334854,
0.009755256585776806,
0.03886204585433006,
0.07306253910064697,
-0.05283600464463234,
0.00492443423718214,
-0.01503757108002901,
0.034691084176301956,
0.028751790523529053,
-0.014196386560797691,
-0.13691042363643646,
0.01354022603482008,
0.019620364531874657,
-0.020136212930083275,
-0.11622292548418045,
0.017180494964122772,
-0.06302813440561295,
-0.00009288355795433745,
0.018301017582416534,
-0.1896033138036728,
0.014466940425336361,
-0.04477548599243164,
0.09552425146102905,
0.0047581493854522705,
0.032878611236810684,
-0.0025028791278600693,
-0.01801624521613121,
-0.10650288313627243,
-0.015142948366701603,
-0.0697769820690155,
-0.1126004308462143,
0.05552671104669571,
-0.0962233915925026,
-0.002536457497626543,
0.04269513115286827,
0.03379520773887634,
-0.13763628900051117,
0.07723387330770493,
0.01228552870452404,
0.030529340729117393,
-0.03115437924861908,
-0.018645022064447403,
0.0013172189937904477,
-0.02955949865281582,
-0.12773089110851288,
0.03673572465777397,
-0.015383192338049412,
-6.50248281885979e-8,
-0.05561194568872452,
-0.040835004299879074,
-0.038936980068683624,
0.06182107701897621,
0.056591928005218506,
-0.04670810326933861,
-0.018485069274902344,
-0.010135826654732227,
0.04576355218887329,
-0.08184517174959183,
0.10767766088247299,
-0.0025984011590480804,
-0.09790771454572678,
-0.030368264764547348,
0.02231128141283989,
0.08460961282253265,
-0.009768322110176086,
-0.08737196028232574,
-0.03203228861093521,
-0.011961173266172409,
-0.04423769563436508,
0.026357049122452736,
-0.03855070844292641,
-0.05307323485612869,
0.00619354797527194,
-0.008659269660711288,
0.013801094144582748,
0.04285440221428871,
0.03640024736523628,
-0.02746022865176201,
0.05680578202009201,
0.008406104519963264,
0.02807818166911602,
0.020663900300860405,
0.025929046794772148,
0.008270427584648132,
0.03452368825674057,
0.07868166267871857,
-0.033940114080905914,
0.01716458424925804,
0.02953493595123291,
0.036706387996673584,
-0.08203375339508057,
0.010949467308819294,
-0.029301714152097702,
0.022465361282229424,
-0.03201108053326607,
-0.010740273632109165,
0.04511277377605438,
-0.05796516314148903,
0.10585248470306396,
0.02761731669306755,
-0.00889094639569521,
0.028283612802624702,
0.07658231258392334,
0.01326226070523262,
0.016370555385947227,
-0.009678535163402557,
0.014618760906159878,
-0.007080704439431429,
-0.01338431891053915,
-0.05030662193894386,
-0.06250649690628052,
-0.022043023258447647
] | 0.199228
|
one of the sibling metrics inside of the histogram (see <> for a description of the syntax for `buckets\_path`.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/serial-diff-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.07105032354593277,
-0.03155696019530296,
-0.002451145090162754,
-0.05874231457710266,
-0.051005929708480835,
-0.01494416780769825,
-0.021087242290377617,
0.041070375591516495,
0.03145156428217888,
-0.036045778542757034,
0.011478401720523834,
-0.07411250472068787,
0.038418009877204895,
-0.023116808384656906,
-0.05979887396097183,
-0.04670901224017143,
-0.01860269531607628,
-0.06452395766973495,
-0.04951605945825577,
-0.13516393303871155,
-0.01469512190669775,
0.06464197486639023,
0.020730655640363693,
-0.027018072083592415,
0.04024806246161461,
0.03256138414144516,
-0.042945560067892075,
0.028250684961676598,
0.022775113582611084,
-0.004198465030640364,
0.004204947035759687,
-0.00448067020624876,
0.08341187983751297,
0.016748812049627304,
0.03267287835478783,
0.04822281375527382,
0.04221212863922119,
0.007528083864599466,
0.009157206863164902,
-0.005808250512927771,
0.02417191118001938,
0.03782254457473755,
0.056538548320531845,
0.00046637761988677084,
-0.04369295388460159,
0.042270779609680176,
-0.10975625365972519,
-0.04269234091043472,
0.008782956749200821,
0.012078842148184776,
-0.03370378166437149,
0.001512486138381064,
0.003601755015552044,
0.02897912636399269,
0.034979093819856644,
0.013745917938649654,
-0.04911772161722183,
-0.07640817016363144,
0.05801098793745041,
-0.03360878303647041,
-0.02632208541035652,
-0.014186329208314419,
-0.015082520432770252,
0.009170346893370152,
0.07053171843290329,
-0.0032368144020438194,
-0.018994487822055817,
-0.018396135419607162,
0.023387527093291283,
0.057720769196748734,
0.019487081095576286,
0.034016821533441544,
-0.03375721722841263,
0.06001562625169754,
-0.039281755685806274,
-0.005298933945596218,
0.0005722945788875222,
0.05526993051171303,
0.015956073999404907,
-0.13005666434764862,
-0.09541010856628418,
0.085629403591156,
0.049916066229343414,
0.0748165026307106,
0.005911765620112419,
0.008233943022787571,
-0.01250919047743082,
-0.0479239858686924,
0.06383459270000458,
-0.03383777290582657,
-0.0297573059797287,
-0.04134849086403847,
-0.04470446705818176,
-0.010863719508051872,
-0.0748867467045784,
0.021462775766849518,
0.04815634712576866,
0.045973680913448334,
0.08199790865182877,
0.016831424087285995,
0.034347858279943466,
-0.027223829180002213,
0.01949794590473175,
0.019783053547143936,
0.029465418308973312,
0.046787671744823456,
-0.054945413023233414,
0.01713784597814083,
0.02936534956097603,
0.02022174559533596,
0.004755886737257242,
-0.11686529964208603,
0.013675235211849213,
-0.0018699492793530226,
-0.039797890931367874,
-0.01879754289984703,
-0.046650711447000504,
0.05280547961592674,
-0.008584041148424149,
0.04788050800561905,
-0.04383637383580208,
-0.00922909751534462,
-0.014861906878650188,
-0.024830292910337448,
-0.047484785318374634,
-0.0795416608452797,
-0.05443832278251648,
-1.0235173494338625e-33,
-0.011814374476671219,
-0.11342012137174606,
0.04708428308367729,
-0.0555204413831234,
-0.0027281350921839476,
0.049627579748630524,
-0.09863675385713577,
-0.013772284612059593,
-0.0013432210544124246,
0.009185307659208775,
-0.016579214483499527,
0.05493856593966484,
-0.0327867791056633,
-0.012062991969287395,
-0.0446154810488224,
0.022234011441469193,
-0.03373789042234421,
0.011150021106004715,
-0.05526347458362579,
-0.07007202506065369,
-0.05041856691241264,
0.012242385186254978,
0.037101976573467255,
-0.007734666112810373,
0.02524980902671814,
-0.025923192501068115,
0.0502622090280056,
-0.06630690395832062,
0.0007211790070869029,
0.07662248611450195,
-0.03174308314919472,
0.06726790964603424,
-0.02668136917054653,
-0.019106026738882065,
0.01912313885986805,
-0.031101886183023453,
-0.04681658744812012,
0.028017478063702583,
-0.04233087971806526,
0.03603656217455864,
0.0641033798456192,
-0.05961909890174866,
-0.014871013350784779,
-0.0053137061186134815,
-0.10700549185276031,
0.03782206401228905,
0.06103499233722687,
-0.038442593067884445,
0.0670604407787323,
-0.015059316530823708,
0.009794233366847038,
0.019420741125941277,
0.05788779631257057,
-0.021992003545165062,
-0.0012495069531723857,
-0.01823834329843521,
0.053969498723745346,
0.024751801043748856,
-0.016478968784213066,
0.10482954978942871,
0.028240755200386047,
0.09648967534303665,
0.0842466801404953,
0.012923607602715492,
0.031896669417619705,
-0.04641016200184822,
0.01520020142197609,
0.10509447008371353,
0.08886214345693588,
0.09926154464483261,
-0.04694833979010582,
0.0788736417889595,
0.05114361643791199,
0.010952543467283249,
0.0005986007745377719,
-0.04508281871676445,
-0.0023665265180170536,
-0.05756714195013046,
-0.045768022537231445,
-0.004111380781978369,
-0.09971117973327637,
-0.07414300739765167,
-0.01327218022197485,
-0.04533839225769043,
-0.04725220799446106,
-0.03046424128115177,
0.013608169741928577,
-0.012099634855985641,
-0.17551639676094055,
-0.010845066048204899,
-0.03733949363231659,
0.010046780109405518,
-0.07388787716627121,
0.004832442384213209,
-0.06575997173786163,
-1.906618592584141e-33,
-0.04142194613814354,
0.08974607288837433,
0.07100594788789749,
0.06445493549108505,
-0.011108382605016232,
-0.0120684914290905,
0.07261724025011063,
0.0513056255877018,
0.05389367416501045,
0.06798151880502701,
-0.02307700365781784,
0.04630834609270096,
0.03211568668484688,
-0.03537833318114281,
0.060634795576334,
0.038694921880960464,
-0.04548724368214607,
-0.06176789104938507,
-0.08525285124778748,
-0.02464347518980503,
-0.0008293481077998877,
-0.015658993273973465,
-0.02097124233841896,
0.03277800977230072,
-0.06704506278038025,
0.034173205494880676,
-0.010771618224680424,
-0.031109154224395752,
0.005194773431867361,
0.0028617496136575937,
0.005794377066195011,
-0.01906854845583439,
-0.06956261396408081,
-0.07515157014131546,
-0.035755936056375504,
-0.06803008168935776,
0.016423681750893593,
-0.05045926198363304,
-0.05053243413567543,
-0.04452390968799591,
0.03383048251271248,
0.02848130092024803,
0.005576437804847956,
-0.034690987318754196,
0.00280185928568244,
0.13098791241645813,
0.04151240363717079,
0.046835146844387054,
0.0184638611972332,
-0.05429893359541893,
0.010349199175834656,
0.06566638499498367,
-0.027025222778320312,
0.16108183562755585,
0.053275685757398605,
0.05662521719932556,
-0.05873138830065727,
0.04670175537467003,
0.008192440494894981,
0.0014062519185245037,
0.0012407972244545817,
-0.0792713388800621,
0.027872584760189056,
0.052205074578523636,
-0.033661067485809326,
0.004020882770419121,
-0.03323141112923622,
-0.03868436813354492,
-0.039483070373535156,
0.10205837339162827,
0.009603957645595074,
-0.009449360892176628,
0.02359182760119438,
-0.10441167652606964,
-0.06381657719612122,
0.05581379681825638,
0.0289900042116642,
-0.058090098202228546,
0.0035615661181509495,
-0.01176099106669426,
-0.004678810015320778,
0.003686164505779743,
0.061163876205682755,
0.08664301782846451,
0.04621213674545288,
-0.02580307610332966,
-0.017207978293299675,
0.02192518673837185,
0.053318340331315994,
0.09565845876932144,
0.022777125239372253,
0.025566816329956055,
-0.12089058011770248,
0.023432699963450432,
-0.054090484976768494,
-3.110977786491276e-8,
-0.0016814768314361572,
-0.05182424932718277,
-0.014073465019464493,
-0.05749013274908066,
0.06193716824054718,
0.033343229442834854,
0.0029168997425585985,
0.17647233605384827,
-0.027586909011006355,
0.08970750868320465,
0.1254005879163742,
-0.036815427243709564,
-0.12203103303909302,
0.0017050931928679347,
-0.038222458213567734,
-0.04663423076272011,
0.019763175398111343,
0.02200501784682274,
-0.011695878580212593,
-0.010567916557192802,
-0.055142246186733246,
-0.013658089563250542,
0.054103296250104904,
-0.02637961506843567,
-0.09334680438041687,
-0.03780749812722206,
-0.02469368651509285,
0.014256062917411327,
-0.00935204979032278,
-0.1276516318321228,
0.06105497106909752,
0.015125309117138386,
0.03065507858991623,
-0.043291132897138596,
-0.018558314070105553,
0.04253426566720009,
-0.12042544037103653,
0.04546837881207466,
0.02764945663511753,
0.030778106302022934,
0.024041414260864258,
-0.03790677338838577,
0.004090991336852312,
0.05588775873184204,
0.01138316746801138,
0.07915922999382019,
0.02336004562675953,
0.141656756401062,
-0.0699276402592659,
0.015336774289608002,
-0.10199962556362152,
0.0053872657008469105,
-0.03744340315461159,
-0.022798001766204834,
0.028387630358338356,
-0.0618990920484066,
-0.04164215549826622,
-0.08337435126304626,
0.0036124777980148792,
0.08649709820747375,
0.02214430831372738,
-0.02756797894835472,
-0.02434469386935234,
-0.035211749374866486
] | 0.107815
|
[[search-aggregations-pipeline-bucket-selector-aggregation]] === Bucket Selector Aggregation A parent pipeline aggregation which executes a script which determines whether the current bucket will be retained in the parent multi-bucket aggregation. The specified metric must be numeric and the script must return a boolean value. If the script language is `expression` then a numeric return value is permitted. In this case 0.0 will be evaluated as `false` and all other values will evaluate to true. NOTE: The bucket\_selector aggregation, like all pipeline aggregations, executes after all other sibling aggregations. This means that using the bucket\_selector aggregation to filter the returned buckets in the response does not save on execution time running the aggregations. ==== Syntax A `bucket\_selector` aggregation looks like this in isolation: [source,js] -------------------------------------------------- { "bucket\_selector": { "buckets\_path": { "my\_var1": "the\_sum", <1> "my\_var2": "the\_value\_count" }, "script": "params.my\_var1 > params.my\_var2" } } -------------------------------------------------- // NOTCONSOLE <1> Here, `my\_var1` is the name of the variable for this buckets path to use in the script, `the\_sum` is the path to the metrics to use for that variable. [[bucket-selector-params]] .`bucket\_selector` Parameters [options="header"] |=== |Parameter Name |Description |Required |Default Value |`script` |The script to run for this aggregation. The script can be inline, file or indexed. (see <> for more details) |Required | |`buckets\_path` |A map of script variables and their associated path to the buckets we wish to use for the variable (see <> for more details) |Required | |`gap\_policy` |The policy to apply when gaps are found in the data (see <> for more details)|Optional |`skip` |=== The following snippet only retains buckets where the total sales for the month is more than 200: [source,js] -------------------------------------------------- POST /sales/\_search { "size": 0, "aggs" : { "sales\_per\_month" : { "date\_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "total\_sales": { "sum": { "field": "price" } }, "sales\_bucket\_filter": { "bucket\_selector": { "buckets\_path": { "totalSales": "total\_sales" }, "script": "params.totalSales > 200" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] And the following may be the response: [source,js] -------------------------------------------------- { "took": 11, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations": { "sales\_per\_month": { "buckets": [ { "key\_as\_string": "2015/01/01 00:00:00", "key": 1420070400000, "doc\_count": 3, "total\_sales": { "value": 550.0 } },<1> { "key\_as\_string": "2015/03/01 00:00:00", "key": 1425168000000, "doc\_count": 2, "total\_sales": { "value": 375.0 }, } ] } } } -------------------------------------------------- // TESTRESPONSE[s/"took": 11/"took": $body.took/] // TESTRESPONSE[s/"\_shards": \.\.\./"\_shards": $body.\_shards/] // TESTRESPONSE[s/"hits": \.\.\./"hits": $body.hits/] <1> Bucket for `2015/02/01 00:00:00` has been removed as its total sales was less than 200
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/pipeline/bucket-selector-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.05540256202220917,
0.04190261662006378,
0.049631308764219284,
0.07285986840724945,
-0.000020596773538272828,
-0.014561394229531288,
-0.0007720389985479414,
-0.01971263438463211,
0.0995764434337616,
-0.042163461446762085,
-0.06983568519353867,
-0.08430808782577515,
-0.012849757447838783,
-0.039922747761011124,
-0.01340617798268795,
-0.0021542187314480543,
0.03153073787689209,
0.03455785661935806,
-0.11065958440303802,
-0.13297796249389648,
0.03371394798159599,
-0.025981100276112556,
0.02704675681889057,
-0.07040031999349594,
-0.021521050482988358,
0.013390644453465939,
-0.08889828622341156,
-0.09615787863731384,
0.045627932995557785,
-0.0028827658388763666,
-0.010581286624073982,
-0.01074321661144495,
-0.004041989799588919,
0.03937635198235512,
0.006382278632372618,
0.07700996845960617,
0.0025212231557816267,
-0.03010733053088188,
-0.020757321268320084,
-0.009788908995687962,
0.03299715742468834,
0.014717038720846176,
-0.03007095493376255,
-0.14553728699684143,
0.03452267870306969,
-0.06740925461053848,
-0.07783075422048569,
-0.037515025585889816,
-0.0802057757973671,
0.005548850633203983,
0.022692358121275902,
-0.019644159823656082,
-0.03417476266622543,
0.002149519743397832,
0.010862422175705433,
0.04882161319255829,
-0.02847467176616192,
-0.01267658919095993,
0.01282669510692358,
-0.045513879507780075,
-0.08086597919464111,
-0.07863710820674896,
0.02437400445342064,
-0.017353035509586334,
0.09076683223247528,
-0.013609061948955059,
0.006433404050767422,
-0.046014171093702316,
0.01596842147409916,
0.08554238826036453,
0.041219376027584076,
-0.018436249345541,
-0.0023916622158139944,
-0.049153298139572144,
0.06231869012117386,
0.0714384913444519,
0.029754536226391792,
0.027911730110645294,
0.04177698493003845,
-0.003445635549724102,
-0.08888901025056839,
-0.0919979140162468,
-0.029178738594055176,
0.02409849688410759,
0.0035590198822319508,
-0.03929335996508598,
-0.04747987911105156,
-0.07631010562181473,
0.10775981098413467,
-0.031429722905159,
-0.07911324501037598,
-0.04446529597043991,
0.028138570487499237,
0.02919751964509487,
0.05157329887151718,
0.017456892877817154,
-0.04258894920349121,
-0.04488536715507507,
0.09134341031312943,
-0.02735559269785881,
-0.009206443093717098,
0.01365855522453785,
0.021975208073854446,
-0.06267987936735153,
-0.007093160413205624,
0.0046144830994307995,
-0.043535761535167694,
0.029441047459840775,
-0.04716905951499939,
0.029141290113329887,
0.011116141453385353,
-0.01711992546916008,
0.06148219108581543,
0.053707074373960495,
-0.01990947127342224,
0.013841676525771618,
0.05230885371565819,
-0.013497034087777138,
0.030993353575468063,
0.023879634216427803,
0.0801258459687233,
0.02986225113272667,
0.021263359114527702,
-0.053084004670381546,
0.03934544697403908,
0.04301498457789421,
-0.02960372529923916,
3.1123655762217864e-33,
0.008175208233296871,
-0.1270965039730072,
0.03913886845111847,
-0.06176478788256645,
0.0007383875781670213,
0.04468557983636856,
0.036645423620939255,
0.057198718190193176,
-0.06584850698709488,
0.048534758388996124,
-0.004419863224029541,
0.10445284098386765,
-0.10740483552217484,
-0.0649411752820015,
-0.01499959733337164,
0.050466880202293396,
0.025599559769034386,
0.03213706985116005,
0.027148691937327385,
0.010418240912258625,
0.012946310453116894,
-0.02824275940656662,
-0.023680515587329865,
0.043310340493917465,
0.027350986376404762,
-0.06845451146364212,
-0.05744388327002525,
-0.06133047863841057,
-0.08822767436504364,
0.01848427578806877,
-0.03429212421178818,
0.026700545102357864,
-0.017577413469552994,
-0.04740756377577782,
0.0016742633888497949,
0.00817080121487379,
-0.022620204836130142,
0.07262619584798813,
-0.052446357905864716,
-0.026437988504767418,
-0.013016868382692337,
-0.010147416964173317,
0.01781872846186161,
-0.10269790142774582,
-0.09620095044374466,
-0.041616134345531464,
-0.017501916736364365,
-0.014140457846224308,
0.04467440024018288,
0.03836023062467575,
-0.004553796257823706,
0.056533340364694595,
0.06021692603826523,
0.0031987291295081377,
0.05413423106074333,
0.0018515706760808825,
0.01750393956899643,
0.08908118307590485,
0.021340135484933853,
0.008918777108192444,
-0.02341626025736332,
0.02492337115108967,
-0.0470946840941906,
0.01644211634993553,
-0.0007643057615496218,
0.030877575278282166,
0.06712042540311813,
0.11528922617435455,
0.03507426753640175,
0.04318290948867798,
0.02862035669386387,
0.11175654083490372,
0.010075435973703861,
0.012961916625499725,
0.06678866595029831,
-0.12469164282083511,
0.07134848833084106,
0.021731285378336906,
0.0328732505440712,
-0.011676883324980736,
0.011359063908457756,
-0.0033715723548084497,
-0.002298050792887807,
0.0400855578482151,
0.023649662733078003,
0.09159314632415771,
-0.055101748555898666,
0.004722509067505598,
-0.0754326581954956,
-0.028809452429413795,
-0.042517438530921936,
-0.04145702347159386,
-0.11307472735643387,
-0.06273685395717621,
-0.033215366303920746,
-5.316407933121975e-33,
0.05306513234972954,
0.06176172196865082,
0.014610083773732185,
0.09284459054470062,
-0.004404149483889341,
-0.06348508596420288,
0.07115994393825531,
-0.03163810446858406,
0.09454561769962311,
-0.0009748708107508719,
-0.03546837717294693,
0.03143671527504921,
0.03856683149933815,
-0.042676668614149094,
0.01112875621765852,
0.06911119073629379,
-0.12475850433111191,
-0.14414997398853302,
0.05141606554389,
0.0009472978417761624,
-0.011351709254086018,
0.006310398690402508,
0.00751754455268383,
0.07955120503902435,
-0.07909342646598816,
-0.02592579275369644,
-0.040069904178380966,
-0.028622189536690712,
0.010924574919044971,
0.01864304579794407,
-0.0002511667553335428,
0.010422462597489357,
-0.018501054495573044,
-0.03559386730194092,
-0.03841580078005791,
-0.13860656321048737,
0.026202207431197166,
0.04229114204645157,
-0.019660184159874916,
0.03787720948457718,
-0.014773212373256683,
-0.02859771065413952,
-0.02092558890581131,
0.01263688039034605,
0.0469321683049202,
0.0353303998708725,
0.10548409819602966,
0.06196793541312218,
-0.0024479846470057964,
-0.032363831996917725,
-0.0165188480168581,
0.019999593496322632,
-0.07640358805656433,
0.1607164889574051,
-0.033648669719696045,
-0.05031467229127884,
0.01384515780955553,
-0.03455647453665733,
-0.05146794766187668,
-0.01035359501838684,
0.0003357765090186149,
-0.01615385338664055,
0.007957941852509975,
0.025749068707227707,
-0.04735143855214119,
-0.010726749897003174,
-0.025893794372677803,
-0.027793433517217636,
0.04710141196846962,
-0.01876820996403694,
0.04543933644890785,
-0.07545647770166397,
0.10910689830780029,
-0.006787921767681837,
-0.057020775973796844,
0.02743341773748398,
0.0067337891086936,
-0.04112420603632927,
0.09810314327478409,
0.057202860713005066,
-0.06176116317510605,
0.10328400135040283,
0.016212431713938713,
0.06278961151838303,
0.06847652792930603,
-0.026043852791190147,
0.031862277537584305,
0.10533453524112701,
0.014446781016886234,
0.08796790987253189,
-0.012606474570930004,
-0.05880720913410187,
-0.06568082422018051,
-0.0441322959959507,
-0.005636803340166807,
-5.415172310563321e-8,
-0.050800833851099014,
0.019464168697595596,
-0.06485293805599213,
0.037500035017728806,
-0.01879323087632656,
0.011868433095514774,
0.03624061867594719,
0.12405650317668915,
-0.07605472952127457,
-0.014399302192032337,
0.05135016515851021,
0.03329261764883995,
-0.04501006379723549,
0.05660615861415863,
-0.007771295960992575,
-0.015979934483766556,
0.025645539164543152,
-0.01261923648416996,
-0.03194953128695488,
-0.06587909162044525,
-0.059748321771621704,
0.013146252371370792,
0.03629852831363678,
-0.0033344405237585306,
-0.00045944444718770683,
0.024815818294882774,
-0.005985289346426725,
-0.03404643014073372,
-0.012895641848444939,
-0.07482989132404327,
-0.04073642939329147,
0.004317494574934244,
-0.016584061086177826,
0.03335118666291237,
0.024209756404161453,
-0.01972077786922455,
-0.037493448704481125,
0.016764987260103226,
0.027719419449567795,
0.02122737467288971,
0.015129662118852139,
0.03385096415877342,
-0.044743455946445465,
0.0060862707905471325,
-0.038682229816913605,
0.03383008390665054,
-0.04849361628293991,
0.06533429026603699,
0.010593272745609283,
0.029578570276498795,
0.0022577736526727676,
-0.08281927555799484,
-0.10442302376031876,
0.032541800290346146,
0.0562148354947567,
-0.08367983996868134,
0.02689943090081215,
-0.07561524957418442,
0.041614942252635956,
0.054490115493535995,
0.10063813626766205,
-0.037775956094264984,
-0.03182085603475571,
-0.10788135230541229
] | -0.018879
|
[[search-aggregations-bucket-significanttext-aggregation]] === Significant Text Aggregation experimental[] An aggregation that returns interesting or unusual occurrences of free-text terms in a set. It is like the <> aggregation but differs in that: \* It is specifically designed for use on type `text` fields \* It does not require field data or doc-values \* It re-analyzes text content on-the-fly meaning it can also filter duplicate sections of noisy text that otherwise tend to skew statistics. WARNING: Re-analyzing \_large\_ result sets will require a lot of time and memory. It is recommended that the significant\_text aggregation is used as a child of either the <> or <> aggregation to limit the analysis to a \_small\_ selection of top-matching documents e.g. 200. This will typically improve speed, memory use and quality of results. .Example use cases: \* Suggesting "H5N1" when users search for "bird flu" to help expand queries \* Suggesting keywords relating to stock symbol $ATI for use in an automated news classifier In these cases the words being selected are not simply the most popular terms in results. The most popular words tend to be very boring (\_and, of, the, we, I, they\_ ...). The significant words are the ones that have undergone a significant change in popularity measured between a \_foreground\_ and \_background\_ set. If the term "H5N1" only exists in 5 documents in a 10 million document index and yet is found in 4 of the 100 documents that make up a user's search results that is significant and probably very relevant to their search. 5/10,000,000 vs 4/100 is a big swing in frequency. experimental[The `significant\_text` aggregation is new and may change in non-backwards compatible ways if we add further text-analysis features e.g. phrase detection] ==== Basic use In the typical use case, the \_foreground\_ set of interest is a selection of the top-matching search results for a query and the \_background\_set used for statistical comparisons is the index or indices from which the results were gathered. Example: [source,js] -------------------------------------------------- GET news/article/\_search { "query" : { "match" : {"content" : "Bird flu"} }, "aggregations" : { "my\_sample" : { "sampler" : { "shard\_size" : 100 }, "aggregations": { "keywords" : { "significant\_text" : { "field" : "content" } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:news] Response: [source,js] -------------------------------------------------- { "took": 9, "timed\_out": false, "\_shards": ..., "hits": ..., "aggregations" : { "my\_sample": { "doc\_count": 100, "keywords" : { "doc\_count": 100, "buckets" : [ { "key": "h5n1", "doc\_count": 4, "score": 4.71235374214817, "bg\_count": 5 } ... ] } } } } -------------------------------------------------- // NOTCONSOLE The results show that "h5n1" is one of several terms strongly associated with bird flu. It only occurs 5 times in our index as a whole (see the `bg\_count`) and yet 4 of these were lucky enough to appear in our 100 document sample of "bird flu" results. That suggests a significant word and one which the user can potentially add to their search. [[filter-duplicate-text-noisy-data]] ==== Dealing with noisy data using `filter\_duplicate\_text` Free-text fields often contain a mix of original content and mechanical copies of text (cut-and-paste biographies, email reply chains, retweets, boilerplate headers/footers, page navigation menus, sidebar news links, copyright notices, standard disclaimers, addresses). In real-world data these duplicate sections of text tend to feature heavily in `significant\_text` results if they aren't filtered out. Filtering near-duplicate text is a difficult task at index-time but we can cleanse the data on-the-fly at query time using the `filter\_duplicate\_text` setting. First let's look at an unfiltered real-world example using the http://research.signalmedia.co/newsir16/signal-dataset.html[Signal media dataset] of a million news articles covering a wide variety of news. Here are the raw significant
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/significanttext-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.01621931418776512,
0.07259844243526459,
0.04797518998384476,
0.05899600684642792,
0.031103065237402916,
0.012585312128067017,
0.04524210840463638,
0.06152909994125366,
0.07707871496677399,
-0.0038284678012132645,
-0.014457343146204948,
0.036509089171886444,
0.061727117747068405,
-0.055187202990055084,
-0.034224580973386765,
0.05082077533006668,
0.09000498801469803,
-0.039098989218473434,
-0.12089651823043823,
-0.07264867424964905,
0.003559690900146961,
0.02438885159790516,
0.0371115617454052,
0.005563725251704454,
0.002273447345942259,
0.04751593992114067,
-0.1495625376701355,
0.03417785465717316,
0.023492740467190742,
0.03841860219836235,
-0.05447936803102493,
0.13911379873752594,
0.10155906528234482,
0.05460476875305176,
-0.04831347241997719,
0.03328542038798332,
-0.059723205864429474,
0.025266069918870926,
0.037490591406822205,
-0.049858689308166504,
0.023124203085899353,
-0.06835013628005981,
0.02570611983537674,
0.00020472555479500443,
0.04139677807688713,
-0.0038874235469847918,
-0.055712975561618805,
-0.026479557156562805,
0.0005752690485678613,
-0.012957107275724411,
-0.11397771537303925,
0.04634815454483032,
-0.043220069259405136,
0.05592285469174385,
0.03426441177725792,
0.00789356417953968,
-0.06060338765382767,
-0.07335768640041351,
-0.0629468783736229,
-0.07989724725484848,
-0.0669131949543953,
-0.060648977756500244,
-0.004190778359770775,
-0.024083293974399567,
0.025640038773417473,
-0.027430694550275803,
0.03268278390169144,
0.02602388896048069,
0.006784774828702211,
0.07612830400466919,
0.0305763091892004,
0.09538795799016953,
-0.02695305645465851,
0.11272289603948593,
0.017706992104649544,
0.08101902902126312,
-0.03060753457248211,
-0.0376824215054512,
0.04381405562162399,
0.023721113801002502,
-0.05598265677690506,
-0.029728982597589493,
0.023294348269701004,
0.006394913885742426,
0.03458349034190178,
-0.05967698618769646,
0.053304340690374374,
-0.1165945827960968,
-0.005742939189076424,
-0.017785608768463135,
-0.04778536409139633,
-0.1294901967048645,
0.0996379479765892,
-0.039402421563863754,
-0.0024379121605306864,
0.0013727445621043444,
-0.020387589931488037,
-0.09299403429031372,
0.11315350979566574,
0.010534550994634628,
0.06020492687821388,
0.05406789481639862,
0.08108359575271606,
-0.07506793737411499,
-0.10119606554508209,
-0.04497279226779938,
0.01673971861600876,
0.04441126808524132,
0.03889906406402588,
-0.05056639015674591,
-0.015309150330722332,
-0.04093435779213905,
-0.028436211869120598,
-0.03685707226395607,
-0.017042100429534912,
0.021530797705054283,
0.010930453427135944,
-0.021390235051512718,
0.013439510017633438,
0.057229168713092804,
0.018869996070861816,
-0.021756263449788094,
0.013948806561529636,
-0.0753253698348999,
-0.00799650140106678,
0.07675866782665253,
-0.05435272306203842,
6.584919519266815e-33,
-0.011413411237299442,
-0.028534280136227608,
-0.02058263123035431,
0.022448986768722534,
-0.03952721133828163,
0.03230537474155426,
-0.0786631628870964,
0.04129321873188019,
-0.028388002887368202,
0.05908796191215515,
-0.050478290766477585,
0.09632202237844467,
-0.005327523220330477,
0.0539105124771595,
0.05641782656311989,
-0.028818411752581596,
0.02365400455892086,
0.03891661390662193,
-0.017310144379734993,
-0.022148367017507553,
0.029240144416689873,
-0.0010585846612229943,
0.06938382983207703,
-0.021535417065024376,
-0.0035652383230626583,
-0.03800230100750923,
-0.0014168336056172848,
-0.0449814535677433,
-0.0508718304336071,
0.013014320284128189,
-0.06063229218125343,
0.025999845936894417,
0.054413579404354095,
-0.018820244818925858,
0.04932331293821335,
0.024081848561763763,
-0.050946902483701706,
-0.05328671634197235,
0.04318439960479736,
-0.009317413903772831,
-0.069579117000103,
-0.001681118388660252,
-0.0025343778543174267,
-0.08677808195352554,
0.01337902806699276,
0.02788480743765831,
-0.07578592747449875,
0.04079963266849518,
0.009900900535285473,
-0.009281186386942863,
0.002130665350705385,
0.03265669196844101,
0.02567550539970398,
0.06582432240247726,
0.042889662086963654,
0.050917141139507294,
0.031114516779780388,
0.027538826689124107,
-0.004855852108448744,
0.055389150977134705,
-0.07198161631822586,
-0.004733489826321602,
0.041889678686857224,
0.041385091841220856,
0.041761357337236404,
0.06143338233232498,
0.020570311695337296,
0.11418097466230392,
0.044749218970537186,
0.024767590686678886,
0.08574282377958298,
0.06139788031578064,
-0.005420225206762552,
0.014979707077145576,
0.040463559329509735,
-0.06138419359922409,
0.114328533411026,
-0.003879414638504386,
-0.005365454126149416,
0.01569313555955887,
0.026919031515717506,
-0.06963811814785004,
0.05903100222349167,
-0.052572257816791534,
-0.10668829083442688,
0.05549156665802002,
0.03644810989499092,
-0.07589560747146606,
-0.01426524855196476,
-0.05232837796211243,
-0.030364353209733963,
0.0573003813624382,
-0.1025061383843422,
-0.06311962753534317,
-0.08361693471670151,
-7.320411640896935e-33,
-0.023400679230690002,
-0.04951999709010124,
-0.03160177916288376,
0.043746355921030045,
0.018904343247413635,
-0.010489649139344692,
0.02219877950847149,
-0.03846820816397667,
0.03959092125296593,
-0.053204119205474854,
-0.022765276953577995,
0.023831618949770927,
0.002051809336990118,
-0.12636828422546387,
0.011610117740929127,
-0.0002058792597381398,
-0.04938827082514763,
-0.09075244516134262,
-0.004487774800509214,
0.09522518515586853,
-0.024113332852721214,
-0.028571370989084244,
-0.013246402144432068,
0.08599398285150528,
0.0009555122815072536,
-0.03262658789753914,
-0.05497369542717934,
-0.042738936841487885,
-0.02227368764579296,
-0.0498221255838871,
-0.009638039395213127,
-0.011427287012338638,
-0.050108712166547775,
-0.018320707604289055,
-0.02995125949382782,
-0.05592701956629753,
0.09668242931365967,
-0.0865384116768837,
-0.056101586669683456,
0.02584017440676689,
0.031232506036758423,
0.0404067300260067,
0.009972110390663147,
-0.04288932681083679,
-0.010726985521614552,
-0.013856234028935432,
-0.10786159336566925,
-0.009834734722971916,
0.04838127642869949,
0.02055838517844677,
0.010239110328257084,
0.006325317546725273,
-0.07149069011211395,
0.07431817054748535,
-0.0175411906093359,
-0.043912917375564575,
-0.00438481941819191,
-0.016089756041765213,
-0.11568558216094971,
-0.002352801850065589,
-0.04007783904671669,
0.014839931391179562,
-0.08299092948436737,
0.06877017021179199,
0.009626807644963264,
-0.058338019996881485,
-0.019301939755678177,
-0.04688120633363724,
-0.018343383446335793,
-0.012020295485854149,
0.006363049149513245,
-0.07950079441070557,
0.01421043835580349,
0.02228054217994213,
-0.06672415137290955,
0.07560700178146362,
0.05355800688266754,
-0.03408733010292053,
0.029189640656113625,
0.0576184056699276,
-0.015468760393559933,
0.06466328352689743,
0.019415732473134995,
0.06852628290653229,
-0.026858769357204437,
0.031277965754270554,
-0.06720880419015884,
0.0983627662062645,
-0.049420103430747986,
0.0034816553816199303,
-0.037978194653987885,
-0.06536402553319931,
-0.057940319180488586,
0.031206510961055756,
0.014751761220395565,
-6.472814817470862e-8,
-0.026727044954895973,
-0.05238112807273865,
-0.04264508932828903,
0.046540405601263046,
-0.014686292968690395,
-0.023466000333428383,
-0.03299107030034065,
0.09555244445800781,
-0.05666273832321167,
-0.04548138752579689,
0.035630013793706894,
0.005585557781159878,
-0.1670331507921219,
-0.02966158092021942,
0.016080785542726517,
-0.01703636534512043,
-0.011153836734592915,
-0.006616462022066116,
-0.03563981503248215,
-0.07963896542787552,
-0.016348769888281822,
0.046082865446805954,
-0.015115114860236645,
-0.006923876702785492,
0.0019286685856059194,
0.04054713994264603,
-0.026811925694346428,
0.09112922102212906,
-0.03015793301165104,
-0.07357387244701385,
0.06233295798301697,
-0.022401705384254456,
-0.06321437656879425,
-0.011365881189703941,
0.11587986350059509,
0.055832721292972565,
-0.022782154381275177,
-0.003572784597054124,
-0.03253886476159096,
0.04597867652773857,
0.05868649482727051,
0.04050198569893837,
0.01471677515655756,
0.029919728636741638,
0.0176725871860981,
-0.0052049122750759125,
-0.04970735311508179,
0.061834950000047684,
0.09017352014780045,
0.009987035766243935,
0.03573702648282051,
-0.00816352292895317,
-0.03242504596710205,
0.020779361948370934,
0.007517575286328793,
0.039750609546899796,
0.048809897154569626,
-0.007716282270848751,
0.05810307711362839,
-0.027232173830270767,
0.12120043486356735,
-0.02514497935771942,
-0.03351769596338272,
0.0023099498357623816
] | 0.113127
|
text is a difficult task at index-time but we can cleanse the data on-the-fly at query time using the `filter\_duplicate\_text` setting. First let's look at an unfiltered real-world example using the http://research.signalmedia.co/newsir16/signal-dataset.html[Signal media dataset] of a million news articles covering a wide variety of news. Here are the raw significant text results for a search for the articles mentioning "elasticsearch": [source,js] -------------------------------------------------- { ... "aggregations": { "sample": { "doc\_count": 35, "keywords": { "doc\_count": 35, "buckets": [ { "key": "elasticsearch", "doc\_count": 35, "score": 28570.428571428572, "bg\_count": 35 }, ... { "key": "currensee", "doc\_count": 8, "score": 6530.383673469388, "bg\_count": 8 }, ... { "key": "pozmantier", "doc\_count": 4, "score": 3265.191836734694, "bg\_count": 4 }, ... } -------------------------------------------------- // NOTCONSOLE The uncleansed documents have thrown up some odd-looking terms that are, on the face of it, statistically correlated with appearances of our search term "elasticsearch" e.g. "pozmantier". We can drill down into examples of these documents to see why pozmantier is connected using this query: [source,js] -------------------------------------------------- GET news/article/\_search { "query": { "simple\_query\_string": { "query": "+elasticsearch +pozmantier" } }, "\_source": [ "title", "source" ], "highlight": { "fields": { "content": {} } } } -------------------------------------------------- // CONSOLE // TEST[setup:news] The results show a series of very similar news articles about a judging panel for a number of tech projects: [source,js] -------------------------------------------------- { ... "hits": { "hits": [ { ... "\_source": { "source": "Presentation Master", "title": "T.E.N. Announces Nominees for the 2015 ISE® North America Awards" }, "highlight": { "content": [ "City of San Diego Mike *Pozmantier*, Program Manager, Cyber Security Division, Department of", " Janus, Janus *ElasticSearch* Security Visualization Engine " ] } }, { ... "\_source": { "source": "RCL Advisors", "title": "T.E.N. Announces Nominees for the 2015 ISE(R) North America Awards" }, "highlight": { "content": [ "Mike *Pozmantier*, Program Manager, Cyber Security Division, Department of Homeland Security S&T", "Janus, Janus *ElasticSearch* Security Visualization Engine" ] } }, ... -------------------------------------------------- // NOTCONSOLE Mike Pozmantier was one of many judges on a panel and elasticsearch was used in one of many projects being judged. As is typical, this lengthy press release was cut-and-paste by a variety of news sites and consequently any rare names, numbers or typos they contain become statistically correlated with our matching query. Fortunately similar documents tend to rank similarly so as part of examining the stream of top-matching documents the significant\_text aggregation can apply a filter to remove sequences of any 6 or more tokens that have already been seen. Let's try this same query now but with the `filter\_duplicate\_text` setting turned on: [source,js] -------------------------------------------------- GET news/article/\_search { "query": { "match": { "content": "elasticsearch" } }, "aggs": { "sample": { "sampler": { "shard\_size": 100 }, "aggs": { "keywords": { "significant\_text": { "field": "content", "filter\_duplicate\_text": true } } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:news] The results from analysing our deduplicated text are obviously of higher quality to anyone familiar with the elastic stack: [source,js] -------------------------------------------------- { ... "aggregations": { "sample": { "doc\_count": 35, "keywords": { "doc\_count": 35, "buckets": [ { "key": "elasticsearch", "doc\_count": 22, "score": 11288.001166180758, "bg\_count": 35 }, { "key": "logstash", "doc\_count": 3, "score": 1836.648979591837, "bg\_count": 4 }, { "key": "kibana", "doc\_count": 3, "score": 1469.3020408163263, "bg\_count": 5 } ] } } } } -------------------------------------------------- // NOTCONSOLE Mr Pozmantier and other one-off associations with elasticsearch no longer appear in the aggregation results as a consequence of copy-and-paste operations or other forms of mechanical repetition. If your duplicate or near-duplicate content is identifiable via a single-value indexed field (perhaps a hash of the article's `title` text or an `original\_press\_release\_url` field) then it would be more efficient to use a parent <> aggregation to eliminate
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/significanttext-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.01329145859926939,
0.05268863961100578,
0.051635775715112686,
0.10915963351726532,
0.03933509811758995,
0.022763175889849663,
0.02544318698346615,
-0.06460744887590408,
0.09314173460006714,
-0.01739884354174137,
-0.009878229349851608,
0.022581620141863823,
0.024782389402389526,
-0.0040738945826888084,
-0.02292713150382042,
0.048013657331466675,
-0.02075461857020855,
0.03332405909895897,
-0.07478918135166168,
-0.08840037137269974,
0.0804721936583519,
0.06339707970619202,
0.025991123169660568,
-0.055900923907756805,
0.017998840659856796,
0.06708884239196777,
-0.07510445266962051,
-0.0070731667801737785,
0.05238005146384239,
0.0128093883395195,
-0.019354015588760376,
-0.0047139981761574745,
0.06482697278261185,
0.11136122047901154,
-0.03932865336537361,
0.01810598187148571,
-0.038703788071870804,
-0.046170923858881,
0.06285617500543594,
0.028352539986371994,
0.06837468594312668,
0.0202459879219532,
-0.05102141201496124,
-0.08734507113695145,
0.005376788321882486,
-0.03285285085439682,
-0.06081722676753998,
0.004675494506955147,
0.03293991461396217,
0.036934901028871536,
-0.09333720058202744,
-0.0517965704202652,
-0.04755299165844917,
0.05412875860929489,
0.07555334270000458,
-0.0041777268052101135,
-0.1184772327542305,
-0.04254409298300743,
-0.03219452500343323,
-0.06594628095626831,
0.03884570300579071,
-0.050675176084041595,
0.00986314658075571,
-0.020271409302949905,
-0.0033756145276129246,
0.027550535276532173,
0.03240275755524635,
0.04567202925682068,
0.05519964173436165,
0.04052989184856415,
0.023905953392386436,
0.03874199464917183,
0.012158907949924469,
0.037133656442165375,
-0.005911529064178467,
0.04064099118113518,
-0.02104334905743599,
-0.05571640282869339,
0.0064169177785515785,
0.062024518847465515,
-0.03502896800637245,
-0.12017862498760223,
0.01079367846250534,
0.022683139890432358,
-0.002033952157944441,
-0.06423789262771606,
0.030458251014351845,
-0.12197531759738922,
0.019249938428401947,
-0.05490642786026001,
-0.08720416575670242,
-0.10215464234352112,
0.07290019094944,
-0.029764115810394287,
-0.009012287482619286,
0.04603240638971329,
-0.01995159685611725,
0.02294938825070858,
0.1002640500664711,
0.023761063814163208,
0.009404884651303291,
0.0036643287166953087,
0.01564546301960945,
-0.0275526475161314,
-0.1001199260354042,
-0.03374006599187851,
-0.008174028247594833,
0.05154792219400406,
-0.04951843246817589,
0.02082124911248684,
0.021258004009723663,
0.07661958783864975,
-0.012812924571335316,
-0.009567301720380783,
-0.011044192127883434,
0.035135168582201004,
0.054513003677129745,
-0.004831948317587376,
0.05223611742258072,
0.07703932374715805,
0.01980637200176716,
0.001642188522964716,
0.0039255013689398766,
-0.004814285784959793,
-0.002381801139563322,
0.05390091985464096,
0.010798182338476181,
7.202902475679771e-35,
0.03834929317235947,
0.03229707106947899,
0.008155926130712032,
-0.05847431346774101,
-0.0032504380214959383,
0.02534528076648712,
-0.010976401157677174,
0.045913372188806534,
-0.048980455845594406,
0.022554391995072365,
-0.07122183591127396,
0.06256109476089478,
-0.015812024474143982,
-0.05012952908873558,
-0.048254720866680145,
-0.07118737697601318,
-0.023668181151151657,
0.030485058203339577,
-0.026346219703555107,
0.011429441161453724,
0.030035989359021187,
-0.022072862833738327,
0.01963040791451931,
-0.03511708602309227,
-0.056091953068971634,
-0.04937383532524109,
-0.006110312882810831,
-0.08478056639432907,
-0.04521171748638153,
-0.008108275942504406,
-0.08312004804611206,
0.05328714847564697,
0.024811698123812675,
0.04934261366724968,
0.015576422214508057,
0.021658865734934807,
-0.004250712227076292,
0.02835296094417572,
-0.005390099249780178,
-0.011270911432802677,
0.007220517843961716,
0.039363838732242584,
0.006579006090760231,
-0.1433718204498291,
-0.007015663664788008,
0.025541821494698524,
-0.11281245946884155,
-0.01888214610517025,
0.049312103539705276,
-0.022261079400777817,
-0.001394345541484654,
0.02219715528190136,
-0.014096063561737537,
0.009170548059046268,
0.05146085470914841,
-0.008968351408839226,
0.06465849280357361,
0.021956538781523705,
0.021445685997605324,
0.06903820484876633,
0.006388418842107058,
0.013323569670319557,
0.08795666694641113,
0.06607154756784439,
0.08029992133378983,
0.05036846548318863,
0.05715739354491234,
0.1136566549539566,
-0.020035333931446075,
0.012625840492546558,
0.07455737888813019,
0.01589656062424183,
-0.016303488984704018,
-0.04361754655838013,
0.01916351728141308,
-0.08905008435249329,
0.013261966407299042,
-0.0067687672562897205,
0.018997834995388985,
0.057439498603343964,
0.048013508319854736,
-0.1391499787569046,
0.04453691467642784,
-0.032890684902668,
-0.09830180555582047,
0.05577300861477852,
-0.020828917622566223,
-0.09809575974941254,
-0.0003878383431583643,
-0.08222808688879013,
-0.044062189757823944,
0.07081907987594604,
-0.08288025110960007,
-0.1285325586795807,
0.006988778244704008,
-1.5350355529041041e-33,
0.0435931496322155,
-0.05604657903313637,
0.020859867334365845,
0.058848440647125244,
0.02214330993592739,
-0.026489239186048508,
0.01919006183743477,
0.05147081986069679,
0.012165256775915623,
0.022946689277887344,
0.03995811939239502,
-0.07152960449457169,
-0.015466328710317612,
-0.0881982147693634,
-0.03335275873541832,
0.057434387505054474,
0.019575228914618492,
-0.07924359291791916,
-0.047318149358034134,
0.0285613015294075,
-0.03182600811123848,
-0.015206599608063698,
-0.012352574616670609,
0.11697399616241455,
-0.004252218175679445,
-0.05945868045091629,
0.00552107160910964,
-0.010855749249458313,
-0.046558551490306854,
-0.04187615215778351,
-0.014076846651732922,
0.0009516535210423172,
0.004754338413476944,
-0.027760600671172142,
-0.08678470551967621,
0.023743152618408203,
0.06110364571213722,
0.008984413929283619,
-0.0189287681132555,
0.03709249943494797,
0.04588955640792847,
0.049843624234199524,
-0.07591594010591507,
-0.009013299830257893,
-0.004849311430007219,
-0.02381797879934311,
-0.06961264461278915,
0.06318628042936325,
-0.013892018236219883,
-0.0334341786801815,
-0.011918377131223679,
0.03702591359615326,
-0.06708770990371704,
0.046748511493206024,
-0.03933286666870117,
-0.08765646815299988,
-0.053989309817552567,
-0.00484308460727334,
-0.08568362891674042,
0.00968584418296814,
-0.02160898968577385,
0.02105683647096157,
-0.09826705604791641,
0.03402754291892052,
0.05412217229604721,
-0.09072341024875641,
-0.03191575035452843,
-0.03196033835411072,
-0.05548223853111267,
-0.02554057538509369,
0.0029160818085074425,
-0.06259629130363464,
0.03189728409051895,
0.02360280230641365,
0.0035702295135706663,
0.026737641543149948,
0.04074542596936226,
0.00575094623491168,
0.004126852843910456,
0.025924421846866608,
0.020466236397624016,
0.042848825454711914,
0.04010610654950142,
0.10064219683408737,
-0.002426641760393977,
0.09893028438091278,
-0.06792677193880081,
-0.0011944588040933013,
-0.06299266219139099,
0.04145596921443939,
-0.05329331383109093,
-0.11457934230566025,
-0.0982959046959877,
0.007613658905029297,
0.012842835858464241,
-5.2188813270959145e-8,
-0.07512044161558151,
0.04295564070343971,
-0.11880107969045639,
0.055402979254722595,
-0.004624546971172094,
-0.03248574212193489,
0.020844610407948494,
0.10700973123311996,
-0.07593291252851486,
-0.07306220382452011,
0.040707752108573914,
0.002615429228171706,
-0.11792214959859848,
0.048079606145620346,
-0.01162819191813469,
-0.0403699055314064,
-0.053711071610450745,
0.05154002830386162,
-0.008013796992599964,
-0.015357266180217266,
0.03368246927857399,
0.08712366223335266,
0.03750662878155708,
-0.009856357239186764,
0.09498638659715652,
0.06018637865781784,
-0.036738958209753036,
0.012674162164330482,
0.06496724486351013,
-0.016802767291665077,
-0.04399172589182854,
-0.05156528949737549,
-0.06843463331460953,
-0.01363737415522337,
0.05228918790817261,
0.0018044367898255587,
0.0006022569723427296,
-0.015297156758606434,
-0.1357622891664505,
0.054707493633031845,
0.07088002562522888,
0.050347596406936646,
-0.03665894642472267,
0.04991595447063446,
0.043897148221731186,
0.023719193413853645,
-0.006976166274398565,
-0.022854436188936234,
0.13018019497394562,
-0.005941768176853657,
0.056588537991046906,
-0.0674651712179184,
-0.01848866045475006,
0.004441789351403713,
-0.012170206755399704,
-0.016510194167494774,
0.02581535466015339,
0.03411208465695381,
0.031312137842178345,
0.025679411366581917,
0.11097817867994308,
-0.04600388929247856,
0.0032733906991779804,
0.007377183996140957
] | 0.056371
|
a consequence of copy-and-paste operations or other forms of mechanical repetition. If your duplicate or near-duplicate content is identifiable via a single-value indexed field (perhaps a hash of the article's `title` text or an `original\_press\_release\_url` field) then it would be more efficient to use a parent <> aggregation to eliminate these documents from the sample set based on that single key. The less duplicate content you can feed into the significant\_text aggregation up front the better in terms of performance. .How are the significance scores calculated? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* The numbers returned for scores are primarily intended for ranking different suggestions sensibly rather than something easily understood by end users. The scores are derived from the doc frequencies in \_foreground\_ and \_background\_ sets. In brief, a term is considered significant if there is a noticeable difference in the frequency in which a term appears in the subset and in the background. The way the terms are ranked can be configured, see "Parameters" section. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* .Use the \_"like this but not this"\_ pattern \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* You can spot mis-categorized content by first searching a structured field e.g. `category:adultMovie` and use significant\_text on the text "movie\_description" field. Take the suggested words (I'll leave them to your imagination) and then search for all movies NOT marked as category:adultMovie but containing these keywords. You now have a ranked list of badly-categorized movies that you should reclassify or at least remove from the "familyFriendly" category. The significance score from each term can also provide a useful `boost` setting to sort matches. Using the `minimum\_should\_match` setting of the `terms` query with the keywords will help control the balance of precision/recall in the result set i.e a high setting would have a small number of relevant results packed full of keywords and a setting of "1" would produce a more exhaustive results set with all documents containing \_any\_ keyword. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* ==== Limitations ===== No support for child aggregations The significant\_text aggregation intentionally does not support the addition of child aggregations because: \* It would come with a high memory cost \* It isn't a generally useful feature and there is a workaround for those that need it The volume of candidate terms is generally very high and these are pruned heavily before the final results are returned. Supporting child aggregations would generate additional churn and be inefficient. Clients can always take the heavily-trimmed set of results from a `significant\_text` request and make a subsequent follow-up query using a `terms` aggregation with an `include` clause and child aggregations to perform further analysis of selected keywords in a more efficient fashion. ===== No support for nested objects The significant\_text aggregation currently also cannot be used with text fields in nested objects, because it works with the document JSON source. This makes this feature inefficient when matching nested docs from stored JSON given a matching Lucene docID. ===== Approximate counts The counts of how many documents contain a term provided in results are based on summing the samples returned from each shard and as such may be: \* low if certain shards did not provide figures for a given term in their top sample \* high when considering the background frequency as it may count occurrences found in deleted documents Like most design decisions, this is the basis of a trade-off in which we have chosen to provide fast performance at the cost of some (typically small) inaccuracies. However, the `size` and `shard size` settings covered in the next section provide tools to help control the accuracy levels. ==== Parameters ===== Significance heuristics This aggregation supports the same scoring heuristics (JLH, mutual\_information, gnd,
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/significanttext-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.020841090008616447,
0.017070164903998375,
0.01870807074010372,
0.06072818860411644,
0.010851763188838959,
0.05579855665564537,
-0.008910518139600754,
0.11107679456472397,
0.13663350045681,
-0.01752946339547634,
-0.015383478254079819,
0.04527590423822403,
0.08997902274131775,
-0.06255324929952621,
-0.011681018397212029,
0.02623376064002514,
0.04626152664422989,
-0.07343774288892746,
-0.079756960272789,
-0.07843663543462753,
-0.024730462580919266,
0.015418188646435738,
0.06897265464067459,
0.001777651603333652,
0.06829255819320679,
0.028078410774469376,
-0.1251673847436905,
0.08169663697481155,
0.06316240131855011,
0.00031055326689966023,
-0.02710496075451374,
0.10447297990322113,
0.07959992438554764,
0.026305094361305237,
-0.07969019562005997,
0.003778114914894104,
-0.027462830767035484,
-0.02496159076690674,
0.07254307717084885,
0.0021326164714992046,
0.0634327083826065,
-0.054984234273433685,
0.03781908378005028,
-0.02732420153915882,
-0.024894945323467255,
0.024987779557704926,
-0.0847594365477562,
0.000232018661336042,
-0.04121857509016991,
0.06014002859592438,
-0.05543910712003708,
0.07460122555494308,
-0.045843519270420074,
0.05262524634599686,
0.054547253996133804,
-0.011469438672065735,
-0.023495199158787727,
-0.01788000762462616,
-0.05121174082159996,
-0.03361503779888153,
-0.04274811968207359,
-0.034134894609451294,
-0.08770967274904251,
-0.02748793363571167,
0.05334491655230522,
-0.02738814987242222,
0.012249909341335297,
-0.07252684980630875,
0.025687407702207565,
0.03022507205605507,
0.03407956659793854,
0.07216263562440872,
0.05700358748435974,
0.09436789900064468,
0.04783110320568085,
0.03273080289363861,
-0.10147253423929214,
-0.08047488331794739,
-0.033148158341646194,
0.035182155668735504,
-0.01123915333300829,
-0.07278602570295334,
-0.01586778089404106,
-0.0179558377712965,
0.050934839993715286,
-0.02373647317290306,
0.12828697264194489,
-0.0892239585518837,
-0.033976390957832336,
-0.01338872779160738,
-0.02344380132853985,
-0.09324431419372559,
0.07306542247533798,
0.028275875374674797,
-0.0030806465074419975,
-0.006998252123594284,
-0.03093293309211731,
-0.04568622261285782,
0.04875413328409195,
0.011708167381584644,
0.06996311992406845,
0.04476514831185341,
-0.025218363851308823,
-0.027567744255065918,
0.005534080322831869,
-0.04565984010696411,
0.0056990752927958965,
0.05343993008136749,
-0.01366487704217434,
-0.05485008656978607,
0.02475414238870144,
-0.014046515338122845,
-0.00191586185246706,
0.01160372793674469,
-0.049644835293293,
-0.015161722898483276,
0.08607864379882812,
0.05357414856553078,
0.06472828984260559,
0.029463015496730804,
0.06289453059434891,
-0.023565588518977165,
0.03536570072174072,
-0.08099895715713501,
-0.044587694108486176,
-0.0199794489890337,
-0.04122446849942207,
1.4521033244276378e-33,
-0.040008727461099625,
0.008939395658671856,
-0.003912930376827717,
-0.0030887178145349026,
-0.012897619977593422,
0.01086240354925394,
-0.0501408688724041,
0.008117076009511948,
-0.022365262731909752,
-0.02593878097832203,
-0.11155278980731964,
0.029818693175911903,
0.04471317306160927,
-0.0009649407584220171,
-0.017771588638424873,
-0.006603702437132597,
0.051992084830999374,
0.049405913800001144,
-0.022947821766138077,
0.05534859001636505,
0.10442417114973068,
0.06136252358555794,
0.06122113764286041,
0.003266662824898958,
0.0017473868792876601,
0.011089609935879707,
-0.014810734428465366,
-0.042853329330682755,
-0.08378790318965912,
-0.02070683054625988,
0.0004524420655798167,
0.016564199700951576,
0.017609262838959694,
0.023357242345809937,
0.04212445393204689,
-0.005533719900995493,
0.06863703578710556,
-0.06188996136188507,
0.0177308339625597,
-0.02369711734354496,
-0.0955948531627655,
0.01585848443210125,
-0.009458980523049831,
-0.08212094753980637,
-0.033785175532102585,
-0.035823896527290344,
-0.10230406373739243,
0.023091450333595276,
0.0224099513143301,
0.01064236555248499,
-0.04983305558562279,
0.039138589054346085,
0.044465046375989914,
0.005223008804023266,
-0.06654900312423706,
-0.013567411340773106,
0.006701544858515263,
-0.06606532633304596,
0.014577352441847324,
0.04197004437446594,
-0.013032425194978714,
0.03304469212889671,
0.009046466089785099,
0.020973598584532738,
0.06964940577745438,
0.062357041984796524,
0.051676634699106216,
0.0818866714835167,
0.03510447219014168,
-0.011620759032666683,
0.013956374488770962,
-0.001021123956888914,
-0.07527513056993484,
-0.12759490311145782,
0.002040958497673273,
-0.040796030312776566,
0.06462322920560837,
-0.033188216388225555,
0.04816234111785889,
-0.03378322347998619,
-0.0020163129083812237,
-0.03093419037759304,
0.01056721992790699,
-0.10928955674171448,
-0.0555824376642704,
0.0984501764178276,
-0.018549639731645584,
-0.08942048996686935,
-0.04703488200902939,
-0.05472547188401222,
0.07907919585704803,
0.02219371497631073,
-0.11833148449659348,
-0.06872188299894333,
-0.03024970553815365,
-3.757921727096447e-33,
0.00914298091083765,
-0.00455233920365572,
-0.009755891747772694,
0.015308797359466553,
0.025225814431905746,
-0.008481977507472038,
-0.05045168474316597,
-0.05977769196033478,
-0.08675739914178848,
-0.047330185770988464,
0.029580144211649895,
-0.021679921075701714,
-0.02442135661840439,
-0.06433237344026566,
-0.0019212221959605813,
0.018407953903079033,
-0.0318819060921669,
-0.031845252960920334,
-0.09916958957910538,
0.04713331535458565,
0.043415363878011703,
0.025423688814044,
0.005349479150027037,
0.0831623524427414,
-0.011292455717921257,
-0.08067040890455246,
-0.044240646064281464,
-0.10011358559131622,
0.010830271989107132,
-0.07320322096347809,
0.055851392447948456,
-0.009756322018802166,
-0.036711033433675766,
-0.01882917992770672,
0.01477200910449028,
-0.00915099773555994,
0.05241378769278526,
-0.05715632066130638,
-0.04044586792588234,
0.09107937663793564,
0.038269441574811935,
0.021952133625745773,
-0.011920536868274212,
-0.017321156337857246,
0.015936292707920074,
0.07106974720954895,
-0.04037398472428322,
0.022993117570877075,
0.023203089833259583,
-0.0020618208218365908,
0.02345915511250496,
0.015198318287730217,
-0.09949272125959396,
0.0408342182636261,
0.0021823723800480366,
-0.014439763501286507,
-0.038101181387901306,
0.011626717634499073,
-0.09753458201885223,
0.03023103065788746,
0.06753148138523102,
0.06255454570055008,
-0.11385440826416016,
0.024120748043060303,
0.036022115498781204,
0.00783076137304306,
-0.05661151185631752,
-0.01778826303780079,
-0.029593421146273613,
0.03446408361196518,
-0.06087718531489372,
-0.032400671392679214,
0.03305603191256523,
-0.07160072028636932,
-0.0026704983320087194,
0.05592891201376915,
0.033192120492458344,
0.03725670650601387,
-0.05779225379228592,
0.013274900615215302,
-0.03402572125196457,
0.0029883519746363163,
-0.03165746107697487,
0.031941767781972885,
-0.04947560280561447,
0.053999897092580795,
0.039628468453884125,
0.05536109209060669,
-0.03160174936056137,
0.02857924997806549,
-0.02493538334965706,
0.045412953943014145,
-0.08105747401714325,
0.002655705902725458,
0.00791116151958704,
-6.250053985468185e-8,
-0.0400727279484272,
-0.001014550100080669,
-0.177322655916214,
0.09130394458770752,
-0.09984923899173737,
-0.024067968130111694,
-0.028958572074770927,
0.023350831121206284,
-0.07061772793531418,
-0.02945246919989586,
0.028341930359601974,
-0.05184219405055046,
-0.14596284925937653,
-0.024053379893302917,
0.016545528545975685,
-0.010287088342010975,
-0.017369674518704414,
0.06743936240673065,
0.005921041127294302,
-0.07289351522922516,
0.06816671788692474,
-0.0045012314803898335,
0.0709201917052269,
0.03246491402387619,
-0.039391618221998215,
0.06885740160942078,
-0.030895130708813667,
0.0146492850035429,
-0.0146262152120471,
-0.028661487624049187,
0.08805478364229202,
-0.0676548108458519,
-0.039591286331415176,
-0.007729904260486364,
0.10303381830453873,
0.08020564168691635,
0.02453046292066574,
0.046195417642593384,
-0.027488993480801582,
0.0711212232708931,
0.03524911403656006,
-0.04672038182616234,
-0.015025741420686245,
0.09934943169355392,
0.027140215039253235,
0.01415372546762228,
-0.07145706564188004,
0.03629438206553459,
0.03662202134728432,
0.002037014113739133,
0.018441298976540565,
-0.04828685149550438,
-0.03018639050424099,
0.021020900458097458,
0.05514458194375038,
0.047173354774713516,
0.04568840190768242,
0.00746452622115612,
0.013280096463859081,
-0.0037453961558640003,
0.12234590947628021,
-0.006083288230001926,
0.017170725390315056,
-0.014745323918759823
] | 0.09398
|
we have chosen to provide fast performance at the cost of some (typically small) inaccuracies. However, the `size` and `shard size` settings covered in the next section provide tools to help control the accuracy levels. ==== Parameters ===== Significance heuristics This aggregation supports the same scoring heuristics (JLH, mutual\_information, gnd, chi\_square etc) as the <> aggregation [[sig-text-shard-size]] ===== Size & Shard Size The `size` parameter can be set to define how many term buckets should be returned out of the overall terms list. By default, the node coordinating the search process will request each shard to provide its own top term buckets and once all shards respond, it will reduce the results to the final list that will then be returned to the client. If the number of unique terms is greater than `size`, the returned list can be slightly off and not accurate (it could be that the term counts are slightly off and it could even be that a term that should have been in the top size buckets was not returned). To ensure better accuracy a multiple of the final `size` is used as the number of terms to request from each shard using a heuristic based on the number of shards. To take manual control of this setting the `shard\_size` parameter can be used to control the volumes of candidate terms produced by each shard. Low-frequency terms can turn out to be the most interesting ones once all results are combined so the significant\_terms aggregation can produce higher-quality results when the `shard\_size` parameter is set to values significantly higher than the `size` setting. This ensures that a bigger volume of promising candidate terms are given a consolidated review by the reducing node before the final selection. Obviously large candidate term lists will cause extra network traffic and RAM usage so this is quality/cost trade off that needs to be balanced. If `shard\_size` is set to -1 (the default) then `shard\_size` will be automatically estimated based on the number of shards and the `size` parameter. NOTE: `shard\_size` cannot be smaller than `size` (as it doesn't make much sense). When it is, elasticsearch will override it and reset it to be equal to `size`. ===== Minimum document count It is possible to only return terms that match more than a configured number of hits using the `min\_doc\_count` option. The Default value is 3. Terms that score highly will be collected on a shard level and merged with the terms collected from other shards in a second step. However, the shard does not have the information about the global term frequencies available. The decision if a term is added to a candidate list depends only on the score computed on the shard using local shard frequencies, not the global frequencies of the word. The `min\_doc\_count` criterion is only applied after merging local terms statistics of all shards. In a way the decision to add the term as a candidate is made without being very \_certain\_ about if the term will actually reach the required `min\_doc\_count`. This might cause many (globally) high frequent terms to be missing in the final result if low frequent but high scoring terms populated the candidate lists. To avoid this, the `shard\_size` parameter can be increased to allow more candidate terms on the shards. However, this increases memory consumption and network traffic. `shard\_min\_doc\_count` parameter The parameter `shard\_min\_doc\_count` regulates the \_certainty\_ a shard has if the term should actually be added to the candidate list or not with respect to the `min\_doc\_count`. Terms will only be considered if their local shard frequency within the set is
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/significanttext-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.026366494596004486,
-0.017536986619234085,
0.01335033867508173,
0.03876882046461105,
-0.03219117224216461,
-0.02817070670425892,
-0.03803837299346924,
0.006212200503796339,
0.06326737999916077,
-0.028623264282941818,
-0.0362992063164711,
-0.00925331562757492,
0.08462540805339813,
-0.04143328219652176,
-0.052053261548280716,
-0.030354108661413193,
0.0195933748036623,
0.03489804267883301,
-0.06286528706550598,
-0.11143815517425537,
-0.014771711081266403,
-0.038851261138916016,
0.04759225249290466,
-0.0612274706363678,
0.014540971256792545,
-0.027084380388259888,
-0.12731534242630005,
0.0016619159141555429,
0.030741190537810326,
-0.03131074830889702,
0.0238950215280056,
0.06954153627157211,
0.02376163937151432,
0.04797174781560898,
-0.047833219170570374,
0.018917247653007507,
-0.09097058326005936,
-0.02038818597793579,
-0.030112244188785553,
0.0012807766906917095,
0.0074614654295146465,
-0.010335912927985191,
-0.010643747635185719,
-0.0413375161588192,
-0.009231203235685825,
-0.006241936702281237,
-0.07660531997680664,
0.0024014434311538935,
0.015990374609827995,
-0.010436705313622952,
-0.07341745495796204,
-0.027633322402834892,
-0.022391943261027336,
0.031212598085403442,
-0.012629768811166286,
0.017783286049962044,
-0.10033801198005676,
-0.0535951592028141,
-0.052693963050842285,
-0.05647043511271477,
-0.0474080964922905,
-0.07331138104200363,
-0.020225856453180313,
-0.038356076925992966,
0.10064424574375153,
0.034433312714099884,
0.13595646619796753,
-0.015541624277830124,
-0.013800485990941525,
0.05113743990659714,
0.07254138588905334,
0.05408717319369316,
-0.08098111301660538,
0.05883532017469406,
0.02410486713051796,
0.09894401580095291,
-0.024683035910129547,
-0.013164701871573925,
0.009196599945425987,
0.03653673082590103,
-0.1157790943980217,
0.039049018174409866,
0.0016507282853126526,
-0.013114734552800655,
0.026174813508987427,
-0.03147706389427185,
-0.028378315269947052,
-0.05952645465731621,
0.013799706473946571,
-0.025429558008909225,
0.020742235705256462,
-0.037617605179548264,
0.058880340307950974,
-0.07363889366388321,
0.06504783034324646,
0.009710338898003101,
0.013603403232991695,
0.02037563920021057,
0.07970940321683884,
-0.016170624643564224,
0.04700927436351776,
0.04107432812452316,
0.024239078164100647,
-0.12971675395965576,
0.0013253375655040145,
0.009592997841536999,
-0.025911934673786163,
0.07649118453264236,
0.04487273097038269,
0.026526495814323425,
0.02594383805990219,
-0.004164915066212416,
0.03344063088297844,
0.00012722829706035554,
-0.02246478758752346,
0.0497320182621479,
0.06623796373605728,
-0.037108130753040314,
0.0471772700548172,
0.005635854788124561,
0.01570477895438671,
0.04016388580203056,
0.08628618717193604,
-0.019044045358896255,
0.01694435626268387,
0.05911315605044365,
-0.0849093422293663,
4.361174775020891e-33,
-0.006232250016182661,
0.007988146506249905,
0.07888912409543991,
-0.003569416468963027,
-0.060534216463565826,
0.05766509100794792,
-0.03256900608539581,
0.023991558700799942,
-0.08943085372447968,
0.015077890828251839,
-0.08966630697250366,
0.15882530808448792,
-0.015320858918130398,
-0.03816566243767738,
0.09543195366859436,
-0.06510718166828156,
0.092972032725811,
0.10101744532585144,
-0.045807838439941406,
-0.03480387106537819,
0.03951828554272652,
-0.05378422513604164,
0.07875286042690277,
-0.00893064122647047,
0.0014846590347588062,
-0.020516574382781982,
0.0011880818055942655,
0.005878979340195656,
-0.05465713143348694,
0.010436520911753178,
-0.030650386586785316,
-0.018357934430241585,
0.023457948118448257,
0.001259715761989355,
0.04900265112519264,
0.0007082278607413173,
-0.04458225518465042,
-0.01677417941391468,
0.015624254010617733,
-0.10212022811174393,
-0.028886860236525536,
0.02420693449676037,
0.06695961952209473,
-0.07046002149581909,
-0.11142381280660629,
0.01922479458153248,
-0.043960947543382645,
-0.03928590938448906,
-0.023575380444526672,
0.03673793375492096,
0.017240136861801147,
0.017366064712405205,
0.021864764392375946,
0.11278314888477325,
0.04354093596339226,
0.019862022250890732,
0.062088415026664734,
-0.010325533337891102,
-0.06153120845556259,
0.12331130355596542,
-0.03634063899517059,
-0.020471787080168724,
-0.012614710256457329,
0.06842627376317978,
0.026654789224267006,
0.027767125517129898,
0.012288261204957962,
0.13170911371707916,
0.05424392595887184,
0.0686350166797638,
0.04322041943669319,
0.09102470427751541,
0.04659217968583107,
-0.031702812761068344,
0.04311908408999443,
-0.11250849068164825,
0.058616627007722855,
-0.04931654781103134,
-0.044613443315029144,
-0.0442904457449913,
-0.015906501561403275,
0.008697845973074436,
0.019602522253990173,
0.020667370408773422,
-0.059218648821115494,
0.02330310083925724,
0.06647590547800064,
-0.005460501182824373,
-0.06517308205366135,
-0.03298874944448471,
-0.06429599225521088,
0.02393275313079357,
-0.016731807962059975,
-0.04408634826540947,
-0.09640250355005264,
-4.404899858793618e-33,
-0.019459329545497894,
-0.06378871202468872,
0.022693969309329987,
0.06195740029215813,
0.05801190808415413,
-0.043740712106227875,
0.015459170565009117,
-0.04440150037407875,
0.013857809826731682,
-0.06469133496284485,
-0.020911799743771553,
-0.006928206887096167,
0.0462387315928936,
-0.06668983399868011,
0.01704275608062744,
0.040136225521564484,
-0.0350661538541317,
-0.09383636713027954,
0.074410580098629,
0.02664918452501297,
0.001591581734828651,
-0.009070200845599174,
-0.02243993803858757,
0.09039664268493652,
-0.040848664939403534,
-0.011826559901237488,
-0.04836907982826233,
-0.06000668182969093,
-0.020503010600805283,
0.013834142126142979,
0.019700927659869194,
-0.031385984271764755,
-0.03907758370041847,
-0.08367923647165298,
-0.008958972059190273,
-0.10624654591083527,
0.04152040183544159,
0.02310340106487274,
0.02385464310646057,
0.0964939221739769,
0.01825028844177723,
-0.025629103183746338,
-0.048640962690114975,
-0.05518597364425659,
0.016147878021001816,
0.023087989538908005,
-0.040207769721746445,
0.05714843422174454,
0.03627971187233925,
0.011817645281553268,
-0.015777822583913803,
-0.0009707012213766575,
-0.031689222902059555,
0.1349647343158722,
-0.023043422028422356,
-0.0006014973623678088,
-0.04841427132487297,
0.04435913264751434,
-0.09102475643157959,
-0.027443669736385345,
-0.07046524435281754,
-0.008585608564317226,
-0.023894445970654488,
0.04095204174518585,
0.0031175126787275076,
0.00597588624805212,
-0.01866721734404564,
-0.08712626248598099,
0.008249524980783463,
-0.02724229171872139,
-0.07354798167943954,
-0.029310373589396477,
0.039480630308389664,
0.01708303578197956,
-0.004331330768764019,
-0.01839391514658928,
-0.011245118454098701,
-0.047987792640924454,
0.02668587863445282,
0.0531565360724926,
-0.08439084142446518,
0.10704798251390457,
0.023962831124663353,
0.09645969420671463,
0.03174622356891632,
-0.05167929455637932,
0.06850916147232056,
0.10368579626083374,
-0.017175132408738136,
0.06671827286481857,
0.006018099840730429,
-0.02678033895790577,
-0.010322704911231995,
0.0012098668375983834,
0.0037232786417007446,
-5.72697906875419e-8,
-0.06605002284049988,
0.03446481376886368,
-0.07058078795671463,
0.03527407720685005,
0.02317197620868683,
-0.024078678339719772,
-0.02951338328421116,
0.08657869696617126,
-0.0335339792072773,
0.03023836575448513,
0.09773950278759003,
-0.01578914187848568,
-0.11585033684968948,
-0.011579878628253937,
0.056694984436035156,
0.03600795567035675,
-0.030655333772301674,
0.02041308954358101,
-0.05414021387696266,
-0.04185638204216957,
-0.028026709333062172,
0.05046697333455086,
-0.0026091616600751877,
0.011416405439376831,
-0.019916631281375885,
0.0003786550660151988,
0.015871699899435043,
0.07899308949708939,
-0.043573252856731415,
0.005280499346554279,
0.01617930643260479,
-0.0227953027933836,
-0.048944953829050064,
-0.021100081503391266,
0.055199794471263885,
0.05140509828925133,
-0.10274800658226013,
0.014183392748236656,
0.03441759943962097,
0.06383118778467178,
0.011693775653839111,
0.044753413647413254,
-0.028057947754859924,
0.03921031951904297,
0.019684147089719772,
-0.004364007618278265,
-0.07204412668943405,
0.09787896275520325,
0.06439996510744095,
0.010390780866146088,
-0.012226605787873268,
-0.018248192965984344,
-0.041459571570158005,
0.026607977226376534,
0.06681806594133377,
0.003628186183050275,
0.012455062940716743,
-0.09094313532114029,
0.09930403530597687,
0.022669529542326927,
0.11548619717359543,
-0.10550747066736221,
-0.0363655760884285,
-0.008913680911064148
] | 0.021913
|
this increases memory consumption and network traffic. `shard\_min\_doc\_count` parameter The parameter `shard\_min\_doc\_count` regulates the \_certainty\_ a shard has if the term should actually be added to the candidate list or not with respect to the `min\_doc\_count`. Terms will only be considered if their local shard frequency within the set is higher than the `shard\_min\_doc\_count`. If your dictionary contains many low frequent words and you are not interested in these (for example misspellings), then you can set the `shard\_min\_doc\_count` parameter to filter out candidate terms on a shard level that will with a reasonable certainty not reach the required `min\_doc\_count` even after merging the local frequencies. `shard\_min\_doc\_count` is set to `1` per default and has no effect unless you explicitly set it. WARNING: Setting `min\_doc\_count` to `1` is generally not advised as it tends to return terms that are typos or other bizarre curiosities. Finding more than one instance of a term helps reinforce that, while still rare, the term was not the result of a one-off accident. The default value of 3 is used to provide a minimum weight-of-evidence. Setting `shard\_min\_doc\_count` too high will cause significant candidate terms to be filtered out on a shard level. This value should be set much lower than `min\_doc\_count/#shards`. ===== Custom background context The default source of statistical information for background term frequencies is the entire index and this scope can be narrowed through the use of a `background\_filter` to focus in on significant terms within a narrower context: [source,js] -------------------------------------------------- GET news/article/\_search { "query" : { "match" : { "content" : "madrid" } }, "aggs" : { "tags" : { "significant\_text" : { "field" : "content", "background\_filter": { "term" : { "content" : "spain"} } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:news] The above filter would help focus in on terms that were peculiar to the city of Madrid rather than revealing terms like "Spanish" that are unusual in the full index's worldwide context but commonplace in the subset of documents containing the word "Spain". WARNING: Use of background filters will slow the query as each term's postings must be filtered to determine a frequency ===== Dealing with source and index mappings Ordinarily the indexed field name and the original JSON field being retrieved share the same name. However with more complex field mappings using features like `copy\_to` the source JSON field(s) and the indexed field being aggregated can differ. In these cases it is possible to list the JSON \_source fields from which text will be analyzed using the `source\_fields` parameter: [source,js] -------------------------------------------------- GET news/article/\_search { "query" : { "match" : { "custom\_all" : "elasticsearch" } }, "aggs" : { "tags" : { "significant\_text" : { "field" : "custom\_all", "source\_fields": ["content" , "title"] } } } } -------------------------------------------------- // CONSOLE // TEST[setup:news] ===== Filtering Values It is possible (although rarely required) to filter the values for which buckets will be created. This can be done using the `include` and `exclude` parameters which are based on a regular expression string or arrays of exact terms. This functionality mirrors the features described in the <> documentation.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/significanttext-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.06923729181289673,
-0.037379808723926544,
-0.003105507930740714,
-0.0023837131448090076,
-0.02680637128651142,
0.007636316120624542,
0.041662704199552536,
-0.009688835591077805,
0.05693493410944939,
-0.03200683742761612,
0.06258077919483185,
-0.008868003264069557,
0.0978408083319664,
-0.011566772125661373,
-0.041280005127191544,
-0.0016200300306081772,
0.013130277395248413,
0.008057857863605022,
-0.09562443196773529,
-0.044793158769607544,
0.0466434620320797,
0.06436614692211151,
0.03934284299612045,
-0.020363491028547287,
0.0015950917731970549,
-0.026272084563970566,
-0.07340893894433975,
0.024149520322680473,
0.03950095549225807,
-0.007164504379034042,
0.009402763098478317,
0.13785171508789062,
0.01106518879532814,
-0.01421452034264803,
0.07442288100719452,
-0.004578833002597094,
-0.06914525479078293,
0.026621589437127113,
0.003100908827036619,
-0.004484153352677822,
-0.049179401248693466,
-0.03639088198542595,
-0.08071579039096832,
0.0683368444442749,
-0.0966828465461731,
0.04410615563392639,
-0.06165415421128273,
0.005926400423049927,
0.0023439654614776373,
-0.02698933705687523,
-0.021726980805397034,
0.02070920541882515,
-0.03199959546327591,
0.0535840205848217,
0.0061353095807135105,
-0.04590485990047455,
-0.08529172837734222,
0.009730766527354717,
-0.0731368288397789,
-0.07724757492542267,
-0.06819973886013031,
-0.055963996797800064,
-0.07125069200992584,
-0.040549539029598236,
0.010419227182865143,
-0.0044369823299348354,
0.048302534967660904,
-0.02421332150697708,
0.012402939610183239,
0.09096841514110565,
-0.04298054799437523,
0.0887451171875,
-0.04204030707478523,
0.08975312113761902,
0.04259821027517319,
0.04730978235602379,
0.011844546534121037,
-0.09004408866167068,
0.01671825535595417,
0.009849018417298794,
-0.09192800521850586,
0.023730402812361717,
0.041613321751356125,
-0.017450381070375443,
0.052295710891485214,
-0.07604003697633743,
0.036622047424316406,
-0.08208024501800537,
0.035661421716213226,
-0.049910105764865875,
0.011833853088319302,
-0.06073584407567978,
0.10454218834638596,
-0.03870360553264618,
0.04497849941253662,
0.01864524371922016,
0.029901256784796715,
0.06702210009098053,
0.04937468469142914,
0.03119361773133278,
0.012302502989768982,
-0.036516040563583374,
-0.037345871329307556,
-0.03325667232275009,
-0.023954464122653008,
-0.017972640693187714,
-0.034964218735694885,
-0.01885758712887764,
0.05453651770949364,
-0.02472517266869545,
0.017338445410132408,
0.0006090098177082837,
0.017849864438176155,
-0.052357614040374756,
-0.014932921156287193,
0.09571023285388947,
0.056429423391819,
-0.01934140734374523,
-0.006118844263255596,
0.005113640334457159,
-0.10271894186735153,
-0.025647807866334915,
0.08568025380373001,
-0.022197803482413292,
-0.028743887320160866,
0.010108680464327335,
-0.03982287645339966,
-1.238515266199259e-33,
0.014286433346569538,
-0.01874026469886303,
-0.06008328124880791,
-0.043746981769800186,
0.010372741147875786,
0.021344657987356186,
-0.025395210832357407,
0.029515517875552177,
-0.05766058340668678,
-0.01668861135840416,
-0.05792708694934845,
0.09283677488565445,
-0.017808254808187485,
-0.019301412627100945,
0.04686841741204262,
-0.08070114254951477,
0.11169357597827911,
0.07590653002262115,
-0.027020225301384926,
-0.0191792082041502,
0.05564630404114723,
-0.0750923752784729,
0.06928232312202454,
-0.04744233563542366,
-0.061944153159856796,
-0.033038027584552765,
0.015122229233384132,
-0.07478324323892593,
0.016198627650737762,
0.028537780046463013,
-0.04562903568148613,
-0.016638699918985367,
0.06002020463347435,
-0.01684376411139965,
0.02236267365515232,
0.023209141567349434,
0.003296838141977787,
-0.027618752792477608,
0.044839877635240555,
-0.11607538163661957,
-0.026517949998378754,
0.033122144639492035,
0.05639972537755966,
-0.01875203847885132,
-0.04606202617287636,
0.007513887714594603,
0.004973979666829109,
-0.009061521850526333,
-0.06695109605789185,
0.036955397576093674,
0.031071199104189873,
0.007409294601529837,
-0.03092781826853752,
0.09129852801561356,
-0.028006860986351967,
-0.005721007939428091,
0.009449169971048832,
-0.10237045586109161,
-0.0035225364845246077,
0.051336824893951416,
-0.016048138961195946,
0.03475933149456978,
0.0494203194975853,
0.08802829682826996,
0.10588732361793518,
-0.02998322620987892,
0.03867286443710327,
0.08196741342544556,
0.05022171512246132,
0.0716032087802887,
-0.004803887568414211,
0.02587261237204075,
-0.07369237393140793,
-0.008587312884628773,
0.04153062030673027,
-0.003971512895077467,
0.0855865553021431,
-0.06737974286079407,
-0.05486768111586571,
-0.06367652863264084,
0.024288730695843697,
-0.02295517362654209,
-0.040542636066675186,
-0.04222950339317322,
-0.08989522606134415,
-0.007346280384808779,
0.07670130580663681,
-0.08736822754144669,
-0.0624355711042881,
-0.047708556056022644,
-0.04372559115290642,
-0.019025400280952454,
-0.08017148822546005,
-0.02109624072909355,
-0.07140164077281952,
-7.994558202106494e-34,
0.010828645899891853,
-0.09431562572717667,
0.026663314551115036,
0.06006010249257088,
-0.03430100902915001,
-0.032787177711725235,
0.0891462117433548,
0.032583072781562805,
0.03542916104197502,
-0.06516065448522568,
0.0391731821000576,
-0.03858009725809097,
0.06262680888175964,
-0.04873279109597206,
0.012216941453516483,
0.021730221807956696,
-0.05296963453292847,
0.015075094066560268,
0.038937345147132874,
0.09306534379720688,
-0.015163414180278778,
-0.009093756787478924,
-0.08932964503765106,
0.088101327419281,
-0.04947282001376152,
0.006708238739520311,
-0.09249235689640045,
-0.09441295266151428,
-0.01821301318705082,
-0.00596243143081665,
-0.017974402755498886,
0.06111159175634384,
-0.055282216519117355,
-0.05792014300823212,
-0.04265233501791954,
-0.01697087287902832,
0.04550611600279808,
0.018745021894574165,
-0.038375064730644226,
0.07583370804786682,
0.07793235033750534,
0.06333019584417343,
-0.012105184607207775,
-0.05638710781931877,
-0.04134417697787285,
-0.04132503271102905,
-0.09903332591056824,
0.014110161922872066,
0.011374016292393208,
-0.018540004268288612,
0.07187899947166443,
0.022444598376750946,
0.02175767533481121,
0.1154409795999527,
-0.01304483599960804,
0.04111477732658386,
-0.028140367940068245,
-0.01807122677564621,
-0.09930352866649628,
0.03116692416369915,
-0.038402169942855835,
0.007816853001713753,
-0.08453886210918427,
-0.026019727811217308,
0.05206393450498581,
0.0361211933195591,
-0.06798618286848068,
-0.026294220238924026,
0.07553277909755707,
-0.038472529500722885,
0.010343017987906933,
0.03426029533147812,
-0.021739521995186806,
-0.018290868028998375,
-0.07459749281406403,
-0.03178955614566803,
0.018009262159466743,
-0.05606653913855553,
-0.019873637706041336,
0.07459984719753265,
-0.04632549360394478,
0.07480443269014359,
-0.006235166452825069,
0.011550621129572392,
-0.021392496302723885,
-0.06097503378987312,
0.022477224469184875,
0.023580901324748993,
-0.03316465765237808,
0.049050647765398026,
0.002037858823314309,
-0.043059226125478745,
-0.01728878915309906,
0.003012480214238167,
-0.04860372468829155,
-5.013613701976283e-8,
-0.08607687056064606,
0.03435332328081131,
-0.0375618115067482,
0.038078151643276215,
0.0728020891547203,
-0.05262929946184158,
-0.0036358009092509747,
0.03216366842389107,
-0.02342844568192959,
-0.03103473037481308,
0.11703254282474518,
-0.0055515640415251255,
-0.08567670732736588,
-0.007038394454866648,
0.03206106275320053,
0.11757893115282059,
0.038852497935295105,
0.05668218806385994,
-0.007618382107466459,
-0.03666778281331062,
-0.0060007618740201,
0.03241080418229103,
-0.013379193842411041,
0.04409536346793175,
-0.028974175453186035,
0.03671004995703697,
0.11026764661073685,
0.09622117877006531,
0.023594222962856293,
0.020936187356710434,
0.0091248769313097,
-0.01815592125058174,
-0.04199894145131111,
-0.0348043367266655,
0.005212854593992233,
0.12780091166496277,
-0.15249142050743103,
-0.03132990375161171,
-0.023412445560097694,
0.11694885045289993,
0.02601769007742405,
-0.010428574867546558,
-0.034500181674957275,
0.06974463164806366,
0.012189431115984917,
-0.0356207974255085,
-0.05983518436551094,
0.043577924370765686,
0.0435505174100399,
-0.022887548431754112,
0.04727230221033096,
0.07931961864233017,
0.08878693729639053,
-0.007034980691969395,
0.0028742908034473658,
0.057393044233322144,
0.045283861458301544,
0.006672075483947992,
-0.054289061576128006,
-0.016450073570013046,
0.07530361413955688,
-0.018379073590040207,
0.045429643243551254,
-0.0037304190918803215
] | 0.047227
|
[[search-aggregations-bucket-datehistogram-aggregation]] === Date Histogram Aggregation A multi-bucket aggregation similar to the <> except it can only be applied on date values. Since dates are represented in Elasticsearch internally as long values, it is possible to use the normal `histogram` on dates as well, though accuracy will be compromised. The reason for this is in the fact that time based intervals are not fixed (think of leap years and on the number of days in a month). For this reason, we need special support for time based data. From a functionality perspective, this histogram supports the same features as the normal <>. The main difference is that the interval can be specified by date/time expressions. Requesting bucket intervals of a month. [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "sales\_over\_time" : { "date\_histogram" : { "field" : "date", "interval" : "month" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] Available expressions for interval: `year` (`1y`), `quarter` (`1q`), `month` (`1M`), `week` (`1w`), `day` (`1d`), `hour` (`1h`), `minute` (`1m`), `second` (`1s`) Time values can also be specified via abbreviations supported by <> parsing. Note that fractional time values are not supported, but you can address this by shifting to another time unit (e.g., `1.5h` could instead be specified as `90m`). Also note that time intervals larger than than days do not support arbitrary values but can only be one unit large (e.g. `1y` is valid, `2y` is not). [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "sales\_over\_time" : { "date\_histogram" : { "field" : "date", "interval" : "90m" } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] ==== Keys Internally, a date is represented as a 64 bit number representing a timestamp in milliseconds-since-the-epoch. These timestamps are returned as the bucket ++key++s. The `key\_as\_string` is the same timestamp converted to a formatted date string using the format specified with the `format` parameter: TIP: If no `format` is specified, then it will use the first date <> specified in the field mapping. [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "sales\_over\_time" : { "date\_histogram" : { "field" : "date", "interval" : "1M", "format" : "yyyy-MM-dd" <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> Supports expressive date <> Response: [source,js] -------------------------------------------------- { ... "aggregations": { "sales\_over\_time": { "buckets": [ { "key\_as\_string": "2015-01-01", "key": 1420070400000, "doc\_count": 3 }, { "key\_as\_string": "2015-02-01", "key": 1422748800000, "doc\_count": 2 }, { "key\_as\_string": "2015-03-01", "key": 1425168000000, "doc\_count": 2 } ] } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] ==== Time Zone Date-times are stored in Elasticsearch in UTC. By default, all bucketing and rounding is also done in UTC. The `time\_zone` parameter can be used to indicate that bucketing should use a different time zone. Time zones may either be specified as an ISO 8601 UTC offset (e.g. `+01:00` or `-08:00`) or as a timezone id, an identifier used in the TZ database like `America/Los\_Angeles`. Consider the following example: [source,js] --------------------------------- PUT my\_index/\_doc/1?refresh { "date": "2015-10-01T00:30:00Z" } PUT my\_index/\_doc/2?refresh { "date": "2015-10-01T01:30:00Z" } GET my\_index/\_search?size=0 { "aggs": { "by\_day": { "date\_histogram": { "field": "date", "interval": "day" } } } } --------------------------------- // CONSOLE UTC is used if no time zone is specified, which would result in both of these documents being placed into the same day bucket, which starts at midnight UTC on 1 October 2015: [source,js] --------------------------------- { ... "aggregations": { "by\_day": { "buckets": [ { "key\_as\_string": "2015-10-01T00:00:00.000Z", "key": 1443657600000, "doc\_count": 2 } ] } } } --------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] If a `time\_zone` of `-01:00` is specified, then midnight starts at one hour before midnight UTC: [source,js] --------------------------------- GET my\_index/\_search?size=0
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/datehistogram-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.0025771469809114933,
0.06731588393449783,
0.027622165158391,
0.008443188853561878,
-0.055732645094394684,
0.056585054844617844,
-0.07667891681194305,
0.01804043911397457,
0.03208694979548454,
-0.02766823209822178,
-0.05376449227333069,
-0.025140807032585144,
0.012544773519039154,
-0.01261031161993742,
0.02275928109884262,
-0.030781224370002747,
-0.06395749747753143,
-0.024324800819158554,
-0.012636275961995125,
-0.08451364934444427,
0.042165596038103104,
-0.009139608591794968,
-0.03034696727991104,
-0.09652797877788544,
-0.03525466099381447,
0.006091186311095953,
-0.06288184970617294,
-0.046130161732435226,
0.06498868018388748,
0.044420912861824036,
-0.01627092808485031,
0.009925616905093193,
0.040979910641908646,
0.07199984043836594,
-0.07657648622989655,
-0.02073594555258751,
-0.0002870607131626457,
0.009657447226345539,
-0.0076752156019210815,
-0.029808318242430687,
0.012658953666687012,
0.042848601937294006,
-0.016231844201683998,
-0.08343499898910522,
-0.053997818380594254,
-0.01879982277750969,
-0.02600119076669216,
-0.02929219789803028,
-0.04933316260576248,
0.09380702674388885,
-0.030094947665929794,
-0.010164007544517517,
0.011150415055453777,
-0.003757225116714835,
0.013570508919656277,
0.07501744478940964,
-0.1071455106139183,
-0.0777236670255661,
0.03418534994125366,
-0.07358494400978088,
-0.0077848127111792564,
-0.06884760409593582,
0.014133363962173462,
-0.04551831632852554,
0.028588876128196716,
-0.017984656617045403,
0.05385202541947365,
0.06584208458662033,
0.06188502162694931,
0.053987517952919006,
0.05473480746150017,
0.0010883774375542998,
0.002616994082927704,
0.0030909788329154253,
0.004419007338583469,
0.05129055306315422,
-0.018122022971510887,
0.006788717117160559,
0.04478568211197853,
-0.031454555690288544,
-0.09647373110055923,
-0.0576222762465477,
-0.03919289633631706,
0.03244468569755554,
0.029720796272158623,
-0.032242387533187866,
-0.0246479082852602,
-0.02569756843149662,
0.02431466244161129,
-0.05303569883108139,
0.02890370413661003,
-0.03001214750111103,
-0.012173838913440704,
-0.03124319203197956,
0.002360069425776601,
-0.023589670658111572,
0.0039270371198654175,
0.06922027468681335,
0.1254846155643463,
-0.01667630486190319,
0.03562164679169655,
0.017991608008742332,
-0.057899247854948044,
-0.04567491263151169,
0.02372947335243225,
-0.01324233878403902,
-0.0921631008386612,
0.05078104883432388,
-0.04089733958244324,
0.053676772862672806,
0.003605045611038804,
-0.03790190815925598,
0.040583040565252304,
-0.07003002613782883,
-0.0008981143473647535,
0.06042599305510521,
-0.02689363993704319,
-0.07952912896871567,
0.030032142996788025,
0.04236643761396408,
0.08315419405698776,
0.05044248700141907,
-0.0008362584048882127,
-0.009677172638475895,
0.04435672238469124,
0.03006543032824993,
0.0426434651017189,
3.199039182811729e-33,
0.007737090345472097,
-0.05370714142918587,
0.012438039295375347,
-0.07036516815423965,
0.009509045630693436,
0.08546321094036102,
-0.013358661904931068,
0.012291849590837955,
-0.012549824081361294,
-0.0030131039675325155,
-0.03458540514111519,
0.11601382493972778,
-0.027435654774308205,
-0.08484919369220734,
-0.02116856537759304,
0.055731017142534256,
0.052954599261283875,
-0.01799398474395275,
0.07451308518648148,
-0.04484809562563896,
0.007890294305980206,
-0.11261104792356491,
-0.0024939882569015026,
0.0726032629609108,
0.05010763555765152,
-0.061910055577754974,
0.026609349995851517,
-0.026249073445796967,
-0.017400279641151428,
0.0261539313942194,
-0.01657239720225334,
0.06705652177333832,
-0.032466258853673935,
-0.006564626935869455,
0.0837445929646492,
-0.015342031605541706,
-0.04158996790647507,
0.07063787430524826,
-0.01915201172232628,
0.024339646100997925,
0.012905902229249477,
-0.00599600188434124,
-0.0183059461414814,
-0.08829152584075928,
-0.06753917783498764,
0.024242425337433815,
0.022920526564121246,
-0.003378281369805336,
0.08787281811237335,
0.026721326634287834,
-0.04770505055785179,
0.02288941666483879,
0.05752478167414665,
-0.10365328937768936,
0.11747100204229355,
0.03726893663406372,
0.06640677154064178,
0.06418649107217789,
-0.009767292998731136,
0.032878145575523376,
-0.004244988784193993,
0.005317626055330038,
0.10843846201896667,
0.016282297670841217,
-0.006099714897572994,
0.03522475063800812,
0.02697223611176014,
0.13072237372398376,
0.0064926291815936565,
0.07069947570562363,
0.08218800276517868,
0.05856243520975113,
0.034026265144348145,
-0.009790110401809216,
0.01847684383392334,
-0.09973037242889404,
0.09950890392065048,
0.06832468509674072,
-0.02232985943555832,
0.012515131384134293,
0.06036550551652908,
-0.1259847730398178,
0.03349222242832184,
0.0669955387711525,
-0.024792548269033432,
0.048128392547369,
0.016491899266839027,
0.034655310213565826,
-0.05102274566888809,
-0.07890219986438751,
-0.051544465124607086,
0.024051563814282417,
-0.08899002522230148,
-0.05011732131242752,
-0.011762185022234917,
-4.4480989088443526e-33,
0.034631017595529556,
0.012593674473464489,
-0.007415494881570339,
0.06796368211507797,
0.04131951928138733,
-0.0379130057990551,
0.002275181235745549,
0.08457732200622559,
0.0496223047375679,
0.05699922516942024,
-0.0018000396667048335,
-0.03638366237282753,
0.008642716333270073,
-0.08146588504314423,
-0.06514816731214523,
0.05279914662241936,
0.016201835125684738,
-0.14406335353851318,
-0.023369044065475464,
-0.039750561118125916,
-0.0641002207994461,
-0.006134252529591322,
-0.07408540695905685,
0.0664231926202774,
-0.040273722261190414,
-0.023055220022797585,
-0.018778882920742035,
0.012912373058497906,
-0.08872366696596146,
-0.0021175125148147345,
-0.04016801342368126,
-0.1019749641418457,
0.03885917365550995,
-0.1155586689710617,
-0.0571935810148716,
-0.04409365728497505,
0.04726744443178177,
-0.0070043508894741535,
0.0025121283251792192,
-0.007466040086001158,
0.0005592551315203309,
0.016081631183624268,
0.03503208979964256,
-0.0837530642747879,
0.027606137096881866,
0.07587851583957672,
-0.006701730191707611,
0.09595469385385513,
0.034883998334407806,
-0.06504343450069427,
-0.06020228937268257,
0.0012422110885381699,
-0.025088030844926834,
0.07988014817237854,
0.005184011999517679,
-0.03550521284341812,
-0.025146882981061935,
-0.016988184303045273,
-0.04803517460823059,
0.035272832959890366,
-0.045213766396045685,
-0.0750732496380806,
0.009660799987614155,
-0.000858596817124635,
-0.029031438753008842,
-0.06387042254209518,
0.021542761474847794,
-0.12589992582798004,
-0.0521852932870388,
-0.017649514600634575,
0.019928934052586555,
-0.04952768608927727,
0.0589928962290287,
0.0007826343644410372,
-0.05473934859037399,
0.027610691264271736,
0.060286425054073334,
-0.008050906471908092,
0.010359514504671097,
-0.04381025210022926,
-0.06795495748519897,
0.04028182104229927,
0.03511136397719383,
0.15001769363880157,
-0.06096179038286209,
0.08536141365766525,
-0.05545134097337723,
0.061190977692604065,
-0.005663055926561356,
0.06103670597076416,
-0.023272186517715454,
-0.04167759418487549,
-0.12973237037658691,
0.006194817367941141,
0.06834591180086136,
-5.2384088178314414e-8,
0.001131705241277814,
0.02542714960873127,
-0.014229326508939266,
-0.0055787148885428905,
0.04902113601565361,
-0.0076493253000080585,
0.01900956965982914,
0.07836131751537323,
0.009413930587470531,
-0.012053011916577816,
0.10159531980752945,
-0.03488611802458763,
-0.09907305240631104,
-0.016721995547413826,
-0.02368053048849106,
-0.005428911652415991,
-0.001099536893889308,
-0.010311223566532135,
-0.028304554522037506,
-0.05782994255423546,
-0.016907421872019768,
-0.003618617309257388,
0.11520267277956009,
-0.012487787753343582,
0.014488053508102894,
0.050379663705825806,
-0.04349592328071594,
0.03734443336725235,
0.04386548697948456,
-0.06620491296052933,
-0.06629975885152817,
0.0009810759220272303,
0.03351936861872673,
-0.008820271119475365,
-0.029659321531653404,
-0.08237665891647339,
-0.0890965536236763,
0.027669716626405716,
-0.10513899475336075,
0.03969268128275871,
0.07573553174734116,
0.00474377628415823,
-0.059577517211437225,
0.03716772794723511,
-0.007112070452421904,
0.02124570868909359,
0.04467148333787918,
0.04566951096057892,
0.030643412843346596,
0.03635246306657791,
0.013983969576656818,
-0.02933737076818943,
0.010868895798921585,
0.022291630506515503,
0.0501372367143631,
-0.015588820911943913,
0.01607678085565567,
-0.097255639731884,
0.04037179797887802,
0.027060119435191154,
0.06006018444895744,
-0.07085148245096207,
-0.10774650424718857,
-0.012435412965714931
] | 0.079746
|
2015: [source,js] --------------------------------- { ... "aggregations": { "by\_day": { "buckets": [ { "key\_as\_string": "2015-10-01T00:00:00.000Z", "key": 1443657600000, "doc\_count": 2 } ] } } } --------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] If a `time\_zone` of `-01:00` is specified, then midnight starts at one hour before midnight UTC: [source,js] --------------------------------- GET my\_index/\_search?size=0 { "aggs": { "by\_day": { "date\_histogram": { "field": "date", "interval": "day", "time\_zone": "-01:00" } } } } --------------------------------- // CONSOLE // TEST[continued] Now the first document falls into the bucket for 30 September 2015, while the second document falls into the bucket for 1 October 2015: [source,js] --------------------------------- { ... "aggregations": { "by\_day": { "buckets": [ { "key\_as\_string": "2015-09-30T00:00:00.000-01:00", <1> "key": 1443574800000, "doc\_count": 1 }, { "key\_as\_string": "2015-10-01T00:00:00.000-01:00", <1> "key": 1443661200000, "doc\_count": 1 } ] } } } --------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] <1> The `key\_as\_string` value represents midnight on each day in the specified time zone. WARNING: When using time zones that follow DST (daylight savings time) changes, buckets close to the moment when those changes happen can have slightly different sizes than would be expected from the used `interval`. For example, consider a DST start in the `CET` time zone: on 27 March 2016 at 2am, clocks were turned forward 1 hour to 3am local time. When using `day` as `interval`, the bucket covering that day will only hold data for 23 hours instead of the usual 24 hours for other buckets. The same is true for shorter intervals like e.g. 12h. Here, we will have only a 11h bucket on the morning of 27 March when the DST shift happens. ==== Offset The `offset` parameter is used to change the start value of each bucket by the specified positive (`+`) or negative offset (`-`) duration, such as `1h` for an hour, or `1d` for a day. See <> for more possible time duration options. For instance, when using an interval of `day`, each bucket runs from midnight to midnight. Setting the `offset` parameter to `+6h` would change each bucket to run from 6am to 6am: [source,js] ----------------------------- PUT my\_index/\_doc/1?refresh { "date": "2015-10-01T05:30:00Z" } PUT my\_index/\_doc/2?refresh { "date": "2015-10-01T06:30:00Z" } GET my\_index/\_search?size=0 { "aggs": { "by\_day": { "date\_histogram": { "field": "date", "interval": "day", "offset": "+6h" } } } } ----------------------------- // CONSOLE Instead of a single bucket starting at midnight, the above request groups the documents into buckets starting at 6am: [source,js] ----------------------------- { ... "aggregations": { "by\_day": { "buckets": [ { "key\_as\_string": "2015-09-30T06:00:00.000Z", "key": 1443592800000, "doc\_count": 1 }, { "key\_as\_string": "2015-10-01T06:00:00.000Z", "key": 1443679200000, "doc\_count": 1 } ] } } } ----------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] NOTE: The start `offset` of each bucket is calculated after the `time\_zone` adjustments have been made. ==== Keyed Response Setting the `keyed` flag to `true` will associate a unique string key with each bucket and return the ranges as a hash rather than an array: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "sales\_over\_time" : { "date\_histogram" : { "field" : "date", "interval" : "1M", "format" : "yyyy-MM-dd", "keyed": true } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] Response: [source,js] -------------------------------------------------- { ... "aggregations": { "sales\_over\_time": { "buckets": { "2015-01-01": { "key\_as\_string": "2015-01-01", "key": 1420070400000, "doc\_count": 3 }, "2015-02-01": { "key\_as\_string": "2015-02-01", "key": 1422748800000, "doc\_count": 2 }, "2015-03-01": { "key\_as\_string": "2015-03-01", "key": 1425168000000, "doc\_count": 2 } } } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] ==== Scripts Like with the normal <>, both document level scripts and value level scripts are supported. It is also possible to control the order of the returned buckets using the `order` settings and filter the returned buckets based on
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/datehistogram-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.01512200478464365,
0.07869046181440353,
0.038269054144620895,
0.06163985654711723,
0.03471275046467781,
-0.05377522110939026,
-0.007965410128235817,
-0.01764838397502899,
0.13087911903858185,
0.01888945885002613,
-0.0227079875767231,
-0.06202593073248863,
-0.0075290207751095295,
-0.024135420098900795,
-0.022702114656567574,
-0.045883554965257645,
-0.08897701650857925,
-0.06753683090209961,
-0.0375528410077095,
-0.09921719133853912,
0.01083198469132185,
-0.00811389647424221,
-0.02514733374118805,
-0.02392972633242607,
-0.014949734322726727,
0.07335414737462997,
-0.06203682720661163,
0.006561935413628817,
0.05054786428809166,
0.008041175082325935,
-0.008474249392747879,
0.00772831542417407,
-0.009493312798440456,
0.022952500730752945,
0.0358099527657032,
0.01957879215478897,
0.044326648116111755,
-0.046381279826164246,
0.011057309806346893,
-0.006783491466194391,
0.07132356613874435,
-0.04509611427783966,
0.014655008912086487,
-0.05528508126735687,
0.015917599201202393,
-0.015520542860031128,
-0.05359578877687454,
0.056501708924770355,
-0.10436956584453583,
0.04700152203440666,
-0.03283713385462761,
-0.04599825292825699,
-0.04864316061139107,
0.005734292324632406,
0.0415448360145092,
0.08417490869760513,
-0.05027442425489426,
-0.0066088964231312275,
0.0010316764237359166,
-0.10093892365694046,
0.01524527370929718,
-0.08294624835252762,
-0.026158781722187996,
-0.06315650790929794,
0.03768909350037575,
0.006671092007309198,
-0.000452740176115185,
0.05288912355899811,
0.016060100868344307,
0.06000197306275368,
0.024077143520116806,
-0.003186779096722603,
-0.030034152790904045,
-0.00697164935991168,
-0.011224121786653996,
0.027754155918955803,
-0.06678842008113861,
-0.011630943976342678,
0.009250586852431297,
-0.017176859080791473,
-0.06504344940185547,
-0.10678227245807648,
0.003932974301278591,
-0.011587034910917282,
-0.022090211510658264,
-0.0051908171735703945,
0.009407318197190762,
0.08023081719875336,
0.037531182169914246,
-0.06046932935714722,
-0.09531357139348984,
0.006335849408060312,
0.08357951790094376,
0.0353567861020565,
0.05523477867245674,
0.06847400218248367,
-0.00524462666362524,
0.04073309898376465,
0.1533716768026352,
0.0511045940220356,
-0.012900182045996189,
0.04414506256580353,
-0.048798512667417526,
-0.05338452756404877,
0.0381338894367218,
0.013013263233006,
-0.08210835605859756,
0.05458229407668114,
-0.0721345767378807,
0.05850166827440262,
0.03376583755016327,
0.0753914937376976,
0.0733150914311409,
-0.028131812810897827,
0.019056525081396103,
0.03454930707812309,
0.023013973608613014,
-0.009495156817138195,
0.01433532778173685,
0.02381773479282856,
0.14555440843105316,
0.016358407214283943,
0.014263481833040714,
-0.05197509005665779,
0.014361312612891197,
0.04713654890656471,
0.07487162202596664,
-2.845629928643878e-33,
0.02690846286714077,
-0.07732328772544861,
0.03381074592471123,
-0.07994182407855988,
0.04578013718128204,
0.02543497458100319,
-0.025153515860438347,
0.06347332894802094,
0.007539251819252968,
0.020501725375652313,
-0.05940575897693634,
-0.0018631526036188006,
-0.04882373288273811,
-0.13236555457115173,
-0.02083204686641693,
0.025793230161070824,
0.0972386822104454,
0.03516160696744919,
0.03864113613963127,
0.013086399994790554,
0.021796468645334244,
-0.1118033230304718,
-0.058773718774318695,
0.010500564239919186,
-0.00914023071527481,
-0.028926556929945946,
-0.039404433220624924,
-0.07651067525148392,
-0.04716850444674492,
-0.034896742552518845,
0.028073636814951897,
0.007645593024790287,
-0.0759049579501152,
0.0024204228539019823,
0.10393963754177094,
0.010627882555127144,
0.011394678615033627,
0.02645191363990307,
-0.06811469048261642,
-0.05299524962902069,
-0.01561170257627964,
-0.008727217093110085,
-0.058671943843364716,
-0.09122074395418167,
-0.05088307335972786,
0.0077301859855651855,
-0.02896564081311226,
-0.05312357470393181,
0.021552948281168938,
0.035142943263053894,
-0.037654194980859756,
0.012753655202686787,
0.04638758674263954,
-0.06518297642469406,
0.013307618908584118,
0.008365508168935776,
0.01829618774354458,
0.048500631004571915,
0.002003973815590143,
0.06960443407297134,
0.026807405054569244,
0.00028953381115570664,
0.017745640128850937,
-0.00792531855404377,
0.050171125680208206,
0.022469790652394295,
0.04928966984152794,
0.09811197966337204,
0.01172631699591875,
0.0704105943441391,
0.06805524975061417,
0.09134966880083084,
-0.015510182827711105,
0.0049208179116249084,
0.01086198166012764,
-0.11525682359933853,
0.08551435172557831,
0.015207039192318916,
-0.008295850828289986,
0.011254847049713135,
0.09581218659877777,
-0.07209937274456024,
-0.02311500534415245,
-0.004577259998768568,
-0.06608403474092484,
0.06799723953008652,
-0.02831253595650196,
-0.00002295777085237205,
-0.09881043434143066,
-0.11334383487701416,
-0.07985428720712662,
-0.059974368661642075,
-0.04867997765541077,
-0.08308309316635132,
-0.05315695330500603,
6.481753451428347e-34,
0.08751558512449265,
-0.035565514117479324,
0.0030876973178237677,
0.07622025161981583,
0.08556654304265976,
-0.05107437074184418,
0.056749679148197174,
0.06895482540130615,
0.0587553046643734,
0.04995116963982582,
0.035489048808813095,
-0.04585584998130798,
0.010147935710847378,
-0.07615295797586441,
0.02342391572892666,
0.024356458336114883,
-0.008939677849411964,
-0.15681211650371552,
-0.007893127389252186,
-0.04396947845816612,
-0.04716107249259949,
0.00888393446803093,
-0.024866657331585884,
0.0583362951874733,
-0.02909153513610363,
0.005113326478749514,
0.02553458884358406,
-0.057251423597335815,
-0.10701407492160797,
0.009033012203872204,
-0.02178707905113697,
0.009883224964141846,
-0.011521768756210804,
0.012604651972651482,
-0.0695188045501709,
-0.057260166853666306,
0.02819187194108963,
0.08564521372318268,
-0.022395607084035873,
-0.007432905957102776,
0.00009151485573966056,
0.044982846826314926,
-0.07775777578353882,
-0.016893349587917328,
-0.03742053359746933,
0.09997057169675827,
0.05722510442137718,
0.08311434835195541,
-0.028397105634212494,
0.0027381146792322397,
0.006053101271390915,
-0.020783057436347008,
-0.01989256590604782,
0.10121326893568039,
0.04394106939435005,
-0.024501020088791847,
-0.02872477099299431,
-0.09949548542499542,
-0.053112324327230453,
0.011842568404972553,
-0.03186362236738205,
-0.0037472720723599195,
0.0025795460678637028,
0.05054471269249916,
0.01734272576868534,
-0.07501526176929474,
-0.03363940119743347,
-0.05316614359617233,
-0.000314037490170449,
0.013116803020238876,
0.07085081934928894,
0.043728481978178024,
-0.001939854584634304,
0.027379155158996582,
-0.024440692737698555,
-0.009410272352397442,
0.007647128775715828,
0.02326825261116028,
0.006738211493939161,
0.04317892715334892,
-0.11438228189945221,
0.03862861916422844,
0.020293444395065308,
0.11879687756299973,
-0.040583837777376175,
0.04122549667954445,
0.008525842800736427,
0.04772637411952019,
-0.013493536971509457,
0.05504678189754486,
-0.04702703282237053,
0.003765970468521118,
-0.07323277741670609,
0.02309143729507923,
0.03742635250091553,
-4.6577710577366815e-8,
-0.06119399517774582,
0.011595661751925945,
-0.10644009709358215,
0.018114641308784485,
-0.022835129871964455,
0.014672941528260708,
0.006464218255132437,
0.051696568727493286,
-0.004341278225183487,
-0.024629710242152214,
0.11383997648954391,
-0.04179837554693222,
-0.011060548946261406,
-0.01956869475543499,
-0.07978586107492447,
-0.05586766451597214,
-0.018455946817994118,
-0.00163121591322124,
-0.038769714534282684,
-0.057559944689273834,
0.04341855272650719,
0.0023132977075874805,
0.0684792548418045,
-0.06911599636077881,
0.05647726356983185,
0.04201117157936096,
-0.034252941608428955,
0.0768321081995964,
0.03221334144473076,
-0.029556144028902054,
0.0003962496994063258,
-0.012301757000386715,
0.0004291477962397039,
-0.05455685779452324,
-0.0422336645424366,
-0.062123723328113556,
-0.027858098968863487,
0.04814343899488449,
-0.07747002691030502,
0.06080210953950882,
0.040984708815813065,
0.013723809272050858,
-0.08875703811645508,
0.025849517434835434,
0.0011414892505854368,
-0.049351733177900314,
-0.010208655148744583,
0.0743432492017746,
0.07254745066165924,
-0.025329522788524628,
0.038041748106479645,
-0.06831294298171997,
-0.0032790012191981077,
0.0021682961378246546,
0.010611504316329956,
0.008592595346271992,
0.06008268892765045,
-0.025701314210891724,
0.018884113058447838,
0.004617669153958559,
0.10807695984840393,
-0.06148063391447067,
-0.08044853806495667,
-0.004027231130748987
] | 0.017428
|
} } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] ==== Scripts Like with the normal <>, both document level scripts and value level scripts are supported. It is also possible to control the order of the returned buckets using the `order` settings and filter the returned buckets based on a `min\_doc\_count` setting (by default all buckets between the first bucket that matches documents and the last one are returned). This histogram also supports the `extended\_bounds` setting, which enables extending the bounds of the histogram beyond the data itself (to read more on why you'd want to do that please refer to the explanation <>). ==== Missing value The `missing` parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value. [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs" : { "sale\_date" : { "date\_histogram" : { "field" : "date", "interval": "year", "missing": "2000/01/01" <1> } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] <1> Documents without a value in the `publish\_date` field will fall into the same bucket as documents that have the value `2000-01-01`. ==== Order By default the returned buckets are sorted by their `key` ascending, though the order behaviour can be controlled using the `order` setting. Supports the same `order` functionality as the <>. deprecated[6.0.0, Use `\_key` instead of `\_time` to order buckets by their dates/keys] ==== Use of a script to aggregate by day of the week There are some cases where date histogram can't help us, like for example, when we need to aggregate the results by day of the week. In this case to overcome the problem, we can use a script that returns the day of the week: [source,js] -------------------------------------------------- POST /sales/\_search?size=0 { "aggs": { "dayOfWeek": { "terms": { "script": { "lang": "painless", "source": "doc['date'].value.dayOfWeek" } } } } } -------------------------------------------------- // CONSOLE // TEST[setup:sales] Response: [source,js] -------------------------------------------------- { ... "aggregations": { "dayOfWeek": { "doc\_count\_error\_upper\_bound": 0, "sum\_other\_doc\_count": 0, "buckets": [ { "key": "7", "doc\_count": 4 }, { "key": "4", "doc\_count": 3 } ] } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"took": $body.took,"timed\_out": false,"\_shards": $body.\_shards,"hits": $body.hits,/] The response will contain all the buckets having as key the relative day of the week: 1 for Monday, 2 for Tuesday... 7 for Sunday.
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/datehistogram-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.037738971412181854,
0.051566679030656815,
0.05333374813199043,
0.03234373778104782,
0.022563958540558815,
-0.008366641588509083,
-0.024585021659731865,
-0.014247381128370762,
0.07783132046461105,
0.03213978931307793,
-0.007622923702001572,
0.0170111283659935,
0.058810021728277206,
-0.04398698732256889,
-0.004152030684053898,
-0.054631005972623825,
-0.018899615854024887,
-0.07926011830568314,
-0.06947121024131775,
-0.08044544607400894,
-0.0002903652493841946,
0.05543118342757225,
0.008017056621611118,
-0.030739733949303627,
-0.07403207570314407,
0.03368407487869263,
-0.13932666182518005,
-0.022176522761583328,
0.015737473964691162,
-0.04544861614704132,
0.06742122769355774,
-0.03795693442225456,
-0.010101059451699257,
0.018909268081188202,
0.05381849780678749,
0.06416995823383331,
0.004526370670646429,
-0.0525565966963768,
-0.013747298158705235,
0.019133199006319046,
-0.01492837443947792,
-0.03655450791120529,
-0.035857561975717545,
-0.021906550973653793,
0.03281186521053314,
0.0007935058674775064,
-0.09451507776975632,
-0.00436328025534749,
-0.053000085055828094,
0.0317484512925148,
-0.05476060509681702,
-0.08692417293787003,
0.034908879548311234,
0.08788950741291046,
-0.025998905301094055,
0.02980201505124569,
-0.03242494538426399,
-0.02063145488500595,
-0.03328369930386543,
-0.06460409611463547,
-0.01614893414080143,
-0.0963219478726387,
-0.006316219922155142,
-0.06308722496032715,
0.04567170888185501,
0.05288735032081604,
0.049196068197488785,
0.01947632245719433,
0.002164681674912572,
0.10752655565738678,
0.003005963983014226,
0.02398606762290001,
0.008913575671613216,
0.05149894580245018,
-0.017726289108395576,
0.025312095880508423,
-0.08805853128433228,
-0.019590837880969048,
-0.05366786941885948,
-0.09800753742456436,
-0.1251121461391449,
-0.0780571773648262,
0.026113342493772507,
0.01193094439804554,
-0.024923251941800117,
0.006242882926017046,
-0.005656981375068426,
0.04985456541180611,
0.03734244778752327,
0.0007183997659012675,
-0.041308287531137466,
-0.040861692279577255,
0.04361877962946892,
0.017312904819846153,
-0.019353432580828667,
0.019286533817648888,
0.013132893480360508,
0.04310581460595131,
0.11034007370471954,
0.013694177381694317,
0.03872083127498627,
0.056810904294252396,
-0.01975424215197563,
-0.058507997542619705,
0.07130644470453262,
0.04171974956989288,
-0.1093219444155693,
0.003665308468043804,
-0.02275516651570797,
0.027754660695791245,
0.023236427456140518,
0.03805197775363922,
0.034631554037332535,
-0.04884810000658035,
0.03898743912577629,
0.06830744445323944,
0.027154654264450073,
-0.007919919677078724,
-0.0751795545220375,
-0.04092209041118622,
0.11581819504499435,
0.04682241380214691,
0.07572901248931885,
-0.002710955683141947,
0.031924180686473846,
-0.00766714895144105,
0.035638101398944855,
-5.6127225083154264e-33,
0.03350841999053955,
-0.05449055880308151,
0.05398896709084511,
-0.007494855672121048,
0.0163908489048481,
0.028472252190113068,
-0.022498104721307755,
0.06632798910140991,
-0.034462522715330124,
0.016896702349185944,
-0.056972842663526535,
0.09585125744342804,
-0.02586335316300392,
-0.08162053674459457,
-0.0814121812582016,
0.006711216177791357,
0.03267102688550949,
0.04544923081994057,
-0.026970384642481804,
-0.028783923014998436,
-0.02842618338763714,
-0.08555977046489716,
-0.008100256323814392,
0.07502614706754684,
0.006719817873090506,
-0.0019948380067944527,
-0.05252266302704811,
-0.03295057639479637,
-0.06110401824116707,
-0.017916472628712654,
-0.0318274050951004,
0.010168763808906078,
-0.005245211999863386,
-0.02779410034418106,
0.023730065673589706,
-0.03135326877236366,
-0.058471422642469406,
0.025629451498389244,
-0.028031058609485626,
0.06698267161846161,
0.06653593480587006,
-0.025097398087382317,
0.00653905188664794,
-0.02449212595820427,
-0.0858091488480568,
0.0014240589225664735,
-0.03805755451321602,
0.030827568843960762,
0.016413846984505653,
-0.028962580487132072,
-0.011782514862716198,
0.023628978058695793,
0.045943595468997955,
-0.05156312510371208,
0.0326194241642952,
-0.03649945557117462,
-0.01668880321085453,
0.009585834108293056,
0.0300331711769104,
0.042105741798877716,
0.10866990685462952,
-0.014489110559225082,
0.014938619919121265,
0.05864747241139412,
0.028442148119211197,
-0.05378507077693939,
0.033755283802747726,
0.10370194166898727,
0.013145062141120434,
0.07060186564922333,
0.02303762547671795,
0.10382825136184692,
-0.0013974860776215792,
0.03062248043715954,
0.10404864698648453,
-0.10858219116926193,
0.013294831849634647,
-0.044268082827329636,
-0.02973470650613308,
0.016196662560105324,
0.06459199637174606,
-0.04707992449402809,
-0.020768392831087112,
-0.030711142346262932,
-0.0350438728928566,
0.1307232528924942,
0.05672623589634895,
-0.05728694424033165,
-0.12007288634777069,
-0.10392659157514572,
-0.043377745896577835,
-0.059480126947164536,
-0.03066711500287056,
-0.13357654213905334,
0.018805913627147675,
3.35017322618092e-33,
0.09165612608194351,
0.00849000085145235,
0.007475386373698711,
0.09081950038671494,
0.09749807417392731,
0.006143383216112852,
0.07027211040258408,
0.07440962642431259,
0.010146395303308964,
0.030056985095143318,
-0.005450480617582798,
-0.0705898180603981,
-0.027485795319080353,
-0.02997979335486889,
-0.018626347184181213,
0.07620369642972946,
-0.008863072842359543,
-0.15788596868515015,
0.0034445892088115215,
-0.017583144828677177,
-0.009849365800619125,
0.004310176707804203,
0.018405357375741005,
0.09286095201969147,
-0.08811713010072708,
0.0002687285596039146,
-0.00005937653259024955,
-0.06992583721876144,
-0.035229913890361786,
-0.01137289684265852,
-0.019483590498566628,
0.008279618807137012,
-0.035952236503362656,
-0.006326289847493172,
-0.03138534724712372,
-0.08261783421039581,
-0.02349386364221573,
0.06778359413146973,
-0.03849263861775398,
0.13761751353740692,
0.013010863214731216,
0.04152040183544159,
-0.1178768053650856,
-0.044672075659036636,
-0.039937444031238556,
0.032276809215545654,
-0.017950115725398064,
0.08446240425109863,
-0.009288236498832703,
-0.03641565516591072,
-0.03604731336236,
0.03693925961852074,
-0.0555805079638958,
0.10295047610998154,
0.05742405727505684,
-0.019134650006890297,
-0.030366547405719757,
-0.014053785242140293,
-0.08544036000967026,
0.03798013925552368,
-0.04280379042029381,
0.012960266321897507,
0.02855297178030014,
0.0220921840518713,
-0.042671069502830505,
-0.011723143979907036,
-0.018760213628411293,
-0.07092293351888657,
-0.05043885484337807,
0.007798514794558287,
-0.015424693003296852,
-0.07786260545253754,
0.058311328291893005,
-0.009702622890472412,
-0.004918358288705349,
0.03686743229627609,
-0.007684726268053055,
-0.03913861885666847,
0.013807564973831177,
0.05931601673364639,
-0.040870483964681625,
0.01442252192646265,
0.06601634621620178,
0.11376684159040451,
0.003354602726176381,
0.009236986748874187,
-0.014421772211790085,
-0.005538211204111576,
0.0163430105894804,
0.07427078485488892,
-0.0244566909968853,
0.020994961261749268,
0.022392667829990387,
0.02828904055058956,
0.04400037229061127,
-5.183009221809698e-8,
-0.0232615377753973,
-0.06793797016143799,
-0.02643611840903759,
0.057854022830724716,
0.012508699670433998,
0.05380348116159439,
0.01152103766798973,
0.13400740921497345,
-0.06915762275457382,
-0.054423924535512924,
0.11903638392686844,
-0.025469670072197914,
-0.014518069103360176,
0.007325545884668827,
-0.09465549141168594,
0.001168553833849728,
0.07623208314180374,
-0.026255883276462555,
-0.029098359867930412,
-0.04194437339901924,
-0.04394465684890747,
0.037962984293699265,
0.1293860822916031,
-0.05481510981917381,
0.013852103613317013,
0.035005513578653336,
-0.03953851759433746,
0.03235024958848953,
-0.0006506940699182451,
-0.10377980768680573,
0.011688003316521645,
-0.04673866555094719,
-0.016887463629245758,
-0.03801870718598366,
0.012130705639719963,
0.02894292213022709,
-0.06798303127288818,
0.0499797947704792,
-0.01745956391096115,
0.04569809511303902,
0.006033036392182112,
0.023909347131848335,
-0.05450347810983658,
0.04317990690469742,
0.057468265295028687,
-0.048838552087545395,
-0.005022463854402304,
0.03318296745419502,
0.03761119395494461,
-0.053624704480171204,
-0.00121839321218431,
-0.06412486732006073,
0.06516806781291962,
0.032538991421461105,
0.018049195408821106,
0.012975897639989853,
0.0706866979598999,
0.008452926762402058,
-0.03512115776538849,
0.030416900292038918,
0.06891949474811554,
-0.063176728785038,
-0.006195414811372757,
-0.030047887936234474
] | -0.026881
|
[[search-aggregations-bucket-terms-aggregation]] === Terms Aggregation A multi-bucket value source based aggregation where buckets are dynamically built - one per unique value. ////////////////////////// [source,js] -------------------------------------------------- PUT /products { "mappings": { "product": { "properties": { "genre": { "type": "keyword" }, "product": { "type": "keyword" } } } } } POST /products/product/\_bulk?refresh {"index":{"\_id":0}} {"genre": "rock", "product": "Product A"} {"index":{"\_id":1}} {"genre": "rock"} {"index":{"\_id":2}} {"genre": "rock"} {"index":{"\_id":3}} {"genre": "jazz", "product": "Product Z"} {"index":{"\_id":4}} {"genre": "jazz"} {"index":{"\_id":5}} {"genre": "electronic"} {"index":{"\_id":6}} {"genre": "electronic"} {"index":{"\_id":7}} {"genre": "electronic"} {"index":{"\_id":8}} {"genre": "electronic"} {"index":{"\_id":9}} {"genre": "electronic"} {"index":{"\_id":10}} {"genre": "electronic"} ------------------------------------------------- // NOTCONSOLE // TESTSETUP ////////////////////////// Example: [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "genres" : { "terms" : { "field" : "genre" } } } } -------------------------------------------------- // CONSOLE // TEST[s/\_search/\_search\?filter\_path=aggregations/] Response: [source,js] -------------------------------------------------- { ... "aggregations" : { "genres" : { "doc\_count\_error\_upper\_bound": 0, <1> "sum\_other\_doc\_count": 0, <2> "buckets" : [ <3> { "key" : "electronic", "doc\_count" : 6 }, { "key" : "rock", "doc\_count" : 3 }, { "key" : "jazz", "doc\_count" : 2 } ] } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\.//] <1> an upper bound of the error on the document counts for each term, see <> <2> when there are lots of unique terms, Elasticsearch only returns the top terms; this number is the sum of the document counts for all buckets that are not part of the response <3> the list of the top buckets, the meaning of `top` being defined by the <> By default, the `terms` aggregation will return the buckets for the top ten terms ordered by the `doc\_count`. One can change this default behaviour by setting the `size` parameter. [[search-aggregations-bucket-terms-aggregation-size]] ==== Size The `size` parameter can be set to define how many term buckets should be returned out of the overall terms list. By default, the node coordinating the search process will request each shard to provide its own top `size` term buckets and once all shards respond, it will reduce the results to the final list that will then be returned to the client. This means that if the number of unique terms is greater than `size`, the returned list is slightly off and not accurate (it could be that the term counts are slightly off and it could even be that a term that should have been in the top size buckets was not returned). NOTE: If you want to retrieve \*\*all\*\* terms or all combinations of terms in a nested `terms` aggregation you should use the <> aggregation which allows to paginate over all possible terms rather than setting a size greater than the cardinality of the field in the `terms` aggregation. The `terms` aggregation is meant to return the `top` terms and does not allow pagination. [[search-aggregations-bucket-terms-aggregation-approximate-counts]] ==== Document counts are approximate As described above, the document counts (and the results of any sub aggregations) in the terms aggregation are not always accurate. This is because each shard provides its own view of what the ordered list of terms should be and these are combined to give a final view. Consider the following scenario: A request is made to obtain the top 5 terms in the field product, ordered by descending document count from an index with 3 shards. In this case each shard is asked to give its top 5 terms. [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "products" : { "terms" : { "field" : "product", "size" : 5 } } } } -------------------------------------------------- // CONSOLE // TEST[s/\_search/\_search\?filter\_path=aggregations/] The terms for each of the three shards are shown below with their respective document counts in brackets: [width="100%",cols="^2,^2,^2,^2",options="header"] |========================================================= | | Shard A | Shard B |
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/terms-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.030962390825152397,
-0.009575093165040016,
0.030849514529109,
0.03779393807053566,
-0.03763092681765556,
0.08634301275014877,
0.03213964030146599,
-0.015493674203753471,
0.0694078877568245,
-0.04558572918176651,
-0.023325329646468163,
-0.03662420064210892,
0.03510002791881561,
-0.020770417526364326,
-0.005201898515224457,
0.08582144230604172,
-0.03792639076709747,
0.04331216588616371,
-0.06944461166858673,
-0.133965864777565,
0.05848552659153938,
0.0018264701357111335,
0.01861671730875969,
-0.06600081920623779,
-0.013167654164135456,
0.05682382732629776,
-0.046683646738529205,
-0.03202972933650017,
0.01836295612156391,
-0.0009654538007453084,
-0.022650601342320442,
0.021150950342416763,
-0.008686860091984272,
0.02866213209927082,
0.023955699056386948,
-0.00287398649379611,
-0.05301358550786972,
-0.06243414431810379,
0.02908085286617279,
0.02123340219259262,
0.08213091641664505,
0.04021095484495163,
-0.05935613065958023,
-0.1368655413389206,
0.008514711633324623,
-0.0481736846268177,
-0.026363419368863106,
0.016354452818632126,
0.01766584999859333,
0.018018508329987526,
-0.023732246831059456,
-0.050765249878168106,
-0.054981719702482224,
0.020052943378686905,
0.038682784885168076,
0.015979215502738953,
-0.07977443933486938,
0.03128763288259506,
0.007385286968201399,
-0.0961008369922638,
0.04804456606507301,
-0.09571347385644913,
0.06239255890250206,
-0.03195320442318916,
0.027243580669164658,
-0.002947726286947727,
-0.014862105250358582,
0.02248426340520382,
-0.02761073410511017,
0.035603027790784836,
0.09430421888828278,
0.018172550946474075,
-0.005081058479845524,
-0.10108091682195663,
0.043588265776634216,
0.0332103967666626,
0.0035212659277021885,
-0.05160829797387123,
-0.007596777752041817,
0.051445718854665756,
-0.09015560150146484,
-0.05788256973028183,
-0.05043517053127289,
-0.07463313639163971,
0.009808518923819065,
-0.062379516661167145,
-0.06496158987283707,
-0.085834801197052,
0.05181623622775078,
-0.02865288034081459,
-0.12194053828716278,
-0.08579548448324203,
0.08425994217395782,
0.03925425931811333,
0.06091385334730148,
0.025666167959570885,
-0.018113169819116592,
-0.012605988420546055,
0.09441235661506653,
-0.004791903775185347,
0.009898976422846317,
-0.032403361052274704,
-0.013742408715188503,
-0.07517611980438232,
-0.03830747306346893,
-0.0057085612788796425,
-0.05055046081542969,
0.09914493560791016,
-0.04403030499815941,
0.10308246314525604,
-0.061428364366292953,
0.029297593981027603,
0.0227330531924963,
0.06262610852718353,
-0.09928830713033676,
0.03943059965968132,
0.046923767775297165,
-0.022176846861839294,
0.060863517224788666,
0.0013164218980818987,
0.09836257994174957,
0.011926472187042236,
0.039462607353925705,
-0.04975898191332817,
0.0056536877527832985,
0.025253430008888245,
0.020449165254831314,
-2.1762668947581965e-33,
0.0019102718215435743,
-0.041145410388708115,
0.04191087186336517,
0.0037866777274757624,
0.010736290365457535,
0.041102614253759384,
0.03009641170501709,
0.06105966493487358,
-0.023820865899324417,
0.012908345088362694,
-0.05725032836198807,
0.1506892740726471,
-0.11166179180145264,
-0.025857454165816307,
-0.03553978353738785,
-0.10740839689970016,
0.020728392526507378,
0.023974576964974403,
0.038003258407115936,
-0.06806967407464981,
0.01278525311499834,
0.022290032356977463,
-0.04390009492635727,
0.035040222108364105,
-0.06870283931493759,
-0.05194704234600067,
0.013773261569440365,
-0.010770212858915329,
-0.030834130942821503,
0.005267835687845945,
-0.0017038139048963785,
0.03665928542613983,
-0.0031471927650272846,
-0.060067739337682724,
-0.04754369333386421,
0.01144822034984827,
-0.0607682429254055,
0.05537007376551628,
-0.025350963696837425,
-0.033070847392082214,
0.059103094041347504,
-0.003133387304842472,
-0.03341612592339516,
-0.11684317886829376,
-0.08867168426513672,
0.06167404353618622,
-0.032044775784015656,
-0.021902060136198997,
0.00977786909788847,
-0.02019595354795456,
-0.06785048544406891,
-0.012445707805454731,
-0.006644699722528458,
-0.0020614424720406532,
0.04700981080532074,
-0.03238571062684059,
-0.051556941121816635,
0.032586123794317245,
-0.012909782119095325,
0.050329629331827164,
-0.08316949754953384,
0.11355360597372055,
0.047462347894907,
0.04417148604989052,
0.026125183328986168,
0.08700127899646759,
0.10767105221748352,
0.129811629652977,
0.0009155281586572528,
0.04109836742281914,
0.04465745389461517,
0.05177203565835953,
0.034021515399217606,
-0.04372081160545349,
0.041245248168706894,
-0.10082771629095078,
0.047510407865047455,
0.01711147278547287,
-0.026854148134589195,
0.019091874361038208,
-0.03325636312365532,
-0.04460660368204117,
-0.03442201390862465,
0.07508699595928192,
-0.04362214729189873,
0.10258517414331436,
-0.08288415521383286,
-0.005740650463849306,
-0.01799161359667778,
-0.028083190321922302,
-0.04760577902197838,
0.034111861139535904,
-0.006932067219167948,
-0.09771781414747238,
-0.007537304889410734,
-3.3628101577942443e-34,
0.04731925204396248,
-0.09303513169288635,
0.09314566105604172,
0.06163652613759041,
0.08427894115447998,
-0.08428025245666504,
0.012678436934947968,
0.051704809069633484,
0.013908244669437408,
0.016121912747621536,
-0.04548092931509018,
-0.07886019349098206,
0.02450435236096382,
-0.008924227207899094,
-0.02019321732223034,
0.062046702951192856,
-0.07666509598493576,
-0.051786769181489944,
0.03759671002626419,
0.02887505479156971,
-0.021252553910017014,
0.009436428546905518,
-0.009056614711880684,
0.11857937276363373,
-0.06584984064102173,
-0.03156544640660286,
-0.03127199038863182,
0.024895329028367996,
-0.04230089113116264,
0.028863035142421722,
0.04101967066526413,
-0.05359971895813942,
-0.021833401173353195,
-0.008391150273382664,
-0.02577838860452175,
-0.04711932688951492,
0.09152622520923615,
0.026827918365597725,
-0.04253643378615379,
0.06428731232881546,
-0.01090090163052082,
-0.02874748781323433,
-0.03139936923980713,
0.017511418089270592,
0.05331916734576225,
-0.026714108884334564,
0.07894181460142136,
0.03817373514175415,
-0.01839025318622589,
-0.01749945618212223,
0.022525649517774582,
0.026729339733719826,
-0.05207549408078194,
0.040002014487981796,
-0.04817412793636322,
-0.05061774328351021,
-0.01078709401190281,
-0.052983108907938004,
-0.05717983469367027,
-0.018981561064720154,
0.007962781004607677,
-0.04678355157375336,
-0.030201612040400505,
0.013408515602350235,
0.06295528262853622,
-0.05257462337613106,
0.0024960769806057215,
-0.08655508607625961,
-0.032772958278656006,
-0.032882049679756165,
0.010647126473486423,
0.0007615102804265916,
0.08770538121461868,
0.027254415675997734,
0.014114617370069027,
-0.045774564146995544,
0.01403096318244934,
-0.06769698858261108,
0.08668802678585052,
-0.05069749429821968,
-0.03414342924952507,
0.03370935469865799,
0.048572465777397156,
0.08750931173563004,
-0.023835014551877975,
0.05074513703584671,
-0.05277882516384125,
0.07720636576414108,
0.012118599377572536,
0.02973485365509987,
-0.055325161665678024,
-0.10199479013681412,
-0.033116117119789124,
-0.017909493297338486,
0.02111934870481491,
-4.15928198549409e-8,
-0.022822530940175056,
0.0682874545454979,
-0.028534071519970894,
0.07220006734132767,
-0.01446283608675003,
-0.018922219052910805,
0.03281328082084656,
0.05818421393632889,
-0.014557506889104843,
-0.06746144592761993,
0.024401726201176643,
0.06901423633098602,
-0.03851054981350899,
0.05719567462801933,
-0.07316035777330399,
-0.022938605397939682,
-0.07174338400363922,
0.037805087864398956,
0.022830858826637268,
0.021104270592331886,
0.06377207487821579,
0.041904471814632416,
0.07580770552158356,
0.008720197714865208,
0.07472751289606094,
-0.03234267607331276,
0.05129651352763176,
-0.008630366064608097,
0.04277602583169937,
-0.008537433110177517,
-0.05552050098776817,
-0.048148203641176224,
0.01244165189564228,
0.03344583138823509,
0.016320375725626945,
-0.11397872865200043,
0.03443413972854614,
0.03250374272465706,
-0.10761862993240356,
0.038487911224365234,
-0.012639001943171024,
0.04350040480494499,
-0.026790283620357513,
0.016134390607476234,
0.004520397633314133,
-0.01741330698132515,
-0.07053318619728088,
0.08875802159309387,
0.08588482439517975,
0.021044261753559113,
0.014665164984762669,
-0.016277635470032692,
-0.022770678624510765,
-0.012605535797774792,
0.02962404116988182,
-0.02432721108198166,
0.0024483082816004753,
-0.005656030029058456,
0.051672134548425674,
0.03092879056930542,
0.0937161073088646,
-0.07996707409620285,
0.004676078446209431,
-0.010942976921796799
] | -0.018337
|
{ "products" : { "terms" : { "field" : "product", "size" : 5 } } } } -------------------------------------------------- // CONSOLE // TEST[s/\_search/\_search\?filter\_path=aggregations/] The terms for each of the three shards are shown below with their respective document counts in brackets: [width="100%",cols="^2,^2,^2,^2",options="header"] |========================================================= | | Shard A | Shard B | Shard C | 1 | Product A (25) | Product A (30) | Product A (45) | 2 | Product B (18) | Product B (25) | Product C (44) | 3 | Product C (6) | Product F (17) | Product Z (36) | 4 | Product D (3) | Product Z (16) | Product G (30) | 5 | Product E (2) | Product G (15) | Product E (29) | 6 | Product F (2) | Product H (14) | Product H (28) | 7 | Product G (2) | Product I (10) | Product Q (2) | 8 | Product H (2) | Product Q (6) | Product D (1) | 9 | Product I (1) | Product J (8) | | 10 | Product J (1) | Product C (4) | |========================================================= The shards will return their top 5 terms so the results from the shards will be: [width="100%",cols="^2,^2,^2,^2",options="header"] |========================================================= | | Shard A | Shard B | Shard C | 1 | Product A (25) | Product A (30) | Product A (45) | 2 | Product B (18) | Product B (25) | Product C (44) | 3 | Product C (6) | Product F (17) | Product Z (36) | 4 | Product D (3) | Product Z (16) | Product G (30) | 5 | Product E (2) | Product G (15) | Product E (29) |========================================================= Taking the top 5 results from each of the shards (as requested) and combining them to make a final top 5 list produces the following: [width="40%",cols="^2,^2"] |========================================================= | 1 | Product A (100) | 2 | Product Z (52) | 3 | Product C (50) | 4 | Product G (45) | 5 | Product B (43) |========================================================= Because Product A was returned from all shards we know that its document count value is accurate. Product C was only returned by shards A and C so its document count is shown as 50 but this is not an accurate count. Product C exists on shard B, but its count of 4 was not high enough to put Product C into the top 5 list for that shard. Product Z was also returned only by 2 shards but the third shard does not contain the term. There is no way of knowing, at the point of combining the results to produce the final list of terms, that there is an error in the document count for Product C and not for Product Z. Product H has a document count of 44 across all 3 shards but was not included in the final list of terms because it did not make it into the top five terms on any of the shards. ==== Shard Size The higher the requested `size` is, the more accurate the results will be, but also, the more expensive it will be to compute the final results (both due to bigger priority queues that are managed on a shard level and due to bigger data transfers between the nodes and the client). The `shard\_size` parameter can be used to minimize the extra work that comes with bigger requested `size`. When defined, it will determine how many terms the coordinating node will request from each shard. Once all the shards responded, the coordinating
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/terms-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.02464800328016281,
0.0064568109810352325,
-0.001553565845824778,
0.003981953486800194,
-0.0013147062854841352,
0.024974022060632706,
-0.008971272967755795,
-0.051503486931324005,
0.06517147272825241,
-0.02745121344923973,
-0.010007108561694622,
-0.03058384731411934,
0.062300268560647964,
-0.012576166540384293,
-0.04946472495794296,
0.07023010402917862,
-0.07039900869131088,
0.040421854704618454,
-0.08981247991323471,
-0.0993342399597168,
0.0928841084241867,
-0.04361949488520622,
0.009490772150456905,
-0.05002084746956825,
0.03543374314904213,
0.05453682318329811,
-0.08730509132146835,
-0.020583339035511017,
0.016952985897660255,
-0.012752188369631767,
-0.0012360262917354703,
0.0335531085729599,
-0.004720123950392008,
0.0296549741178751,
0.008818288333714008,
-0.054662883281707764,
-0.047493696212768555,
0.0025803984608501196,
-0.0036236518062651157,
0.004394490271806717,
0.02185072936117649,
-0.03555093705654144,
-0.053867191076278687,
-0.04986537620425224,
0.005307157523930073,
-0.01099576149135828,
-0.07852036505937576,
-0.004454257432371378,
0.027248207479715347,
0.017404500395059586,
-0.0870983824133873,
-0.05410197377204895,
-0.09560378640890121,
0.029338469728827477,
0.03262978047132492,
-0.03234027698636055,
-0.06804394721984863,
-0.05721772089600563,
0.0005560051649808884,
-0.060872938483953476,
0.05466083437204361,
-0.10975421220064163,
-0.05053932964801788,
-0.012397310696542263,
0.005557569675147533,
0.0248176958411932,
0.08005229383707047,
0.01562727987766266,
-0.05733431503176689,
0.05708463862538338,
-0.014598792418837547,
0.023762226104736328,
-0.022087309509515762,
-0.028307799249887466,
0.04181049391627312,
0.10171820223331451,
0.008540073409676552,
-0.05680762603878975,
-0.013256014324724674,
0.017767351120710373,
-0.14658363163471222,
-0.025398535653948784,
-0.02188442088663578,
0.07698975503444672,
0.00016047354438342154,
-0.017006928101181984,
-0.06174027547240257,
-0.07823751866817474,
0.04966184124350548,
-0.014494391158223152,
-0.05567685142159462,
-0.055123746395111084,
0.06259553134441376,
-0.06769537925720215,
0.027305496856570244,
-0.0018640549387782812,
0.008459297940135002,
0.052065640687942505,
0.0842960998415947,
0.02917885035276413,
-0.01642519235610962,
-0.010582277551293373,
0.0055266208946704865,
-0.12776534259319305,
-0.09125346690416336,
0.05029572173953056,
-0.10459643602371216,
0.06947507709264755,
0.024438396096229553,
0.05292759835720062,
-0.015709979459643364,
-0.01858518458902836,
0.00023087770387064666,
0.01947200298309326,
-0.055003803223371506,
0.08279220014810562,
0.09547870606184006,
-0.080992192029953,
0.06532973796129227,
-0.017102649435400963,
0.07921677082777023,
0.06691733002662659,
0.056631505489349365,
-0.047091733664274216,
-0.07170461863279343,
0.024213070049881935,
-0.03670971840620041,
2.0108722682036082e-33,
0.008514455519616604,
-0.01129872165620327,
0.030528973788022995,
0.03126577287912369,
-0.017768818885087967,
0.06813730299472809,
-0.000491776445414871,
0.04448405280709267,
-0.09056375920772552,
0.06487593054771423,
-0.10676517337560654,
0.15660786628723145,
-0.04775362089276314,
-0.07104595750570297,
0.05296984687447548,
-0.07286781072616577,
0.055967360734939575,
0.04812578856945038,
-0.04835990071296692,
-0.0616370290517807,
0.005321751814335585,
0.00477824779227376,
0.02297191321849823,
0.01964501664042473,
-0.014956232160329819,
-0.06475648283958435,
0.007416790351271629,
-0.0477859191596508,
-0.037304267287254333,
-0.004467098508030176,
0.01334291696548462,
0.0036186599172651768,
0.022525550797581673,
-0.04741833731532097,
0.005199865438044071,
0.01157416682690382,
-0.025262320414185524,
0.02276572398841381,
0.03404757380485535,
-0.05881113559007645,
0.009913315996527672,
-0.017702825367450714,
0.06567303091287613,
-0.05724836513400078,
-0.09251359105110168,
0.00956993829458952,
-0.06221830099821091,
-0.021074848249554634,
-0.018716303631663322,
-0.0014357701875269413,
-0.04610356688499451,
0.06305257230997086,
0.0035891630686819553,
0.03894222900271416,
0.014811796136200428,
0.006674832198768854,
-0.00759114371612668,
0.05030534788966179,
-0.03028155490756035,
0.07565237581729889,
-0.03668125346302986,
0.05101809650659561,
0.057641759514808655,
0.0607050359249115,
-0.011651420034468174,
0.029325222596526146,
0.041891030967235565,
0.11006992310285568,
0.040546588599681854,
0.11331865936517715,
0.03447749465703964,
0.08054333925247192,
0.05872146040201187,
-0.019681114703416824,
0.08176811784505844,
-0.10311419516801834,
0.019184472039341927,
-0.046388350427150726,
-0.07852615416049957,
-0.022465940564870834,
-0.07964891940355301,
-0.035760052502155304,
0.020113203674554825,
0.007011232431977987,
-0.09639254957437515,
0.058622587472200394,
-0.02673862688243389,
-0.0549197755753994,
-0.06262873113155365,
-0.11228328198194504,
-0.08578495681285858,
-0.003988944925367832,
-0.03541367128491402,
-0.07813108712434769,
-0.03508218750357628,
-4.859791560648873e-33,
0.03741748631000519,
-0.08558277785778046,
0.09052260965108871,
0.026076573878526688,
0.1115524023771286,
-0.04782877862453461,
0.04083129018545151,
-0.01496077235788107,
0.01774558424949646,
0.019360028207302094,
0.021090978756546974,
0.004009428434073925,
-0.010329486802220345,
-0.04431862384080887,
-0.029600372537970543,
0.09110920876264572,
0.009871607646346092,
-0.057604219764471054,
0.052424777299165726,
0.001979430206120014,
-0.02330963872373104,
0.07062771916389465,
-0.03769734129309654,
0.10525960475206375,
-0.08129413425922394,
-0.028590330854058266,
0.03880263864994049,
-0.08827962726354599,
-0.00012031889491481707,
0.06685186177492142,
0.0051567694172263145,
-0.07454953342676163,
-0.03108208253979683,
0.023199452087283134,
-0.07411990314722061,
-0.051151834428310394,
0.051443494856357574,
0.02306845411658287,
0.008511788211762905,
0.030065255239605904,
0.0014063339913263917,
0.0073686521500349045,
-0.03056187927722931,
0.03619172424077988,
0.028316929936408997,
-0.030804654583334923,
0.049219418317079544,
0.057847149670124054,
0.01361574325710535,
-0.08612538129091263,
0.019673243165016174,
0.05417826399207115,
-0.03524759039282799,
0.09550927579402924,
-0.05725174397230148,
0.04882665351033211,
-0.008066958747804165,
-0.018685493618249893,
-0.14337818324565887,
-0.01032189093530178,
-0.05945903807878494,
0.015588081441819668,
-0.0156268123537302,
0.018932146951556206,
0.0559590719640255,
0.024032916873693466,
-0.0850175991654396,
-0.03815167769789696,
-0.03428322821855545,
-0.0703839585185051,
-0.03888949751853943,
-0.020837757736444473,
0.009916898794472218,
0.02301371842622757,
0.04514068365097046,
-0.028078166767954826,
-0.007027519401162863,
0.0042763869278132915,
0.028356876224279404,
0.03548012673854828,
-0.04361836984753609,
0.04515265300869942,
0.07293836772441864,
0.10889903455972672,
-0.0018821500707417727,
-0.06855486333370209,
0.00376496696844697,
0.07531704753637314,
-0.03749267756938934,
0.014803902246057987,
-0.03893258050084114,
-0.04429750144481659,
-0.00794488750398159,
0.010415669530630112,
0.06601225584745407,
-5.315983742093522e-8,
-0.035689182579517365,
0.012003540992736816,
-0.030980413779616356,
0.03637150302529335,
-0.025106258690357208,
0.008372774347662926,
0.026886511594057083,
0.09644115716218948,
-0.0815897136926651,
-0.016374099999666214,
0.011727194301784039,
0.03781328722834587,
-0.12733563780784607,
0.010532530024647713,
-0.020740147680044174,
-0.00920416321605444,
-0.04976750537753105,
0.08160032331943512,
-0.022065304219722748,
-0.037697140127420425,
0.04193226620554924,
0.03708803653717041,
0.06118848919868469,
0.022867918014526367,
-0.05057510733604431,
-0.0027685288805514574,
-0.04381081089377403,
-0.028023667633533478,
0.05259469896554947,
0.05209803581237793,
0.0011740054469555616,
-0.026427479460835457,
-0.0016916835447773337,
-0.032229285687208176,
0.03341223672032356,
0.020247776061296463,
-0.04178938269615173,
0.013352624140679836,
-0.045729972422122955,
0.07702013850212097,
-0.008099052123725414,
-0.013351481407880783,
-0.04226924479007721,
0.0453130304813385,
0.031583789736032486,
-0.031970493495464325,
-0.06378351897001266,
0.021596629172563553,
0.06597276031970978,
0.007962116971611977,
0.05501400679349899,
-0.009018607437610626,
0.01980312168598175,
-0.03078017570078373,
-0.007309708744287491,
-0.015712352469563484,
0.030483294278383255,
-0.07396704703569412,
0.038888100534677505,
-0.001919860951602459,
0.1277172863483429,
-0.07678049057722092,
0.067649245262146,
0.010869089514017105
] | 0.019315
|
to bigger data transfers between the nodes and the client). The `shard\_size` parameter can be used to minimize the extra work that comes with bigger requested `size`. When defined, it will determine how many terms the coordinating node will request from each shard. Once all the shards responded, the coordinating node will then reduce them to a final result which will be based on the `size` parameter - this way, one can increase the accuracy of the returned terms and avoid the overhead of streaming a big list of buckets back to the client. NOTE: `shard\_size` cannot be smaller than `size` (as it doesn't make much sense). When it is, Elasticsearch will override it and reset it to be equal to `size`. The default `shard\_size` will be `size` if the search request needs to go to a single shard, and `(size \* 1.5 + 10)` otherwise. ==== Calculating Document Count Error There are two error values which can be shown on the terms aggregation. The first gives a value for the aggregation as a whole which represents the maximum potential document count for a term which did not make it into the final list of terms. This is calculated as the sum of the document count from the last term returned from each shard. For the example given above the value would be 46 (2 + 15 + 29). This means that in the worst case scenario a term which was not returned could have the 4th highest document count. [source,js] -------------------------------------------------- { ... "aggregations" : { "products" : { "doc\_count\_error\_upper\_bound" : 46, "sum\_other\_doc\_count" : 79, "buckets" : [ { "key" : "Product A", "doc\_count" : 100 }, { "key" : "Product Z", "doc\_count" : 52 } ... ] } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\.//] // TESTRESPONSE[s/: (\-)?[0-9]+/: $body.$\_path/] ==== Per bucket document count error The second error value can be enabled by setting the `show\_term\_doc\_count\_error` parameter to true: [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "products" : { "terms" : { "field" : "product", "size" : 5, "show\_term\_doc\_count\_error": true } } } } -------------------------------------------------- // CONSOLE // TEST[s/\_search/\_search\?filter\_path=aggregations/] This shows an error value for each term returned by the aggregation which represents the 'worst case' error in the document count and can be useful when deciding on a value for the `shard\_size` parameter. This is calculated by summing the document counts for the last term returned by all shards which did not return the term. In the example above the error in the document count for Product C would be 15 as Shard B was the only shard not to return the term and the document count of the last term it did return was 15. The actual document count of Product C was 54 so the document count was only actually off by 4 even though the worst case was that it would be off by 15. Product A, however has an error of 0 for its document count, since every shard returned it we can be confident that the count returned is accurate. [source,js] -------------------------------------------------- { ... "aggregations" : { "products" : { "doc\_count\_error\_upper\_bound" : 46, "sum\_other\_doc\_count" : 79, "buckets" : [ { "key" : "Product A", "doc\_count" : 100, "doc\_count\_error\_upper\_bound" : 0 }, { "key" : "Product Z", "doc\_count" : 52, "doc\_count\_error\_upper\_bound" : 2 } ... ] } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\.//] // TESTRESPONSE[s/: (\-)?[0-9]+/: $body.$\_path/] These errors can only be calculated in this way when the terms are ordered by descending document count. When the aggregation is ordered by the terms values themselves (either ascending or descending) there is no error in the
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/terms-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.05666496232151985,
0.03389041870832443,
0.05927470326423645,
0.052515801042318344,
0.01812930591404438,
-0.020230159163475037,
-0.06802767515182495,
0.016645604744553566,
0.08113402128219604,
0.05102162808179855,
-0.061043474823236465,
0.02626916579902172,
0.07627587020397186,
-0.04957892373204231,
-0.07953962683677673,
-0.0121234692633152,
-0.030508821830153465,
0.024040531367063522,
-0.09120102971792221,
-0.017813511192798615,
0.019811801612377167,
0.0040479120798408985,
-0.024170463904738426,
-0.035652514547109604,
-0.04892905056476593,
0.02079923078417778,
-0.10648271441459656,
-0.03392498567700386,
0.03117058053612709,
-0.010229374282062054,
0.01688031479716301,
-0.028656935319304466,
-0.0205901637673378,
0.08640077710151672,
-0.06410899013280869,
0.024183830246329308,
-0.03292321041226387,
-0.04066736251115799,
-0.07923028618097305,
0.039547767490148544,
0.04582441598176956,
0.0054809171706438065,
-0.053212545812129974,
-0.056974753737449646,
-0.022901184856891632,
-0.032368604093790054,
-0.006582337897270918,
-0.0024502440355718136,
-0.003699622815474868,
0.026411574333906174,
-0.037245988845825195,
-0.04909387603402138,
-0.0375104658305645,
0.07277084141969681,
-0.017284605652093887,
-0.006288975011557341,
-0.09033812582492828,
-0.018019746989011765,
-0.05388008430600166,
-0.03194260969758034,
0.019717987626791,
-0.0637403279542923,
0.022084491327404976,
-0.0418689139187336,
0.05000383406877518,
0.02431664429605007,
0.10308276861906052,
-0.03687197342514992,
-0.02447500452399254,
0.07299917191267014,
0.06867248564958572,
0.0009237118065357208,
-0.0736207589507103,
0.018877068534493446,
0.03687756508588791,
0.017670398578047752,
-0.011486832052469254,
0.03219376504421234,
-0.0010412449482828379,
0.04573340341448784,
-0.0939740240573883,
-0.021164247766137123,
-0.027849463745951653,
-0.04676808789372444,
-0.034268490970134735,
-0.05042948201298714,
0.02404477819800377,
-0.08128843456506729,
-0.006882410496473312,
-0.017099669203162193,
0.007903390564024448,
-0.03470165282487869,
0.020491844043135643,
-0.044386837631464005,
0.06677401810884476,
-0.010987747460603714,
-0.022657716646790504,
0.07392863929271698,
0.07870849221944809,
-0.035587456077337265,
0.0777449756860733,
0.024299582466483116,
0.03913421183824539,
-0.10174430161714554,
0.009416920132935047,
-0.03411322832107544,
-0.07788190990686417,
0.07637181878089905,
0.013993307016789913,
0.008794236928224564,
0.03929094225168228,
0.01850919798016548,
0.006830872502177954,
0.019823087379336357,
0.02103014662861824,
0.09591864794492722,
0.03454289212822914,
-0.02925783209502697,
-0.024276040494441986,
0.052718278020620346,
0.0705341249704361,
0.02605370245873928,
0.0987827256321907,
-0.04430243372917175,
-0.005007769912481308,
0.047599442303180695,
-0.056849125772714615,
2.0638038604661743e-33,
0.02862316370010376,
0.01659158430993557,
0.024288402870297432,
0.004841446876525879,
-0.01233960036188364,
0.12416134029626846,
0.02364933118224144,
0.06294946372509003,
-0.08934278786182404,
-0.02564183995127678,
-0.09645631909370422,
0.1408941149711609,
0.02872832678258419,
-0.0088548194617033,
0.04255806282162666,
-0.04472940415143967,
0.08333141356706619,
0.049876969307661057,
-0.015774540603160858,
-0.02406800352036953,
0.048339568078517914,
-0.1011066883802414,
0.04454386606812477,
0.01972843147814274,
-0.05371590703725815,
-0.03900093212723732,
-0.0051583582535386086,
-0.03086097538471222,
-0.046187903732061386,
-0.004675011616200209,
-0.06292034685611725,
-0.0074234940111637115,
0.04659393057227135,
-0.002512687351554632,
0.03076563961803913,
-0.011697456240653992,
-0.01134997233748436,
-0.0074226646684110165,
0.005428940057754517,
-0.07405786961317062,
-0.015717387199401855,
0.021328376606106758,
0.020311662927269936,
-0.04058153182268143,
-0.10295359045267105,
-0.01576121337711811,
0.002566094510257244,
-0.021426592022180557,
-0.023591533303260803,
-0.006713083013892174,
0.053490228950977325,
-0.013477054424583912,
0.07972779870033264,
0.08830701559782028,
0.08545444905757904,
0.03847616910934448,
0.033292271196842194,
0.02140451967716217,
-0.06176617369055748,
0.07198674976825714,
-0.006485076621174812,
-0.06094872206449509,
0.08475659042596817,
0.10349994152784348,
0.05768629536032677,
0.020700624212622643,
0.047757454216480255,
0.139624685049057,
0.027163632214069366,
0.032954562455415726,
0.033305574208498,
0.09190041571855545,
0.04618316516280174,
-0.010516075417399406,
0.03205932304263115,
-0.11005053669214249,
0.026643656194210052,
-0.06035344675183296,
-0.07388340681791306,
0.0003132260462734848,
-0.05670197308063507,
-0.02701316960155964,
0.09860176593065262,
0.01430080272257328,
-0.10203579813241959,
0.040140509605407715,
0.048200733959674835,
0.040614932775497437,
-0.0762714222073555,
-0.058132994920015335,
-0.04175074025988579,
0.02327040769159794,
-0.04596007615327835,
-0.07220906764268875,
-0.013204420916736126,
-2.7728967666997258e-33,
0.01859833486378193,
-0.0881567895412445,
-0.02120191603899002,
0.06625707447528839,
0.02863658405840397,
-0.031417831778526306,
0.03444591537117958,
0.03997178003191948,
-0.03912617266178131,
-0.05315203219652176,
0.010361496359109879,
-0.0750187560915947,
0.01043157372623682,
-0.05307098105549812,
-0.0474238321185112,
-0.0011460394598543644,
-0.013716611079871655,
-0.1177440881729126,
0.03928948566317558,
-0.016634033992886543,
-0.02612214908003807,
-0.10617988556623459,
0.017657171934843063,
0.10567189007997513,
-0.03417915850877762,
-0.04106243699789047,
-0.016636379063129425,
-0.05507954582571983,
-0.023570237681269646,
0.005795579869300127,
0.02741124853491783,
-0.03310244530439377,
0.003714027116075158,
-0.031183401122689247,
-0.009813419543206692,
-0.027034226804971695,
0.059585146605968475,
0.03243345394730568,
0.023529144003987312,
0.055241357535123825,
0.03247220814228058,
0.01758641004562378,
-0.04911613091826439,
-0.08635198324918747,
0.028036177158355713,
-0.011361819691956043,
-0.07691572606563568,
0.07709150016307831,
0.01021004468202591,
-0.03372903913259506,
0.0073529682122170925,
0.001217754790559411,
0.00041150953620672226,
0.14570802450180054,
-0.026382165029644966,
0.0247529037296772,
-0.051236264407634735,
0.06507997214794159,
-0.11288684606552124,
0.0005230112583376467,
-0.06780686229467392,
-0.008298500441014767,
-0.05701081454753876,
-0.01762724667787552,
-0.021356750279664993,
0.012784874066710472,
-0.029154932126402855,
-0.10428627580404282,
-0.018937865272164345,
0.012654080986976624,
-0.040706612169742584,
-0.04867612197995186,
0.03581111133098602,
0.0760498046875,
0.018783852458000183,
-0.005261292681097984,
0.002398160984739661,
-0.045224644243717194,
0.08119075745344162,
0.04288806766271591,
-0.06185466796159744,
0.10607966035604477,
0.04836932569742203,
0.08322952687740326,
0.047094833105802536,
0.020826321095228195,
0.04069521278142929,
0.11107262969017029,
-0.07541372627019882,
0.05573761835694313,
0.005562490317970514,
-0.06104663759469986,
-0.07836852967739105,
-0.07060974836349487,
-0.00603618286550045,
-5.76619889613994e-8,
-0.06391309946775436,
0.062448520213365555,
-0.05145902931690216,
0.0471397303044796,
0.03993609547615051,
-0.0018417786341160536,
0.03135582432150841,
0.08739110827445984,
-0.03836558386683464,
0.04664819315075874,
0.01551139261573553,
-0.0425390899181366,
-0.09129734337329865,
0.011364510282874107,
0.015561041422188282,
0.041877344250679016,
0.02878040261566639,
-0.0454033687710762,
-0.03145812824368477,
-0.056007687002420425,
-0.08167529851198196,
0.02103840745985508,
-0.03320213407278061,
0.05017424747347832,
0.05466659367084503,
-0.022751007229089737,
0.026853233575820923,
0.1049114316701889,
-0.02016124315559864,
-0.07690764963626862,
-0.016340509057044983,
-0.06783511489629745,
-0.04553835093975067,
0.02188987284898758,
0.007973379455506802,
0.048439182341098785,
-0.0862262099981308,
0.011626175604760647,
-0.0185350701212883,
0.1006595566868782,
0.0353398397564888,
0.03901216760277748,
-0.005308228079229593,
-0.01938694342970848,
0.006623662076890469,
-0.007723400369286537,
-0.059123311191797256,
0.09904734045267105,
-0.01019301824271679,
0.0023842474911361933,
0.04515461623668671,
-0.027588697150349617,
0.00960739515721798,
0.06459572166204453,
0.029137924313545227,
-0.005275482777506113,
-0.008735156618058681,
-0.070738285779953,
0.03090452030301094,
0.043559812009334564,
0.06537089496850967,
-0.04278681054711342,
-0.04163217917084694,
-0.03740605339407921
] | 0.016774
|
... ] } } } -------------------------------------------------- // TESTRESPONSE[s/\.\.\.//] // TESTRESPONSE[s/: (\-)?[0-9]+/: $body.$\_path/] These errors can only be calculated in this way when the terms are ordered by descending document count. When the aggregation is ordered by the terms values themselves (either ascending or descending) there is no error in the document count since if a shard does not return a particular term which appears in the results from another shard, it must not have that term in its index. When the aggregation is either sorted by a sub aggregation or in order of ascending document count, the error in the document counts cannot be determined and is given a value of -1 to indicate this. [[search-aggregations-bucket-terms-aggregation-order]] ==== Order The order of the buckets can be customized by setting the `order` parameter. By default, the buckets are ordered by their `doc\_count` descending. It is possible to change this behaviour as documented below: WARNING: Sorting by ascending `\_count` or by sub aggregation is discouraged as it increases the <> on document counts. It is fine when a single shard is queried, or when the field that is being aggregated was used as a routing key at index time: in these cases results will be accurate since shards have disjoint values. However otherwise, errors are unbounded. One particular case that could still be useful is sorting by <> or <> aggregation: counts will not be accurate but at least the top buckets will be correctly picked. Ordering the buckets by their doc `\_count` in an ascending manner: [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "genres" : { "terms" : { "field" : "genre", "order" : { "\_count" : "asc" } } } } } -------------------------------------------------- // CONSOLE Ordering the buckets alphabetically by their terms in an ascending manner: [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "genres" : { "terms" : { "field" : "genre", "order" : { "\_key" : "asc" } } } } } -------------------------------------------------- // CONSOLE deprecated[6.0.0, Use `\_key` instead of `\_term` to order buckets by their term] Ordering the buckets by single value metrics sub-aggregation (identified by the aggregation name): [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "genres" : { "terms" : { "field" : "genre", "order" : { "max\_play\_count" : "desc" } }, "aggs" : { "max\_play\_count" : { "max" : { "field" : "play\_count" } } } } } } -------------------------------------------------- // CONSOLE Ordering the buckets by multi value metrics sub-aggregation (identified by the aggregation name): [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "genres" : { "terms" : { "field" : "genre", "order" : { "playback\_stats.max" : "desc" } }, "aggs" : { "playback\_stats" : { "stats" : { "field" : "play\_count" } } } } } } -------------------------------------------------- // CONSOLE [NOTE] .Pipeline aggs cannot be used for sorting ======================================= <> are run during the reduce phase after all other aggregations have already completed. For this reason, they cannot be used for ordering. ======================================= It is also possible to order the buckets based on a "deeper" aggregation in the hierarchy. This is supported as long as the aggregations path are of a single-bucket type, where the last aggregation in the path may either be a single-bucket one or a metrics one. If it's a single-bucket type, the order will be defined by the number of docs in the bucket (i.e. `doc\_count`), in case it's a metrics one, the same rules as above apply (where the path must indicate the metric name to sort by in case of a multi-value metrics aggregation, and in case of a single-value metrics aggregation the sort will be applied
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/terms-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.008017883636057377,
0.009949413128197193,
0.045000918209552765,
0.07177245616912842,
-0.03623747080564499,
0.04145657643675804,
-0.011631515808403492,
0.020245512947440147,
0.10528009384870529,
0.022846709936857224,
0.009585939347743988,
-0.02071080356836319,
0.11254213005304337,
-0.043432362377643585,
-0.06424012780189514,
-0.03374321013689041,
-0.07249337434768677,
-0.015183323994278908,
-0.06887229532003403,
-0.07346546649932861,
0.040443304926157,
0.04943236708641052,
0.0395808182656765,
-0.023441899567842484,
-0.019601965323090553,
0.014404318295419216,
-0.15856029093265533,
0.0032621060963720083,
0.04921644181013107,
-0.008755268529057503,
0.023297976702451706,
0.08758950978517532,
-0.007709660567343235,
0.04169313237071037,
0.09927453845739365,
-0.011231786571443081,
0.02623707242310047,
-0.08052315562963486,
-0.014402857981622219,
-0.0026887869462370872,
0.034130603075027466,
-0.040739718824625015,
0.007517113815993071,
-0.09091076999902725,
0.018966158851981163,
-0.018852438777685165,
-0.02965443953871727,
-0.01545044407248497,
-0.04505135118961334,
-0.01183301117271185,
-0.021572792902588844,
-0.016717487946152687,
-0.03258274868130684,
0.07542438060045242,
0.028737872838974,
0.03789624199271202,
-0.06582855433225632,
-0.061293382197618484,
-0.029263554140925407,
-0.08094528317451477,
-0.030674204230308533,
-0.09835957735776901,
-0.011857748031616211,
-0.06997624039649963,
-0.026089396327733994,
0.012165019288659096,
0.06200379133224487,
-0.0416659414768219,
-0.03596916422247887,
0.13396519422531128,
0.0025630516465753317,
-0.004769159015268087,
-0.026618462055921555,
0.0646037682890892,
0.027713309973478317,
0.11994439363479614,
-0.025845343247056007,
-0.002465396886691451,
0.0160079263150692,
-0.02900562807917595,
-0.07881943881511688,
-0.04741543531417847,
0.03362465277314186,
0.029968995600938797,
0.0504891537129879,
0.012998397462069988,
-0.012841728515923023,
-0.05458042398095131,
0.047244682908058167,
-0.023922022432088852,
-0.01630161702632904,
-0.041578229516744614,
0.03936254233121872,
0.02307339943945408,
0.04465999826788902,
-0.001470961607992649,
-0.022239435464143753,
0.0036430808249861,
0.09824158251285553,
0.019221268594264984,
0.014294691383838654,
0.04710588604211807,
0.02385074831545353,
-0.09717131406068802,
-0.055516526103019714,
0.06835266202688217,
-0.10377492010593414,
0.018687110394239426,
0.008182944729924202,
0.008873282000422478,
0.017447033897042274,
-0.07742228358983994,
0.03738406300544739,
-0.003092787694185972,
-0.036712124943733215,
-0.020847491919994354,
0.031371306627988815,
-0.031568244099617004,
0.020184507593512535,
0.009662168100476265,
0.1018991619348526,
0.040091149508953094,
0.06802123785018921,
-0.05477301776409149,
0.06995357573032379,
0.001114828628487885,
0.014393661171197891,
-5.0336570933690745e-33,
0.052185654640197754,
-0.041207145899534225,
0.06259693205356598,
-0.013397530652582645,
0.020560935139656067,
0.05557030066847801,
0.01398428063839674,
0.07275063544511795,
-0.04560138285160065,
0.02721928246319294,
-0.05200701206922531,
0.06624166667461395,
-0.06588178128004074,
-0.11202704906463623,
0.013533690944314003,
0.05331634357571602,
0.09510818123817444,
0.007192946970462799,
-0.06451832503080368,
0.008927379734814167,
0.020984744653105736,
-0.06627703458070755,
0.04248860478401184,
-0.01566598191857338,
-0.008179137483239174,
0.001089889439754188,
-0.031699080020189285,
-0.05964281037449837,
-0.008184930309653282,
-0.009048421867191792,
-0.001674935920163989,
-0.011600041761994362,
0.045549795031547546,
-0.03995610401034355,
0.05355281010270119,
0.0010766122722998261,
-0.009647190570831299,
0.0459628626704216,
-0.07849142700433731,
0.0005230215028859675,
-0.04025677964091301,
0.0012888176133856177,
0.035433344542980194,
-0.06059470400214195,
-0.012518455274403095,
0.00629097456112504,
0.042203519493341446,
-0.02852896973490715,
0.0693407952785492,
0.06154359132051468,
-0.08326112478971481,
0.026704108342528343,
0.07407509535551071,
0.03477773070335388,
0.04229974374175072,
-0.00967071857303381,
-0.012662820518016815,
0.03214674070477486,
-0.0681179016828537,
-0.01701110042631626,
-0.02555866912007332,
-0.004377707839012146,
-0.01107746735215187,
-0.0014266502112150192,
0.04687552526593208,
-0.011697255074977875,
-0.001841190503910184,
0.1168786957859993,
0.006844766903668642,
0.05939886346459389,
0.01210523210465908,
0.08037400245666504,
0.0038061414379626513,
0.028569413349032402,
0.0709804967045784,
-0.1352817267179489,
0.07943173497915268,
-0.002499361289665103,
-0.009893354028463364,
-0.03245161473751068,
0.017056910321116447,
-0.06274651736021042,
0.015739567577838898,
0.03641539067029953,
-0.0836411640048027,
0.0885738953948021,
0.027269531041383743,
0.01005379855632782,
-0.10739684104919434,
-0.08903908729553223,
-0.015936223790049553,
-0.01834130845963955,
-0.06758477538824081,
-0.07285033166408539,
-0.04825771972537041,
1.121516752258482e-33,
0.03968260437250137,
-0.026623275130987167,
-0.009647334925830364,
0.08007169514894485,
0.032610587775707245,
-0.05515451729297638,
0.09649673849344254,
0.03129424899816513,
-0.0033822418190538883,
-0.05952727794647217,
-0.005042209755629301,
-0.020181024447083473,
0.0030950349755585194,
-0.025225698947906494,
0.01608388125896454,
0.019170653074979782,
-0.08827020972967148,
-0.13478125631809235,
0.007519859354943037,
0.015207634307444096,
-0.006924373563379049,
0.053170934319496155,
0.051346149295568466,
0.10997043550014496,
-0.09251202642917633,
-0.022400030866265297,
0.042584728449583054,
-0.061155010014772415,
0.0013535310281440616,
0.045820750296115875,
0.08590210229158401,
0.0113297738134861,
-0.030992500483989716,
0.027082443237304688,
0.027462102472782135,
-0.1021038293838501,
0.04037626087665558,
-0.014317416585981846,
-0.08119931817054749,
0.036014217883348465,
0.048904575407505035,
0.036833178251981735,
0.025216421112418175,
-0.0688835084438324,
0.047899771481752396,
-0.012850628234446049,
0.021512461826205254,
0.02600681036710739,
-0.04468100517988205,
-0.08524032682180405,
-0.04025241732597351,
-0.0005098250694572926,
-0.08201733231544495,
0.15378563106060028,
0.018311254680156708,
0.037560347467660904,
-0.025283822789788246,
-0.013155007734894753,
-0.13066788017749786,
-0.028371289372444153,
-0.07965251803398132,
0.03883061930537224,
-0.03950030356645584,
0.00008201324817491695,
-0.02796187996864319,
0.021719081327319145,
-0.07618448138237,
-0.05358060821890831,
0.04592503234744072,
-0.001028546947054565,
-0.020440779626369476,
-0.0574679970741272,
0.01827342063188553,
0.00005255280848359689,
0.029615113511681557,
-0.017056545242667198,
-0.014214493334293365,
-0.016218947246670723,
0.061435651034116745,
0.04895823076367378,
-0.05827257037162781,
0.03202991560101509,
0.015078457072377205,
0.13844983279705048,
-0.017361704260110855,
-0.03937409445643425,
0.059307247400283813,
0.12747785449028015,
-0.05270358547568321,
0.04650052636861801,
-0.005138685926795006,
-0.016248680651187897,
0.024779602885246277,
-0.0007284705643542111,
0.02803667075932026,
-5.5642480845108366e-8,
-0.08395028114318848,
-0.021213794127106667,
-0.08517071604728699,
-0.006786181125789881,
0.017604021355509758,
-0.005563142243772745,
0.02091260254383087,
0.028109963983297348,
-0.08978380262851715,
-0.00773781631141901,
0.03612523525953293,
-0.004618180450052023,
-0.08289452642202377,
-0.01623525656759739,
-0.07068245112895966,
0.008819608949124813,
0.007602853234857321,
0.06239496171474457,
-0.026596825569868088,
-0.07991332560777664,
-0.05413525551557541,
0.0183306485414505,
0.034364450722932816,
-0.03994766250252724,
-0.028144201263785362,
0.06927214562892914,
-0.008189409971237183,
0.04550532251596451,
-0.06906593590974808,
-0.02259942889213562,
0.05390610173344612,
-0.04419180378317833,
-0.005812650080770254,
-0.02781336009502411,
-0.0026028195861727,
0.0082929702475667,
-0.009376609697937965,
0.01480976864695549,
0.008730581030249596,
0.02025688625872135,
0.02005074732005596,
0.058059364557266235,
0.005334388464689255,
0.01054264698177576,
-0.0009303223341703415,
-0.06713558733463287,
-0.05454420670866966,
0.08353149145841599,
0.037642478942871094,
-0.09755653142929077,
0.02016577124595642,
-0.034959327429533005,
-0.10067123919725418,
0.03751702606678009,
0.013379394076764584,
-0.03259776160120964,
0.06838245689868927,
-0.05457107722759247,
-0.04100831225514412,
0.023860974237322807,
0.14987008273601532,
-0.02977551706135273,
-0.035494282841682434,
-0.020137980580329895
] | -0.039214
|
of docs in the bucket (i.e. `doc\_count`), in case it's a metrics one, the same rules as above apply (where the path must indicate the metric name to sort by in case of a multi-value metrics aggregation, and in case of a single-value metrics aggregation the sort will be applied on that value). The path must be defined in the following form: // https://en.wikipedia.org/wiki/Extended\_Backus%E2%80%93Naur\_Form [source,ebnf] -------------------------------------------------- AGG\_SEPARATOR = '>' ; METRIC\_SEPARATOR = '.' ; AGG\_NAME = ; METRIC = ; PATH = [ , ]\* [ , ] ; -------------------------------------------------- [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "countries" : { "terms" : { "field" : "artist.country", "order" : { "rock>playback\_stats.avg" : "desc" } }, "aggs" : { "rock" : { "filter" : { "term" : { "genre" : "rock" }}, "aggs" : { "playback\_stats" : { "stats" : { "field" : "play\_count" }} } } } } } } -------------------------------------------------- // CONSOLE The above will sort the artist's countries buckets based on the average play count among the rock songs. Multiple criteria can be used to order the buckets by providing an array of order criteria such as the following: [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "countries" : { "terms" : { "field" : "artist.country", "order" : [ { "rock>playback\_stats.avg" : "desc" }, { "\_count" : "desc" } ] }, "aggs" : { "rock" : { "filter" : { "term" : { "genre" : "rock" }}, "aggs" : { "playback\_stats" : { "stats" : { "field" : "play\_count" }} } } } } } } -------------------------------------------------- // CONSOLE The above will sort the artist's countries buckets based on the average play count among the rock songs and then by their `doc\_count` in descending order. NOTE: In the event that two buckets share the same values for all order criteria the bucket's term value is used as a tie-breaker in ascending alphabetical order to prevent non-deterministic ordering of buckets. ==== Minimum document count It is possible to only return terms that match more than a configured number of hits using the `min\_doc\_count` option: [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "tags" : { "terms" : { "field" : "tags", "min\_doc\_count": 10 } } } } -------------------------------------------------- // CONSOLE The above aggregation would only return tags which have been found in 10 hits or more. Default value is `1`. Terms are collected and ordered on a shard level and merged with the terms collected from other shards in a second step. However, the shard does not have the information about the global document count available. The decision if a term is added to a candidate list depends only on the order computed on the shard using local shard frequencies. The `min\_doc\_count` criterion is only applied after merging local terms statistics of all shards. In a way the decision to add the term as a candidate is made without being very \_certain\_ about if the term will actually reach the required `min\_doc\_count`. This might cause many (globally) high frequent terms to be missing in the final result if low frequent terms populated the candidate lists. To avoid this, the `shard\_size` parameter can be increased to allow more candidate terms on the shards. However, this increases memory consumption and network traffic. `shard\_min\_doc\_count` parameter The parameter `shard\_min\_doc\_count` regulates the \_certainty\_ a shard has if the term should actually be added to the candidate list or not with respect to the `min\_doc\_count`. Terms will only be considered if their local shard frequency within the set is higher than the `shard\_min\_doc\_count`. If your dictionary contains many low frequent terms and you are not
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/terms-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.03603440150618553,
-0.021076953038573265,
0.02868644893169403,
0.014851485379040241,
-0.08461063355207443,
0.035158030688762665,
-0.03743436187505722,
0.04689192771911621,
0.1070137470960617,
0.03469111770391464,
-0.03309140354394913,
-0.024304907768964767,
0.029713090509176254,
-0.047175128012895584,
-0.07771813124418259,
0.0034062082413583994,
-0.09973259270191193,
0.028918687254190445,
-0.08072720468044281,
-0.10106121003627777,
0.0009670478757470846,
0.12496098130941391,
-0.005963868461549282,
0.00018291846208740026,
0.003431326011195779,
0.004616452381014824,
-0.14124654233455658,
-0.015369947999715805,
0.06609715521335602,
-0.018964456394314766,
0.008337929844856262,
0.023851428180933,
0.041631653904914856,
0.03163831681013107,
0.03140103444457054,
0.11927013099193573,
0.0022166299168020487,
-0.06066477298736572,
-0.02337179146707058,
0.00011488165910122916,
-0.0012888353085145354,
-0.0019663055427372456,
0.037563059478998184,
-0.09130747616291046,
-0.04452671483159065,
-0.038430698215961456,
-0.04070473834872246,
-0.03315829858183861,
-0.02857939526438713,
0.07111205905675888,
-0.03469308465719223,
-0.025634128600358963,
-0.05735122039914131,
0.05246678739786148,
0.004713243339210749,
0.050696659833192825,
-0.08923490345478058,
0.003503115614876151,
-0.05508837103843689,
-0.0884581133723259,
-0.04148794338107109,
-0.08359616994857788,
-0.04434918984770775,
-0.06098036468029022,
0.03995046392083168,
0.013760233297944069,
-0.03674982488155365,
0.01757417619228363,
-0.02280024066567421,
0.025977538898587227,
0.03994162753224373,
-0.0029981050174683332,
-0.04511163383722305,
-0.026132987812161446,
-0.0035548084415495396,
0.026532543823122978,
0.014503274112939835,
0.09871828556060791,
-0.0071695540100336075,
-0.10858110338449478,
-0.0223259087651968,
0.012729931622743607,
0.02101951651275158,
0.018740251660346985,
0.044392503798007965,
-0.07125003635883331,
-0.017878301441669464,
-0.08703237771987915,
0.06446024030447006,
-0.0364476814866066,
-0.006546075455844402,
-0.060731492936611176,
0.00034221759415231645,
0.006940209772437811,
0.02601798251271248,
0.03910039737820625,
-0.019692787900567055,
0.08011960983276367,
0.1340322047472,
0.04748502001166344,
-0.024639515206217766,
0.03889642655849457,
-0.03728495538234711,
0.03233170509338379,
0.05560867115855217,
0.031143145635724068,
-0.07877160608768463,
0.020945386961102486,
0.0029755006544291973,
-0.021673589944839478,
0.01852433569729328,
-0.020214814692735672,
-0.008853497914969921,
-0.0032920558005571365,
-0.03905490040779114,
-0.022917134687304497,
-0.011838792823255062,
-0.07367778569459915,
0.015591143630445004,
-0.014709919691085815,
-0.04120383411645889,
-0.005249227397143841,
0.05178973823785782,
-0.033293116837739944,
-0.015041743405163288,
0.03742444887757301,
0.05960341915488243,
2.182372302213772e-34,
-0.03179951757192612,
-0.10096687078475952,
0.09331519901752472,
-0.026555169373750687,
0.02076447196304798,
0.07865263521671295,
-0.040725864470005035,
0.050817664712667465,
-0.03319241851568222,
-0.00989940669387579,
-0.053247351199388504,
0.07997758686542511,
-0.05594669282436371,
-0.04847249016165733,
-0.05880698189139366,
-0.02519986219704151,
0.011250841431319714,
0.0733066275715828,
-0.07347775995731354,
-0.06879095733165741,
0.05160035565495491,
-0.02785402536392212,
-0.002768922131508589,
-0.008646314032375813,
-0.019431572407484055,
-0.014609300531446934,
0.00280197081156075,
-0.05578051507472992,
-0.038160908967256546,
0.027424804866313934,
0.04306531697511673,
-0.033194828778505325,
0.0006203022203408182,
-0.04964906722307205,
0.012185451574623585,
0.028181670233607292,
-0.06566266715526581,
0.05694850534200668,
-0.011253309436142445,
0.008096057921648026,
0.002221945906057954,
-0.013585071079432964,
-0.0008279553730972111,
-0.0788668617606163,
-0.09855470061302185,
0.029634812846779823,
0.022194908931851387,
0.03100932016968727,
0.06828771531581879,
-0.008335993625223637,
-0.055362869054079056,
-0.02558901533484459,
0.04598091170191765,
0.03372815623879433,
0.022410575300455093,
-0.09688189625740051,
-0.03410768136382103,
0.0752720981836319,
-0.03625567629933357,
0.05208960920572281,
-0.014986610040068626,
0.14421658217906952,
-0.02888704650104046,
0.006669638212770224,
0.017849314957857132,
-0.04791492968797684,
0.04824738949537277,
0.1248113214969635,
0.047357525676488876,
0.07144874334335327,
0.025253163650631905,
0.10368998348712921,
-0.022692618891596794,
0.06556888669729233,
0.061524033546447754,
-0.06073468551039696,
0.060247525572776794,
-0.03870750218629837,
-0.021490393206477165,
-0.03851139917969704,
-0.13872241973876953,
0.006408581044524908,
-0.0017239708686247468,
0.0348498709499836,
-0.04464445263147354,
0.05415377393364906,
-0.007531453855335712,
0.03413096442818642,
-0.07990279793739319,
-0.12417544424533844,
-0.008008929900825024,
-0.014277252368628979,
-0.06439577788114548,
-0.028990676626563072,
-0.04762478545308113,
-4.1615056719322016e-33,
0.026551082730293274,
0.06660754978656769,
0.04188283532857895,
0.04881967231631279,
0.045422814786434174,
-0.012568690814077854,
0.03520984575152397,
0.013463652692735195,
0.0460476279258728,
0.08259108662605286,
-0.02231435291469097,
0.021036213263869286,
0.03957393020391464,
-0.016169918701052666,
0.0929107591509819,
-0.015962369740009308,
-0.1006733626127243,
-0.12901480495929718,
-0.08041200041770935,
-0.015906203538179398,
-0.03626111522316933,
0.0013671957422047853,
0.018870875239372253,
0.0937277153134346,
-0.05512670427560806,
-0.03273530676960945,
0.03841841220855713,
-0.039959728717803955,
-0.04212464392185211,
0.006891471799463034,
0.008008398115634918,
-0.023544244468212128,
-0.09684402495622635,
0.046864964067935944,
-0.09741177409887314,
-0.13708585500717163,
0.038408320397138596,
0.05792198330163956,
-0.03837251663208008,
0.023205602541565895,
-0.010847387835383415,
0.030329935252666473,
-0.0555429570376873,
0.023159781470894814,
0.016614878550171852,
0.0225331149995327,
-0.0019763843156397343,
0.009959696792066097,
-0.058089904487133026,
-0.08324835449457169,
0.03215240687131882,
0.02407161146402359,
-0.012808208353817463,
0.0848240777850151,
-0.045420847833156586,
0.032040923833847046,
-0.029365234076976776,
-0.013570520095527172,
-0.1140640527009964,
0.0116443932056427,
0.029465818777680397,
-0.027787258848547935,
0.021267816424369812,
-0.014918887987732887,
0.018858224153518677,
-0.045048024505376816,
-0.0817210003733635,
-0.05084758251905441,
-0.09180375188589096,
0.013134043663740158,
-0.033622290939092636,
-0.04384337738156319,
0.010416501201689243,
-0.025821980088949203,
0.019074615091085434,
0.05622619017958641,
0.04874517023563385,
-0.05668719485402107,
0.09254595637321472,
-0.03369341045618057,
-0.06092295050621033,
0.06212836131453514,
0.037921857088804245,
0.09015381336212158,
0.011586739681661129,
-0.014532876200973988,
0.02665630355477333,
0.041083358228206635,
-0.008819710463285446,
0.11130557954311371,
-0.050335247069597244,
-0.0349675789475441,
0.008016135543584824,
0.06285429000854492,
-0.031584497541189194,
-5.795366675442892e-8,
-0.09097815304994583,
-0.013394737616181374,
-0.06343667209148407,
0.030064597725868225,
0.005537721328437328,
0.022883256897330284,
0.012865650467574596,
0.16682888567447662,
-0.025113005191087723,
0.023191945627331734,
0.05789979174733162,
-0.044407326728105545,
-0.09380602091550827,
0.013035980984568596,
-0.04464109241962433,
-0.04157206043601036,
0.011696578934788704,
0.0031255134381353855,
-0.05882029980421066,
-0.06296941637992859,
-0.039253119379282,
-0.01720881648361683,
0.03657686337828636,
-0.008219361305236816,
0.03244909644126892,
-0.027126766741275787,
0.006057450082153082,
0.053525954484939575,
0.026834698393940926,
-0.08722595125436783,
0.0473405197262764,
0.0231237281113863,
-0.04504014551639557,
0.04327603429555893,
-0.03884689137339592,
0.012356148101389408,
-0.022976484149694443,
0.027891650795936584,
-0.047212183475494385,
0.052282169461250305,
-0.02709060162305832,
0.041414301842451096,
0.01730298437178135,
0.04753446951508522,
0.0483962707221508,
0.04761398211121559,
-0.0058695231564342976,
0.08055178821086884,
-0.014567386358976364,
0.0021327876020222902,
-0.0033985490445047617,
-0.11750707775354385,
0.05238695815205574,
0.031873516738414764,
-0.010774371214210987,
-0.061777375638484955,
-0.002203655196353793,
-0.03192662447690964,
0.020039478316903114,
-0.013877815566956997,
0.031157236546278,
-0.05301383137702942,
-0.01936141774058342,
-0.002021846128627658
] | 0.036296
|
shard has if the term should actually be added to the candidate list or not with respect to the `min\_doc\_count`. Terms will only be considered if their local shard frequency within the set is higher than the `shard\_min\_doc\_count`. If your dictionary contains many low frequent terms and you are not interested in those (for example misspellings), then you can set the `shard\_min\_doc\_count` parameter to filter out candidate terms on a shard level that will with a reasonable certainty not reach the required `min\_doc\_count` even after merging the local counts. `shard\_min\_doc\_count` is set to `0` per default and has no effect unless you explicitly set it. NOTE: Setting `min\_doc\_count`=`0` will also return buckets for terms that didn't match any hit. However, some of the returned terms which have a document count of zero might only belong to deleted documents or documents from other types, so there is no warranty that a `match\_all` query would find a positive document count for those terms. WARNING: When NOT sorting on `doc\_count` descending, high values of `min\_doc\_count` may return a number of buckets which is less than `size` because not enough data was gathered from the shards. Missing buckets can be back by increasing `shard\_size`. Setting `shard\_min\_doc\_count` too high will cause terms to be filtered out on a shard level. This value should be set much lower than `min\_doc\_count/#shards`. [[search-aggregations-bucket-terms-aggregation-script]] ==== Script Generating the terms using a script: [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "genres" : { "terms" : { "script" : { "source": "doc['genre'].value", "lang": "painless" } } } } } -------------------------------------------------- // CONSOLE This will interpret the `script` parameter as an `inline` script with the default script language and no script parameters. To use a stored script use the following syntax: ////////////////////////// [source,js] -------------------------------------------------- POST /\_scripts/my\_script { "script": { "lang": "painless", "source": "doc[params.field].value" } } -------------------------------------------------- // CONSOLE ////////////////////////// [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "genres" : { "terms" : { "script" : { "id": "my\_script", "params": { "field": "genre" } } } } } } -------------------------------------------------- // CONSOLE // TEST[continued] ==== Value Script [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "genres" : { "terms" : { "field" : "gender", "script" : { "source" : "'Genre: ' +\_value", "lang" : "painless" } } } } } -------------------------------------------------- // CONSOLE ==== Filtering Values It is possible to filter the values for which buckets will be created. This can be done using the `include` and `exclude` parameters which are based on regular expression strings or arrays of exact values. Additionally, `include` clauses can filter using `partition` expressions. ===== Filtering Values with regular expressions [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "tags" : { "terms" : { "field" : "tags", "include" : ".\*sport.\*", "exclude" : "water\_.\*" } } } } -------------------------------------------------- // CONSOLE In the above example, buckets will be created for all the tags that has the word `sport` in them, except those starting with `water\_` (so the tag `water\_sports` will no be aggregated). The `include` regular expression will determine what values are "allowed" to be aggregated, while the `exclude` determines the values that should not be aggregated. When both are defined, the `exclude` has precedence, meaning, the `include` is evaluated first and only then the `exclude`. The syntax is the same as <>. ===== Filtering Values with exact values For matching based on exact values the `include` and `exclude` parameters can simply take an array of strings that represent the terms as they are found in the index: [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "JapaneseCars" : { "terms" : { "field" : "make", "include" : ["mazda",
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/terms-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.03829329460859299,
-0.032586947083473206,
0.009720309637486935,
-0.0016567102866247296,
-0.01685156673192978,
0.046333737671375275,
0.002189263701438904,
-0.02674943022429943,
0.0828196331858635,
-0.018154866993427277,
0.07848741114139557,
-0.034745365381240845,
0.09990889579057693,
-0.004445230588316917,
-0.053986601531505585,
-0.00771851371973753,
-0.021306822076439857,
-0.017617743462324142,
-0.05793415755033493,
0.013630126602947712,
0.029835516586899757,
0.0637071281671524,
0.04792458564043045,
-0.043774306774139404,
0.006779572926461697,
-0.04121752828359604,
-0.07300237566232681,
-0.01568033918738365,
0.009340771473944187,
-0.010489446111023426,
-0.01637190207839012,
0.12092617899179459,
-0.015231824479997158,
0.007839408703148365,
0.09113308787345886,
-0.00256337015889585,
-0.04569169506430626,
-0.0008529903134331107,
-0.007094349712133408,
-0.0024201462510973215,
-0.0657360628247261,
-0.047024376690387726,
-0.08358093351125717,
0.022696010768413544,
-0.05683412775397301,
0.03660918027162552,
-0.04885950684547424,
-0.014584530144929886,
-0.016752688214182854,
-0.02842613495886326,
-0.021960537880659103,
0.021112816408276558,
-0.031556498259305954,
0.07449577748775482,
0.00835687480866909,
-0.048310138285160065,
-0.11025606840848923,
-0.011008347384631634,
-0.09045033156871796,
-0.11617770045995712,
-0.03812612220644951,
-0.06590771675109863,
-0.06543606519699097,
-0.061365820467472076,
0.01979088969528675,
0.02313903160393238,
0.022589268162846565,
-0.05422971397638321,
0.01028549112379551,
0.053323328495025635,
-0.019145909696817398,
0.04617317393422127,
-0.031674258410930634,
0.09200487285852432,
0.012844779528677464,
0.07680239528417587,
0.022396184504032135,
-0.015161411836743355,
0.003513443749397993,
0.022006208077073097,
-0.10751000046730042,
0.00809437595307827,
-0.0021627384703606367,
-0.02935652807354927,
0.004819225985556841,
-0.06824090331792831,
0.004220422822982073,
-0.05097741633653641,
0.03808867186307907,
-0.015447952784597874,
0.026106728240847588,
-0.00785440020263195,
0.08713599294424057,
-0.043604910373687744,
0.0715564638376236,
-0.030073091387748718,
0.054262321442365646,
0.13793222606182098,
0.08982885628938675,
0.023097829893231392,
-0.004664516542106867,
-0.04231365770101547,
-0.05095812305808067,
-0.08540213853120804,
0.001445232774131,
0.04638500511646271,
-0.06406857073307037,
-0.019331032410264015,
0.031001731753349304,
-0.0642881691455841,
0.014903273433446884,
-0.05443917214870453,
0.0516153983771801,
-0.021611999720335007,
-0.007482461631298065,
0.04434432461857796,
0.09561744332313538,
-0.023639362305402756,
-0.049461930990219116,
-0.007355015259236097,
-0.03197743371129036,
0.012720574624836445,
0.1061808317899704,
-0.004876693245023489,
-0.053652673959732056,
0.03636881336569786,
-0.06481894105672836,
2.234288285724327e-34,
0.038749419152736664,
-0.015279510989785194,
-0.022095298394560814,
-0.05789593234658241,
0.0035120979882776737,
0.026274969801306725,
-0.0073176235891878605,
0.07255816459655762,
-0.055717144161462784,
0.005042946431785822,
-0.06195109710097313,
0.13245204091072083,
-0.008338972926139832,
-0.05345780402421951,
0.02789142355322838,
-0.022984931245446205,
0.1273549646139145,
0.03994809463620186,
-0.055900510400533676,
-0.019225286319851875,
0.06222473829984665,
-0.056335560977458954,
0.06664586067199707,
-0.020472610369324684,
-0.03996305540204048,
-0.03392557427287102,
0.02643362060189247,
-0.09273676574230194,
-0.026735778898000717,
0.0026649890933185816,
-0.06957190483808517,
-0.014732297509908676,
0.08273882418870926,
-0.018287984654307365,
0.013140124268829823,
0.04976214841008186,
-0.03314097970724106,
-0.004956336226314306,
0.037462469190359116,
-0.08102770894765854,
-0.03654643893241882,
0.031708236783742905,
0.058052003383636475,
-0.03910811245441437,
-0.05975033715367317,
-0.007799598388373852,
0.02984427846968174,
-0.0010873547289520502,
-0.0600130595266819,
0.0636858195066452,
0.0342751145362854,
0.006433926522731781,
-0.0389040969312191,
0.091255322098732,
-0.09182882308959961,
0.010598704218864441,
-0.015816984698176384,
-0.03693689778447151,
-0.04077990725636482,
0.04743579775094986,
-0.001338192611001432,
0.04876071959733963,
0.03267841041088104,
0.017545437440276146,
0.03604248911142349,
-0.049271345138549805,
0.03515388071537018,
0.12320641428232193,
0.047519341111183167,
0.06671403348445892,
0.033370401710271835,
0.06590495258569717,
-0.045775145292282104,
-0.009799936786293983,
0.091727614402771,
-0.042908720672130585,
0.10109302401542664,
-0.0772540494799614,
-0.055439744144678116,
-0.0401773601770401,
0.021055452525615692,
-0.019190307706594467,
-0.013578920625150204,
-0.01762591302394867,
-0.0770704373717308,
0.023933814838528633,
0.07324064522981644,
-0.046586185693740845,
-0.054428838193416595,
-0.07489338517189026,
-0.06539536267518997,
-0.037636302411556244,
-0.09910653531551361,
-0.01200534775853157,
-0.015527663752436638,
-2.295173474802648e-33,
0.031340762972831726,
-0.11645282059907913,
-0.010065383277833462,
0.023426668718457222,
-0.009661123156547546,
0.020033054053783417,
0.08068566769361496,
0.046355195343494415,
0.028737490996718407,
-0.05817943811416626,
0.08934969455003738,
-0.029070192947983742,
0.07383259385824203,
-0.018087752163410187,
-0.009694069623947144,
0.00945246871560812,
-0.06814868748188019,
-0.035939913243055344,
0.02034100517630577,
0.1026802808046341,
0.01098423171788454,
-0.016620848327875137,
-0.08687952905893326,
0.09224992990493774,
-0.041687481105327606,
0.01390138640999794,
-0.04692023992538452,
-0.09890555590391159,
-0.02678731270134449,
0.021392984315752983,
0.07024891674518585,
0.046473924070596695,
-0.07694853842258453,
-0.05869334563612938,
-0.021705009043216705,
-0.07996337115764618,
0.04986853152513504,
0.0027753934264183044,
-0.02813934162259102,
0.0929706022143364,
0.05624503642320633,
0.033438265323638916,
-0.007251306436955929,
-0.014161371625959873,
-0.03815728798508644,
-0.07683711498975754,
-0.04417112469673157,
0.03623470291495323,
0.053653210401535034,
-0.056773945689201355,
0.0350598469376564,
-0.005968101788312197,
0.0461408756673336,
0.1506989449262619,
-0.01578490249812603,
0.031115727499127388,
-0.02332225814461708,
-0.002553155180066824,
-0.1239558607339859,
0.03682169318199158,
-0.05643121153116226,
0.04847746342420578,
-0.06045011058449745,
-0.04096844419836998,
0.02932245284318924,
0.008784551173448563,
-0.06629376858472824,
-0.022383037954568863,
0.042833905667066574,
-0.04447873309254646,
-0.023998284712433815,
-0.02075955457985401,
-0.016845250502228737,
-0.025673402473330498,
-0.018029341474175453,
0.01564006321132183,
0.006063425913453102,
-0.06626611948013306,
-0.0006310503231361508,
0.075349360704422,
-0.037783585488796234,
0.053075868636369705,
0.015357961878180504,
0.026886053383350372,
0.04061698913574219,
-0.07050728052854538,
0.01153445616364479,
0.017199086025357246,
-0.04826670140028,
0.03996492177248001,
0.023355532437562943,
-0.060821011662483215,
-0.00043282032129354775,
-0.02624005265533924,
-0.02498931623995304,
-4.706675227339474e-8,
-0.06359104812145233,
0.06979180872440338,
-0.058664463460445404,
0.04895243048667908,
0.037880875170230865,
-0.0319257490336895,
0.018977634608745575,
0.02875380963087082,
-0.048641387373209,
0.005762446206063032,
0.09287809580564499,
-0.042400430887937546,
-0.11210976541042328,
-0.031422607600688934,
-0.003457162529230118,
0.0885072723031044,
0.03842196613550186,
0.051974132657051086,
-0.005467645358294249,
-0.012621945701539516,
-0.044698022305965424,
0.013437391258776188,
-0.005801849532872438,
0.04664245992898941,
-0.02728128619492054,
0.023596404120326042,
0.1028585284948349,
0.05798443406820297,
0.014018137007951736,
0.0019896163139492273,
0.023405717685818672,
-0.005439999047666788,
-0.030182013288140297,
-0.029519308358430862,
0.024932270869612694,
0.08702245354652405,
-0.11035258322954178,
0.011464426293969154,
-0.028632856905460358,
0.10466986149549484,
0.005094642285257578,
0.016431652009487152,
-0.04467613250017166,
0.04321743920445442,
0.0016240597469732165,
-0.06234659627079964,
-0.05387654900550842,
0.01665550470352173,
0.04247376322746277,
0.001303543453104794,
0.05621712654829025,
0.04754006862640381,
0.03282229229807854,
0.01013945322483778,
-0.022819476202130318,
0.06312117725610733,
0.05550504848361015,
0.0197997335344553,
-0.024422235786914825,
-0.02834438346326351,
0.11907262355089188,
-0.09954896569252014,
0.059565525501966476,
0.019980641081929207
] | -0.049377
|
values For matching based on exact values the `include` and `exclude` parameters can simply take an array of strings that represent the terms as they are found in the index: [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "JapaneseCars" : { "terms" : { "field" : "make", "include" : ["mazda", "honda"] } }, "ActiveCarManufacturers" : { "terms" : { "field" : "make", "exclude" : ["rover", "jensen"] } } } } -------------------------------------------------- // CONSOLE ===== Filtering Values with partitions Sometimes there are too many unique terms to process in a single request/response pair so it can be useful to break the analysis up into multiple requests. This can be achieved by grouping the field's values into a number of partitions at query-time and processing only one partition in each request. Consider this request which is looking for accounts that have not logged any access recently: [source,js] -------------------------------------------------- GET /\_search { "size": 0, "aggs": { "expired\_sessions": { "terms": { "field": "account\_id", "include": { "partition": 0, "num\_partitions": 20 }, "size": 10000, "order": { "last\_access": "asc" } }, "aggs": { "last\_access": { "max": { "field": "access\_date" } } } } } } -------------------------------------------------- // CONSOLE This request is finding the last logged access date for a subset of customer accounts because we might want to expire some customer accounts who haven't been seen for a long while. The `num\_partitions` setting has requested that the unique account\_ids are organized evenly into twenty partitions (0 to 19). and the `partition` setting in this request filters to only consider account\_ids falling into partition 0. Subsequent requests should ask for partitions 1 then 2 etc to complete the expired-account analysis. Note that the `size` setting for the number of results returned needs to be tuned with the `num\_partitions`. For this particular account-expiration example the process for balancing values for `size` and `num\_partitions` would be as follows: 1. Use the `cardinality` aggregation to estimate the total number of unique account\_id values 2. Pick a value for `num\_partitions` to break the number from 1) up into more manageable chunks 3. Pick a `size` value for the number of responses we want from each partition 4. Run a test request If we have a circuit-breaker error we are trying to do too much in one request and must increase `num\_partitions`. If the request was successful but the last account ID in the date-sorted test response was still an account we might want to expire then we may be missing accounts of interest and have set our numbers too low. We must either \* increase the `size` parameter to return more results per partition (could be heavy on memory) or \* increase the `num\_partitions` to consider less accounts per request (could increase overall processing time as we need to make more requests) Ultimately this is a balancing act between managing the Elasticsearch resources required to process a single request and the volume of requests that the client application must issue to complete a task. ==== Multi-field terms aggregation The `terms` aggregation does not support collecting terms from multiple fields in the same document. The reason is that the `terms` agg doesn't collect the string term values themselves, but rather uses <> to produce a list of all of the unique values in the field. Global ordinals results in an important performance boost which would not be possible across multiple fields. There are two approaches that you can use to perform a `terms` agg across multiple fields: <>:: Use a script to retrieve terms from multiple fields. This disables the global ordinals optimization and will be slower than collecting terms from a single
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/terms-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
-0.04467075690627098,
0.06930942833423615,
0.04980789124965668,
0.0343022458255291,
0.043248433619737625,
0.009643428027629852,
0.06578496843576431,
-0.02678901143372059,
0.04888877272605896,
-0.06132311746478081,
0.02446236088871956,
-0.029112447053194046,
0.0034348671324551105,
-0.011677288450300694,
0.0439930334687233,
0.03125691041350365,
-0.05102861300110817,
0.02442934364080429,
-0.08523797243833542,
-0.1449519246816635,
0.02533724717795849,
0.028835345059633255,
0.01086331531405449,
-0.029732665047049522,
0.00820210576057434,
0.011840312741696835,
-0.02556905336678028,
0.04113350063562393,
-0.024673597887158394,
0.062456607818603516,
-0.03246500715613365,
0.024279415607452393,
0.01952834613621235,
0.046032749116420746,
0.009120688773691654,
-0.06649691611528397,
-0.1370469331741333,
-0.005959182046353817,
0.015713652595877647,
-0.03999866172671318,
0.0018691103905439377,
0.08607028424739838,
-0.019553691148757935,
-0.0985613614320755,
0.018836764618754387,
-0.04751647263765335,
-0.09107430279254913,
-0.06932342052459717,
-0.005733551923185587,
-0.021865610033273697,
-0.08803912252187729,
-0.0017643532482907176,
-0.026495596393942833,
0.0045514474622905254,
0.06188565120100975,
-0.029098201543092728,
-0.11715573817491531,
-0.017020009458065033,
-0.03218326345086098,
-0.07905115187168121,
0.02254495769739151,
-0.08817936480045319,
-0.044131726026535034,
-0.043181415647268295,
-0.020931174978613853,
-0.01807495951652527,
0.020539449527859688,
0.028067084029316902,
0.04396720230579376,
0.049697887152433395,
0.05945014953613281,
0.019293038174510002,
0.010573307052254677,
-0.02955694869160652,
0.02859746664762497,
0.06192386522889137,
0.04691813886165619,
-0.0023113074712455273,
0.04606933519244194,
0.0260994303971529,
-0.12721024453639984,
-0.06800802797079086,
-0.04330514743924141,
-0.033863890916109085,
-0.028941089287400246,
-0.0396115668118,
-0.021304570138454437,
-0.07660771161317825,
0.06480614840984344,
-0.0065148621797561646,
-0.11830057203769684,
-0.16166077554225922,
0.07877038419246674,
-0.028844602406024933,
0.08664602041244507,
0.03309501335024834,
0.03656953573226929,
-0.030484924092888832,
0.06169003248214722,
0.011411881074309349,
0.030046680942177773,
-0.007464997470378876,
0.07411282509565353,
-0.050547417253255844,
-0.07326219975948334,
0.02455725707113743,
-0.03289007768034935,
0.02548970654606819,
-0.041184939444065094,
0.04232215881347656,
-0.05184144899249077,
0.02343457005918026,
0.016420431435108185,
0.044828593730926514,
-0.07587635517120361,
0.0026537245139479637,
0.14159421622753143,
-0.07038071751594543,
0.053209684789180756,
0.08205707371234894,
0.0777880996465683,
0.023700164631009102,
0.029175084084272385,
0.04319962486624718,
0.05100410431623459,
0.022351790219545364,
-0.014811642467975616,
-7.421039559292588e-34,
0.006131614558398724,
-0.05010056123137474,
0.04398420825600624,
-0.06498271971940994,
-0.026435479521751404,
0.0019039628095924854,
-0.008113699965178967,
0.05943799018859863,
0.019009359180927277,
0.07709410041570663,
-0.08505617827177048,
0.10476092249155045,
-0.086390420794487,
-0.06865257769823074,
-0.01492192130535841,
-0.06762658059597015,
0.05214100703597069,
-0.04526901617646217,
-0.03660453483462334,
0.018290752544999123,
-0.0063375490717589855,
-0.018949436023831367,
0.008318382315337658,
0.04203299805521965,
-0.04112645611166954,
-0.09382351487874985,
0.0054196990095078945,
-0.024704916402697563,
-0.03408404067158699,
0.017257660627365112,
-0.019153356552124023,
0.03845994919538498,
-0.01780407875776291,
0.077080637216568,
0.06184689328074455,
0.020260661840438843,
-0.07386993616819382,
0.001674720086157322,
-0.006857830565422773,
-0.00427092332392931,
-0.043143004179000854,
-0.004882930312305689,
0.003222702071070671,
-0.054428357630968094,
-0.043846581131219864,
0.03167787194252014,
-0.034819699823856354,
-0.020791085436940193,
0.052718888968229294,
0.09739045798778534,
-0.04153967276215553,
0.027935221791267395,
0.030670179054141045,
0.00790147390216589,
0.015457108616828918,
0.0013562917010858655,
0.0011462750844657421,
0.0703926533460617,
-0.043042100965976715,
0.0358743742108345,
-0.06471442431211472,
0.04772014543414116,
-0.006583779118955135,
0.046422455459833145,
-0.008922978304326534,
0.05466112866997719,
0.04244820401072502,
0.06502494215965271,
-0.01879572682082653,
0.03388358652591705,
0.05276692286133766,
-0.024572595953941345,
0.0360269695520401,
0.015863589942455292,
0.06001019477844238,
-0.08832826465368271,
0.05001246556639671,
0.021225815638899803,
-0.06766502559185028,
-0.054866399616003036,
-0.11488548666238785,
0.03245236724615097,
-0.03683791682124138,
0.05512399971485138,
-0.02954375185072422,
0.05780086666345596,
-0.030712109059095383,
-0.011085365898907185,
-0.0020282946061342955,
-0.0580940768122673,
-0.026302048936486244,
0.043075695633888245,
-0.1180671975016594,
-0.06290289014577866,
0.013777387328445911,
-2.166625637029546e-33,
0.0647745132446289,
-0.0895514115691185,
0.12243609875440598,
-0.06530050933361053,
0.03354119881987572,
-0.07951416820287704,
-0.0053427014499902725,
-0.03835829719901085,
0.08210910856723785,
0.0011875983327627182,
-0.021484192460775375,
-0.013300260528922081,
0.0414859876036644,
-0.0666583999991417,
-0.05925954505801201,
0.043998148292303085,
0.005933572072535753,
-0.03740889951586723,
0.04811659827828407,
0.04001310467720032,
-0.007981494069099426,
0.072760209441185,
-0.02229212038218975,
0.08546196669340134,
-0.05376463010907173,
-0.05472777783870697,
-0.046405136585235596,
0.006667677778750658,
-0.036418549716472626,
-0.0119191138073802,
-0.012466812506318092,
-0.033360883593559265,
-0.039532117545604706,
-0.01766344904899597,
-0.07853715121746063,
-0.10669678449630737,
0.022610202431678772,
0.10171148180961609,
-0.06771483272314072,
0.029794704169034958,
-0.058681000024080276,
-0.029061906039714813,
-0.031937770545482635,
0.07754597812891006,
0.04430343210697174,
-0.02987014688551426,
0.04595888778567314,
0.04541086032986641,
0.0012842664727941155,
-0.036022018641233444,
0.047363851219415665,
0.04187769815325737,
-0.08136560022830963,
0.04295981302857399,
-0.03695082291960716,
-0.06082039326429367,
0.028727756813168526,
-0.07199003547430038,
-0.08996365964412689,
-0.021011462435126305,
0.02827571891248226,
0.008729248307645321,
0.052305493503808975,
-0.046139828860759735,
0.02999288961291313,
-0.037862569093704224,
0.0215663593262434,
0.028218714520335197,
0.05555376410484314,
-0.05495825037360191,
-0.015026389621198177,
-0.05216148495674133,
0.06010521575808525,
0.021332237869501114,
-0.007292061112821102,
-0.015645522624254227,
0.01333269290626049,
-0.06134641543030739,
0.09224117547273636,
-0.03900502994656563,
0.008635200560092926,
-0.018115226179361343,
0.04692653566598892,
0.1263483315706253,
-0.04000357910990715,
0.03548373281955719,
-0.054463014006614685,
0.04973318427801132,
-0.008286882191896439,
-0.006833559833467007,
0.028371870517730713,
-0.00006294087506830692,
0.02182290516793728,
0.06175977364182472,
0.0015347270527854562,
-4.9978247318449576e-8,
0.023771237581968307,
0.030053840950131416,
-0.16079136729240417,
-0.008560177870094776,
-0.030702203512191772,
-0.03286753222346306,
0.018493318930268288,
0.05919388681650162,
-0.05083080753684044,
-0.014346558600664139,
0.09503428637981415,
0.054328370839357376,
-0.021328024566173553,
0.016918594017624855,
-0.04976239427924156,
-0.057828426361083984,
-0.020547492429614067,
0.13285906612873077,
-0.04990694671869278,
0.015398346818983555,
0.03340527415275574,
0.003211449133232236,
-0.054924529045820236,
0.042423542588949203,
0.07534905523061752,
-0.02088082954287529,
0.006306034978479147,
-0.04048720374703407,
0.054421450942754745,
0.03728669136762619,
-0.023261619731783867,
-0.008552453480660915,
-0.002952876966446638,
-0.029605338349938393,
0.0220984797924757,
-0.017345894128084183,
0.03862970322370529,
-0.01974467560648918,
-0.0560028962790966,
0.061436474323272705,
0.03825758025050163,
0.001990268472582102,
-0.04046100750565529,
0.04069793224334717,
0.01892453245818615,
-0.030285896733403206,
-0.026634549722075462,
0.009512371383607388,
0.10073968768119812,
-0.018243566155433655,
0.040478404611349106,
0.01890224777162075,
-0.053545743227005005,
0.032892607152462006,
0.002734470646828413,
-0.050243083387613297,
0.04771751910448074,
0.034425169229507446,
0.02637108601629734,
-0.02895212359726429,
0.10174429416656494,
-0.06024009361863136,
0.023993777111172676,
0.08172415941953659
] | 0.024786
|
which would not be possible across multiple fields. There are two approaches that you can use to perform a `terms` agg across multiple fields: <>:: Use a script to retrieve terms from multiple fields. This disables the global ordinals optimization and will be slower than collecting terms from a single field, but it gives you the flexibility to implement this option at search time. <>:: If you know ahead of time that you want to collect the terms from two or more fields, then use `copy\_to` in your mapping to create a new dedicated field at index time which contains the values from both fields. You can aggregate on this single field, which will benefit from the global ordinals optimization. ==== Collect mode Deferring calculation of child aggregations For fields with many unique terms and a small number of required results it can be more efficient to delay the calculation of child aggregations until the top parent-level aggs have been pruned. Ordinarily, all branches of the aggregation tree are expanded in one depth-first pass and only then any pruning occurs. In some scenarios this can be very wasteful and can hit memory constraints. An example problem scenario is querying a movie database for the 10 most popular actors and their 5 most common co-stars: [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "actors" : { "terms" : { "field" : "actors", "size" : 10 }, "aggs" : { "costars" : { "terms" : { "field" : "actors", "size" : 5 } } } } } } -------------------------------------------------- // CONSOLE Even though the number of actors may be comparatively small and we want only 50 result buckets there is a combinatorial explosion of buckets during calculation - a single actor can produce n² buckets where n is the number of actors. The sane option would be to first determine the 10 most popular actors and only then examine the top co-stars for these 10 actors. This alternative strategy is what we call the `breadth\_first` collection mode as opposed to the `depth\_first` mode. NOTE: The `breadth\_first` is the default mode for fields with a cardinality bigger than the requested size or when the cardinality is unknown (numeric fields or scripts for instance). It is possible to override the default heuristic and to provide a collect mode directly in the request: [source,js] -------------------------------------------------- GET /\_search { "aggs" : { "actors" : { "terms" : { "field" : "actors", "size" : 10, "collect\_mode" : "breadth\_first" <1> }, "aggs" : { "costars" : { "terms" : { "field" : "actors", "size" : 5 } } } } } } -------------------------------------------------- // CONSOLE <1> the possible values are `breadth\_first` and `depth\_first` When using `breadth\_first` mode the set of documents that fall into the uppermost buckets are cached for subsequent replay so there is a memory overhead in doing this which is linear with the number of matching documents. Note that the `order` parameter can still be used to refer to data from a child aggregation when using the `breadth\_first` setting - the parent aggregation understands that this child aggregation will need to be called first before any of the other child aggregations. WARNING: Nested aggregations such as `top\_hits` which require access to score information under an aggregation that uses the `breadth\_first` collection mode need to replay the query on the second pass but only for the documents belonging to the top buckets. [[search-aggregations-bucket-terms-aggregation-execution-hint]] ==== Execution hint There are different mechanisms by which terms aggregations can be executed: - by using field values directly in order to aggregate data per-bucket (`map`) - by using global ordinals of
|
https://github.com/elastic/elasticsearch/blob/6.2//docs/reference/aggregations/bucket/terms-aggregation.asciidoc
|
6.2
|
elasticsearch-6-2
|
[
0.002407190389931202,
-0.020937621593475342,
-0.012668263167142868,
-0.01810166984796524,
0.0013208806049078703,
0.010057542473077774,
-0.02341487817466259,
-0.015932206064462662,
0.07041424512863159,
0.0019197120564058423,
0.006100850645452738,
-0.02194221504032612,
0.04929293692111969,
0.03830844908952713,
0.02398931048810482,
0.08449822664260864,
-0.03537953272461891,
0.14091075956821442,
-0.08610545843839645,
-0.05571802705526352,
0.026369130238890648,
-0.0013273281510919333,
-0.02268369123339653,
0.005324989091604948,
0.0002045363944489509,
-0.0013886961387470365,
-0.07211721688508987,
0.07259922474622726,
-0.01672007516026497,
-0.007566923275589943,
-0.015168019570410252,
0.03382817283272743,
0.007907814346253872,
0.07384786009788513,
-0.08871877193450928,
0.007977145723998547,
-0.03628336638212204,
0.05510304868221283,
0.0050726160407066345,
0.000022276813979260623,
-0.027207303792238235,
-0.0011281901970505714,
0.02035927027463913,
-0.02483714558184147,
0.005292380228638649,
-0.007928753271698952,
-0.01475558988749981,
-0.026764683425426483,
0.036501411348581314,
0.012180146761238575,
-0.022811701521277428,
0.07905235141515732,
-0.016440825536847115,
0.11739885807037354,
0.04922512546181679,
0.0686127245426178,
-0.10146720707416534,
-0.11821942776441574,
-0.12927664816379547,
-0.04116331785917282,
-0.11914950609207153,
-0.04971599578857422,
-0.0075555117800831795,
-0.04346407204866409,
0.024143794551491737,
0.015546612441539764,
0.06377959996461868,
0.021952299401164055,
0.025209523737430573,
0.08352194726467133,
0.07853490114212036,
0.0035610634367913008,
0.012759683653712273,
-0.05128803476691246,
0.009006716310977936,
0.14814215898513794,
-0.033931609243154526,
-0.044163722544908524,
0.018791837617754936,
-0.028925547376275063,
-0.04661381617188454,
0.05613527074456215,
-0.019233712926506996,
-0.07493007928133011,
-0.009725894778966904,
-0.12408126890659332,
0.001341370865702629,
-0.05373777821660042,
0.057528238743543625,
0.024275824427604675,
-0.013981403782963753,
-0.06508419662714005,
0.1392119824886322,
-0.014094366692006588,
0.05996955558657646,
-0.045304395258426666,
0.008020922541618347,
-0.062693290412426,
0.08993133902549744,
-0.028531672433018684,
0.020155996084213257,
0.03725263476371765,
0.016863834112882614,
-0.11266083270311356,
-0.07836144417524338,
-0.039391692727804184,
-0.03179965913295746,
-0.0030991588719189167,
-0.004417833406478167,
0.012717127799987793,
-0.015033247880637646,
-0.04470650479197502,
0.01830930821597576,
0.01710171066224575,
-0.07239409536123276,
0.08375320583581924,
0.027971439063549042,
-0.033273592591285706,
0.10675108432769775,
0.014314433559775352,
0.019346099346876144,
-0.010158531367778778,
0.02861066162586212,
0.05238208919763565,
0.038452960550785065,
-0.027660753577947617,
0.017956549301743507,
5.016542630305071e-33,
0.00032757280860096216,
0.022918464615941048,
0.04905002936720848,
-0.024799475446343422,
-0.07168274372816086,
0.10676822811365128,
-0.011680507101118565,
0.09533479809761047,
-0.08836500346660614,
0.0511666014790535,
0.0027555611450225115,
0.12568463385105133,
-0.021899042651057243,
-0.04141471907496452,
0.07691982388496399,
-0.09502330422401428,
0.06126612052321434,
0.01356773916631937,
0.002243235008791089,
0.035239920020103455,
0.0661817267537117,
-0.04098513349890709,
0.005361767020076513,
0.03520987555384636,
0.09639790654182434,
-0.055799201130867004,
-0.01865648292005062,
0.026622425764799118,
-0.046485524624586105,
-0.005321072414517403,
0.010475757531821728,
-0.004217483568936586,
-0.02127908170223236,
-0.04237329214811325,
0.0613398514688015,
0.003013652516528964,
0.014385578222572803,
0.026016658172011375,
0.044670917093753815,
-0.01520139817148447,
-0.029453931376338005,
0.003045154269784689,
0.0352645106613636,
-0.04638068377971649,
-0.03210694342851639,
-0.03181548789143562,
-0.04374396428465843,
0.058961573988199234,
-0.034957464784383774,
0.008617114275693893,
0.05277352035045624,
-0.049440737813711166,
0.002366261789575219,
0.010875355452299118,
0.09038255363702774,
0.07194840908050537,
-0.06673978269100189,
0.015667393803596497,
-0.06210917606949806,
-0.0023007416166365147,
-0.06873112171888351,
-0.026002170518040657,
-0.023816287517547607,
0.02906814031302929,
0.012125971727073193,
0.003096012631431222,
0.007771622389554977,
0.11218102276325226,
0.03971174359321594,
0.04437033087015152,
0.06946061551570892,
0.03456462547183037,
-0.1081494688987732,
-0.05342467874288559,
0.03184961900115013,
-0.01722133904695511,
0.13380683958530426,
-0.05196632444858551,
-0.057598840445280075,
-0.020566051825881004,
-0.1503363400697708,
0.11510545760393143,
0.03584279119968414,
0.024651074782013893,
-0.022814616560935974,
0.03453879803419113,
0.02217140793800354,
0.017289258539676666,
-0.05171336606144905,
-0.06716208159923553,
-0.07888010144233704,
0.053074948489665985,
-0.038020990788936615,
-0.04196459800004959,
0.012217987328767776,
-6.379753143378108e-33,
-0.005364062264561653,
-0.13432706892490387,
0.08858317881822586,
-0.00969731155782938,
0.05944375693798065,
-0.05484986677765846,
0.0015051625669002533,
-0.031867798417806625,
-0.015112696215510368,
0.003247144864872098,
-0.09363698959350586,
0.010607256554067135,
0.006024820264428854,
-0.07758137583732605,
0.0838167816400528,
0.03365480527281761,
-0.056577783077955246,
0.0030380776152014732,
0.05012980476021767,
0.09366761147975922,
-0.04336663335561752,
0.04107096791267395,
0.002944349544122815,
0.09004876762628555,
0.016740918159484863,
-0.03513515740633011,
-0.04067591577768326,
-0.01117359846830368,
-0.053092408925294876,
0.026377474889159203,
0.018129931762814522,
-0.08277096599340439,
0.04273245856165886,
-0.06707780063152313,
-0.035301145166158676,
-0.012828231789171696,
0.05863716080784798,
-0.08904911577701569,
-0.061097655445337296,
0.040913715958595276,
-0.054960254579782486,
0.0511670745909214,
0.004551778081804514,
-0.024657584726810455,
0.058664146810770035,
-0.024371124804019928,
-0.011220932938158512,
0.025236064568161964,
-0.010048165917396545,
0.044652070850133896,
-0.05253375321626663,
-0.004264461807906628,
-0.0719897523522377,
0.018593037500977516,
-0.03950226679444313,
-0.05967843905091286,
-0.002537929220125079,
-0.0538184754550457,
-0.06842238456010818,
-0.13521087169647217,
0.05236328765749931,
-0.0062682414427399635,
0.001009069848805666,
0.02432340569794178,
0.034760091453790665,
0.006545104086399078,
0.012458479031920433,
-0.05399071052670479,
-0.06546981632709503,
-0.026166750118136406,
-0.02721530571579933,
-0.008120843209326267,
-0.02421894669532776,
0.06824912875890732,
-0.03764469549059868,
0.028141431510448456,
0.031161200255155563,
0.0009969458915293217,
-0.024827465415000916,
-0.013508220203220844,
0.02089652791619301,
0.008169262669980526,
0.04642762988805771,
0.05330217257142067,
-0.10431241989135742,
0.007883264683187008,
0.09649484604597092,
0.09857241064310074,
0.021079475060105324,
-0.010752509348094463,
-0.012092079035937786,
0.009917830117046833,
0.017721278592944145,
0.003196253441274166,
0.04043080285191536,
-5.646734635433859e-8,
-0.04211070388555527,
0.023754367604851723,
-0.03899608552455902,
0.002703398931771517,
-0.04834708571434021,
-0.07331544905900955,
-0.0257481187582016,
0.0641336664557457,
0.01769707351922989,
-0.04675422981381416,
-0.023122135549783707,
0.04837443679571152,
-0.04977933317422867,
-0.05568191036581993,
0.07031512260437012,
0.018871387466788292,
0.024059420451521873,
-0.05080815404653549,
-0.014699782244861126,
-0.002647144254297018,
0.026815390214323997,
0.061264075338840485,
-0.03442369028925896,
0.029875848442316055,
-0.02077082358300686,
-0.025942405685782433,
0.041333477944135666,
-0.020803501829504967,
0.07518532127141953,
-0.02025526948273182,
0.05071163550019264,
-0.041753772646188736,
-0.011585052125155926,
0.04149335250258446,
0.046525657176971436,
-0.056623537093400955,
-0.0007604520069435239,
-0.001573176821693778,
-0.05193547531962395,
0.0059833889827132225,
0.054403189569711685,
-0.011157329194247723,
-0.025958657264709473,
-0.008752639405429363,
0.012942698784172535,
-0.06227659434080124,
-0.05263365060091019,
0.025610623881220818,
0.12390292435884476,
0.007699539419263601,
-0.06171984225511551,
0.024480538442730904,
-0.0452500656247139,
-0.007949084043502808,
0.004423640668392181,
-0.013258786872029305,
0.021777959540486336,
-0.009346629492938519,
0.0429585762321949,
-0.04211467504501343,
0.021539069712162018,
-0.13968884944915771,
-0.050055161118507385,
0.024470919743180275
] | 0.014624
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.