{"id":227131,"date":"2014-06-23T12:23:03","date_gmt":"2014-06-23T08:23:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=227131"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=227131","title":{"rendered":"<span class=\"post_title\">ElasticSearch \u2014 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" align=\"right\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e01\/a8b\/9ed\/e01a8b9edefdd6726b508c06e598d028.jpg\"\/><br \/>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445, \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f, \u0438 \u0441\u0434\u043e\u0431\u0440\u0438\u043c \u044d\u0442\u043e \u043a\u0443\u0447\u0435\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>  \u0414\u043b\u044f \u0432\u0441\u0435\u0445, \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 ES \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u043e\u0438\u0441\u043a \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  <i>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 <a href=\"http:\/\/habrahabr.ru\/company\/smartprogress\/blog\/226749\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u043f\u043e\u0440\u043e\u0432\u043d\u0443 \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0430\u0442\u044c\u0451\u0439 \u043f\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u0438 \u043f\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0442\u0435\u043c\u0443, \u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0432\u0435\u0436\u0443\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0432 ES \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u043e(v1.0) \u0438 \u043d\u0435\u0441\u0451\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b.<\/i><\/p>\n<h4>Aggregation module<\/h4>\n<p>  \u042d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0438\u0448\u0435\u043b \u0432 ES \u043d\u0430 \u0441\u043c\u0435\u043d\u0443 Facets, \u043f\u0440\u0438\u0447\u0435\u043c \u0432 \u043d\u0430\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u0444\u043e\u0440\u043c\u0435, Facets \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c\u0438 \u0438 \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u0440\u0435\u043b\u0438\u0437\u044b. \u0425\u043e\u0442\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u044b \u0438 \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 v1.0.0RC1, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0443\u0436\u0435 &gt;1.2, \u044f \u0432\u0441\u0435 \u0436\u0435 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Facets.<br \/>  \u0417\u0430\u0447\u0435\u043c \u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442?<br \/>  \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0444\u0438\u0448\u043a\u043e\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0445 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043e\u0431\u0449\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430:  <\/p>\n<pre><code class=\"javascript\">&quot;aggregations&quot; : {     &quot;&lt;aggregation_name&gt;&quot; : {         &quot;&lt;aggregation_type&gt;&quot; : {             &lt;aggregation_body&gt;         }         [,&quot;aggregations&quot; : { [&lt;sub_aggregation&gt;]+ } ]?     }     [,&quot;&lt;aggregation_name_2&gt;&quot; : { ... } ]* } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043a\u043e\u043b\u044c \u0443\u0433\u043e\u0434\u043d\u043e \u043c\u043d\u043e\u0433\u043e, \u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0431\u0435\u0437 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043f\u043e \u0433\u043b\u0443\u0431\u0438\u043d\u0435.<br \/>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438).<\/p>\n<h5>\u0422\u0438\u043f\u044b \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432<\/h5>\n<p>  \u0422\u0438\u043f\u043e\u0432 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432 <a href=\"http:\/\/www.elasticsearch.org\/guide\/en\/elasticsearch\/reference\/current\/search-aggregations-metrics-min-aggregation.html\">\u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e<\/a>, \u043d\u043e \u0432\u0441\u0435 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0432 2 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u0430:<\/p>\n<p>  <b> \u2014 Bucketing (\u041e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u0435)<\/b><br \/>  \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441\u043e \u0432\u0441\u0435\u043c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u00abGROUP BY\u00bb. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, \u043d\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0445\u043e\u0436. \u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u043e\u0431\u043e\u0431\u0449\u0430\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u043f\u043e \u043a\u0430\u043a\u043e\u043c\u0443-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0443, \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u0442\u043e <a href=\"http:\/\/www.elasticsearch.org\/guide\/en\/elasticsearch\/reference\/current\/search-aggregations-bucket-terms-aggregation.html\">terms aggregation<\/a>.<\/p>\n<p>  <b> \u2014 Metric (\u041c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435)<\/b><br \/>  \u042d\u0442\u043e \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 \u043a\u0430\u043a\u0438\u0435 \u043b\u0438\u0431\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/www.elasticsearch.org\/guide\/en\/elasticsearch\/reference\/current\/search-aggregations-metrics-sum-aggregation.html\">sum aggregation<\/a><\/p>\n<p>  \u0414\u0443\u043c\u0430\u044e, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u043e \u0442\u0435\u043e\u0440\u0438\u0438 \u0445\u0432\u0430\u0442\u0438\u0442, \u0432\u0441\u0435\u043c, \u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e, \u043c\u043e\u0433\u0443\u0442 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441 \u043d\u0435\u0439 <a href=\"http:\/\/www.elasticsearch.org\/guide\/en\/elasticsearch\/reference\/current\/search-aggregations.html\">\u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/p>\n<h4>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/h4>\n<p>  \u0416\u0435\u043b\u0430\u044e\u0449\u0438\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0451 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0440\u0443\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0434\u0430\u043c\u043f  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0414\u0430\u043c\u043f \u043d\u0430\u0433\u043b\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u0437\u044f\u0442 \u0438\u0437 \u044d\u0442\u043e\u0439 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e\u0439 <a href=\"http:\/\/blog.qbox.io\/elasticsearch-aggregations\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>  <\/p>\n<pre><code class=\"javascript\">curl -XPUT &quot;http:\/\/localhost:9200\/sports\/&quot; -d' {    &quot;mappings&quot;: {       &quot;athlete&quot;: {          &quot;properties&quot;: {             &quot;birthdate&quot;: {                &quot;type&quot;: &quot;date&quot;,                &quot;format&quot;: &quot;dateOptionalTime&quot;             },             &quot;location&quot;: {                &quot;type&quot;: &quot;geo_point&quot;             },             &quot;name&quot;: {                &quot;type&quot;: &quot;string&quot;             },             &quot;rating&quot;: {                &quot;type&quot;: &quot;integer&quot;             },             &quot;sport&quot;: {                &quot;type&quot;: &quot;string&quot;             }          }       }    } }'  curl -XPOST &quot;http:\/\/localhost:9200\/sports\/_bulk&quot; -d' {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Michael&quot;, &quot;birthdate&quot;:&quot;1989-10-1&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;5&quot;, &quot;4&quot;],  &quot;location&quot;:&quot;46.22,-68.45&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Bob&quot;, &quot;birthdate&quot;:&quot;1989-11-2&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;3&quot;, &quot;4&quot;],  &quot;location&quot;:&quot;45.21,-68.35&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Jim&quot;, &quot;birthdate&quot;:&quot;1988-10-3&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;3&quot;, &quot;2&quot;],  &quot;location&quot;:&quot;45.16,-63.58&quot; } {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Joe&quot;, &quot;birthdate&quot;:&quot;1992-5-20&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;4&quot;, &quot;3&quot;],  &quot;location&quot;:&quot;45.22,-68.53&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Tim&quot;, &quot;birthdate&quot;:&quot;1992-2-28&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;3&quot;, &quot;3&quot;],  &quot;location&quot;:&quot;46.22,-68.85&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Alfred&quot;, &quot;birthdate&quot;:&quot;1990-9-9&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;2&quot;, &quot;2&quot;],  &quot;location&quot;:&quot;45.12,-68.35&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Jeff&quot;, &quot;birthdate&quot;:&quot;1990-4-1&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;2&quot;, &quot;3&quot;], &quot;location&quot;:&quot;46.12,-68.55&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Will&quot;, &quot;birthdate&quot;:&quot;1988-3-1&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;4&quot;, &quot;4&quot;], &quot;location&quot;:&quot;46.25,-68.55&quot; } {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Mick&quot;, &quot;birthdate&quot;:&quot;1989-10-1&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;3&quot;, &quot;4&quot;],  &quot;location&quot;:&quot;46.22,-68.45&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Pong&quot;, &quot;birthdate&quot;:&quot;1989-11-2&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;1&quot;, &quot;3&quot;],  &quot;location&quot;:&quot;45.21,-68.35&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Ray&quot;, &quot;birthdate&quot;:&quot;1988-10-3&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;2&quot;, &quot;2&quot;],  &quot;location&quot;:&quot;45.16,-63.58&quot; } {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Ping&quot;, &quot;birthdate&quot;:&quot;1992-5-20&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;4&quot;, &quot;3&quot;],  &quot;location&quot;:&quot;45.22,-68.53&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Duke&quot;, &quot;birthdate&quot;:&quot;1992-2-28&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;5&quot;, &quot;2&quot;],  &quot;location&quot;:&quot;46.22,-68.85&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Hal&quot;, &quot;birthdate&quot;:&quot;1990-9-9&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;4&quot;, &quot;2&quot;],  &quot;location&quot;:&quot;45.12,-68.35&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Charge&quot;, &quot;birthdate&quot;:&quot;1990-4-1&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;3&quot;, &quot;2&quot;], &quot;location&quot;:&quot;46.12,-68.55&quot;} {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Barry&quot;, &quot;birthdate&quot;:&quot;1988-3-1&quot;, &quot;sport&quot;:&quot;Baseball&quot;, &quot;rating&quot;: [&quot;5&quot;, &quot;2&quot;], &quot;location&quot;:&quot;46.25,-68.55&quot; } {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Bank&quot;, &quot;birthdate&quot;:&quot;1988-3-1&quot;, &quot;sport&quot;:&quot;Golf&quot;, &quot;rating&quot;: [&quot;6&quot;, &quot;4&quot;], &quot;location&quot;:&quot;46.25,-68.55&quot; } {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Bingo&quot;, &quot;birthdate&quot;:&quot;1988-3-1&quot;, &quot;sport&quot;:&quot;Golf&quot;, &quot;rating&quot;: [&quot;10&quot;, &quot;7&quot;], &quot;location&quot;:&quot;46.25,-68.55&quot; } {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;James&quot;, &quot;birthdate&quot;:&quot;1988-3-1&quot;, &quot;sport&quot;:&quot;Basketball&quot;, &quot;rating&quot;: [&quot;10&quot;, &quot;8&quot;], &quot;location&quot;:&quot;46.25,-68.55&quot; } {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Wayne&quot;, &quot;birthdate&quot;:&quot;1988-3-1&quot;, &quot;sport&quot;:&quot;Hockey&quot;, &quot;rating&quot;: [&quot;10&quot;, &quot;10&quot;], &quot;location&quot;:&quot;46.25,-68.55&quot; } {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Brady&quot;, &quot;birthdate&quot;:&quot;1988-3-1&quot;, &quot;sport&quot;:&quot;Football&quot;, &quot;rating&quot;: [&quot;10&quot;, &quot;10&quot;], &quot;location&quot;:&quot;46.25,-68.55&quot; } {&quot;index&quot;:{&quot;_index&quot;:&quot;sports&quot;,&quot;_type&quot;:&quot;athlete&quot;}} {&quot;name&quot;:&quot;Lewis&quot;, &quot;birthdate&quot;:&quot;1988-3-1&quot;, &quot;sport&quot;:&quot;Football&quot;, &quot;rating&quot;: [&quot;10&quot;, &quot;10&quot;], &quot;location&quot;:&quot;46.25,-68.55&quot; }' <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u043e\u0440\u0442\u0441\u043c\u0435\u043d\u043e\u0432 \u043f\u043e \u0438\u0445 \u0432\u0438\u0434\u0443 \u0441\u043f\u043e\u0440\u0442\u0430 \u0438 \u0443\u0437\u043d\u0430\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0445 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043f\u043e\u0440\u0442\u0435:  <\/p>\n<pre><code class=\"bash\">curl -XPOST &quot;http:\/\/localhost:9200\/sports\/athlete\/_search?pretty&quot; -d' {    &quot;size&quot;: 0,     &quot;aggregations&quot;: {       &quot;the_name&quot;: {          &quot;terms&quot;: {             &quot;field&quot;: &quot;sport&quot;          }       }    } }' <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u0433\u0440\u0435\u0433\u0430\u0442 \u00abterms\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u043e \u043f\u043e\u043b\u044e \u00absport\u00bb.<br \/>  <code>&quot;size&quot; : 0<\/code> (0 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 Integer.MAX_VALUE \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438) \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0432\u0441\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0431\u0435\u0437 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0432\u0430\u0436\u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u043d\u043e \u043d\u0430\u0434\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<p>  \u041e\u0442\u0432\u0435\u0442:  <\/p>\n<pre><code class=\"bash\">{   ...   &quot;aggregations&quot; : {     &quot;the_name&quot; : {       &quot;buckets&quot; : [ {         &quot;key&quot; : &quot;baseball&quot;,         &quot;doc_count&quot; : 16       }, {         &quot;key&quot; : &quot;golf&quot;,         &quot;doc_count&quot; : 2       }, {         &quot;key&quot; : &quot;basketball&quot;,         &quot;doc_count&quot; : 1       }, {         &quot;key&quot; : &quot;football&quot;,         &quot;doc_count&quot; : 1       }, {         &quot;key&quot; : &quot;hockey&quot;,         &quot;doc_count&quot; : 1       } ]     }   } } <\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0431\u0435\u0439\u0441\u0431\u043e\u043b\u0438\u0441\u0442\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e.<br \/>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043f\u043e\u0440\u0442\u0441\u043c\u0435\u043d\u043e\u0432 \u043f\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0438\u0445 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430, \u043e\u0442 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u043a \u043c\u0435\u043d\u044c\u0448\u0435\u043c\u0443:  <\/p>\n<pre><code class=\"bash\">curl -XPOST &quot;http:\/\/localhost:9200\/sports\/athlete\/_search?pretty&quot; -d' {    &quot;size&quot;: 0,     &quot;aggregations&quot;: {       &quot;the_name&quot;: {          &quot;terms&quot;: {             &quot;field&quot;: &quot;name&quot;,             &quot;order&quot;: {                &quot;rating_avg&quot;: &quot;desc&quot;             }          },          &quot;aggregations&quot;: {             &quot;rating_avg&quot;: {                &quot;avg&quot;: {                   &quot;field&quot;: &quot;rating&quot;                }             }          }       }    } }' <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0442 \u0438 \u043a\u0430\u043a \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043d\u0430\u043c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0433\u0438\u0431\u043a\u043e.<br \/>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u043e\u0440\u0442\u0441\u043c\u0435\u043d\u043e\u0432 \u043f\u043e \u0438\u043c\u0435\u043d\u0438, \u043f\u043e\u0442\u043e\u043c \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u00abrating_avg\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0434 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u0435 \u00abavg\u00bb, \u043f\u043e \u043f\u043e\u043b\u044e \u00abrating\u00bb. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u043a\u0430\u043a \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e ES \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438 (<code>&quot;rating&quot; : [10, 9]<\/code>) \u0438 \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041e\u0442\u0432\u0435\u0442:  <\/p>\n<pre><code class=\"bash\">{   ...   &quot;aggregations&quot; : {     &quot;the_name&quot; : {       &quot;buckets&quot; : [ {         &quot;key&quot; : &quot;brady&quot;,         &quot;doc_count&quot; : 1,         &quot;rating_avg&quot; : {           &quot;value&quot; : 10.0         }       }, {         &quot;key&quot; : &quot;wayne&quot;,         &quot;doc_count&quot; : 1,         &quot;rating_avg&quot; : {           &quot;value&quot; : 10.0         }       }, {         &quot;key&quot; : &quot;james&quot;,         &quot;doc_count&quot; : 1,         &quot;rating_avg&quot; : {           &quot;value&quot; : 9.0         }       }, {         &quot;key&quot; : &quot;bingo&quot;,         &quot;doc_count&quot; : 1,         &quot;rating_avg&quot; : {           &quot;value&quot; : 8.5         }       },       ... {} ...       {         &quot;key&quot; : &quot;duke&quot;,         &quot;doc_count&quot; : 1,         &quot;rating_avg&quot; : {           &quot;value&quot; : 3.5         }       }, {         &quot;key&quot; : &quot;bob&quot;,         &quot;doc_count&quot; : 1,         &quot;rating_avg&quot; : {           &quot;value&quot; : 3.5         }       } ]     }   } } <\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>&quot;script&quot;<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"bash\">curl -XPOST &quot;http:\/\/localhost:9200\/sports\/athlete\/_search?pretty&quot; -d' {    &quot;size&quot;: 0,    &quot;aggregations&quot;: {       &quot;age_ranges&quot;: {          &quot;range&quot;: {             &quot;script&quot;: &quot;DateTime.now().year - doc[\\&quot;birthdate\\&quot;].date.year&quot;,             &quot;ranges&quot;: [                {                   &quot;from&quot;: 22,                   &quot;to&quot;: 25                }             ]          }       }    } }' <\/code><\/pre>\n<p>  <b>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 1.2.0 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e.<\/b> \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"http:\/\/www.elasticsearch.org\/guide\/en\/elasticsearch\/reference\/current\/modules-scripting.html\">\u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c<\/a>, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0447\u0442\u043e \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0435\u0442 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a ES (\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a, \u0438\u043d\u0430\u0447\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0432\u0430\u043c \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u044d\u0442\u043e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0440\u0430\u0434\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445).<\/p>\n<h4>\u0410\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f \u0432\u043e \u0432\u0441\u0435\u0439 \u043a\u0440\u0430\u0441\u0435 \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435<\/h4>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0439\u0434\u0451\u043c \u0432\u0441\u0435\u0445 \u0441\u043f\u043e\u0440\u0442\u0441\u043c\u0435\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0440\u0430\u0434\u0438\u0443\u0441\u0435 20 \u043c\u0438\u043b\u044c \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 <code>&quot;46.12,-68.55&quot;<\/code><br \/>  \u0421\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u043f\u043e \u0432\u0438\u0434\u0443 \u0441\u043f\u043e\u0440\u0442\u0430 \u0438 \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0443 \u0441\u043f\u043e\u0440\u0442\u0441\u043c\u0435\u043d\u043e\u0432 \u0432 \u044d\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u0441\u043f\u043e\u0440\u0442\u0430.<br \/>  \u0417\u0432\u0443\u0447\u0438\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u0430 \u0432\u043e\u0442 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440.  <\/p>\n<pre><code class=\"bash\">curl -XPOST &quot;http:\/\/localhost:9200\/sports\/athlete\/_search?pretty&quot; -d' {    &quot;size&quot;: 0,    &quot;aggregations&quot;: {       &quot;baseball_player_ring&quot;: {          &quot;geo_distance&quot;: {             &quot;field&quot;: &quot;location&quot;,             &quot;origin&quot;: &quot;46.12,-68.55&quot;,             &quot;unit&quot;: &quot;mi&quot;,             &quot;ranges&quot;: [                {                   &quot;from&quot;: 0,                   &quot;to&quot;: 20                }             ]          },          &quot;aggregations&quot;: {             &quot;sport&quot;: {          \t\t&quot;terms&quot;: {               \t\t   &quot;field&quot;: &quot;sport&quot;          \t\t},               \t        &quot;aggregations&quot;: {                            &quot;rating_stats&quot;: {                                &quot;stats&quot;: {                                    &quot;field&quot;: &quot;rating&quot;                                }                             }                        }                     }       \t\t}          }       }    } }' <\/code><\/pre>\n<p>  \u041e\u0442\u0432\u0435\u0442:  <\/p>\n<pre><code class=\"bash\">{   ...   &quot;aggregations&quot; : {     &quot;baseball_player_ring&quot; : {       &quot;buckets&quot; : [ {         &quot;key&quot; : &quot;*-20.0&quot;,         &quot;from&quot; : 0.0,         &quot;to&quot; : 20.0,         &quot;doc_count&quot; : 13,         &quot;sport&quot; : {           &quot;buckets&quot; : [ {             &quot;key&quot; : &quot;baseball&quot;,             &quot;doc_count&quot; : 8,             &quot;rating_stats&quot; : {               &quot;count&quot; : 14,               &quot;min&quot; : 2.0,               &quot;max&quot; : 5.0,               &quot;avg&quot; : 3.357142857142857,               &quot;sum&quot; : 47.0             }           }, {             &quot;key&quot; : &quot;golf&quot;,             &quot;doc_count&quot; : 2,             &quot;rating_stats&quot; : {               &quot;count&quot; : 4,               &quot;min&quot; : 4.0,               &quot;max&quot; : 10.0,               &quot;avg&quot; : 6.75,               &quot;sum&quot; : 27.0             }           }, {             &quot;key&quot; : &quot;basketball&quot;,             &quot;doc_count&quot; : 1,             &quot;rating_stats&quot; : {               &quot;count&quot; : 2,               &quot;min&quot; : 8.0,               &quot;max&quot; : 10.0,               &quot;avg&quot; : 9.0,               &quot;sum&quot; : 18.0             }           }, {             &quot;key&quot; : &quot;football&quot;,             &quot;doc_count&quot; : 1,             &quot;rating_stats&quot; : {               &quot;count&quot; : 1,               &quot;min&quot; : 10.0,               &quot;max&quot; : 10.0,               &quot;avg&quot; : 10.0,               &quot;sum&quot; : 10.0             }           }, {             &quot;key&quot; : &quot;hockey&quot;,             &quot;doc_count&quot; : 1,             &quot;rating_stats&quot; : {               &quot;count&quot; : 1,               &quot;min&quot; : 10.0,               &quot;max&quot; : 10.0,               &quot;avg&quot; : 10.0,               &quot;sum&quot; : 10.0             }           } ]         }       } ]     }   } } <\/code><\/pre>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044f \u0441\u043c\u043e\u0433 \u0434\u043e\u043d\u0435\u0441\u0442\u0438 \u043e\u0431\u0449\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u0412\u0441\u0435\u043c, \u043a\u043e\u0433\u043e \u044d\u0442\u043e \u0442\u0435\u043c\u0430 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430, \u044f \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0432\u0441\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u043f\u043e <a href=\"http:\/\/www.elasticsearch.org\/guide\/en\/elasticsearch\/reference\/current\/search-aggregations.html\">\u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<br \/>  \u0420\u0430\u0434 \u043b\u044e\u0431\u044b\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f\u043c \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u043c \u043f\u043e \u0442\u0435\u043c\u0435.<\/p>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043c\u043e\u044e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e ES \u2014 <a href=\"http:\/\/habrahabr.ru\/company\/smartprogress\/blog\/226749\/\">ElasticSearch \u0438 \u043f\u043e\u0438\u0441\u043a \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. Percolate API<\/a><br \/>  \u0418 \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043d\u0438\u0437\u0443 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  <a href=\"https:\/\/smartprogress.do\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/52b\/7d4\/88b\/52b7d488b26969ab5e60319395742893.jpg\" \/><\/div>\n<p><\/a>    \t\t\t\t<\/p>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u0422\u0435\u043c\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"227131\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"11415\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv57367\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"57367\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv57367\">Mapping \u2014 \u0437\u0430\u0447\u0435\u043c \u043e\u043d \u043d\u0443\u0436\u0435\u043d \u0438 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv57369\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"57369\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv57369\">Warmer \u2014 \u043f\u043e\u0434\u043e\u0433\u0440\u0435\u0432\u0430\u0435\u043c \u0438 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u043c ES \u043f\u0435\u0440\u0435\u0434 \u0431\u043e\u0435\u043c<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv57371\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"57371\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv57371\">\u0414\u0440\u0443\u0433\u043e\u0435 (\u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445)<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"https:\/\/habrahabr.ru\/auth\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<p class=\"total\">\u041d\u0438\u043a\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<\/p><\/div>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/smartprogress\/blog\/227131\/\"> http:\/\/habrahabr.ru\/company\/smartprogress\/blog\/227131\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" align=\"right\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e01\/a8b\/9ed\/e01a8b9edefdd6726b508c06e598d028.jpg\"\/><br \/>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445, \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f, \u0438 \u0441\u0434\u043e\u0431\u0440\u0438\u043c \u044d\u0442\u043e \u043a\u0443\u0447\u0435\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>  \u0414\u043b\u044f \u0432\u0441\u0435\u0445, \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 ES \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u043e\u0438\u0441\u043a \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-227131","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/227131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=227131"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/227131\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=227131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=227131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=227131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}