{"id":370224,"date":"2024-05-21T04:20:25","date_gmt":"2024-05-21T04:20:25","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=370224"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=370224","title":{"rendered":"<span>\u041a\u0430\u043a \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u044b\u0435 \u0438 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/965\/0ae\/94b\/9650ae94b5538d5ae2f77bf935ff8b4d.jpg\" width=\"1958\" height=\"1103\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/965\/0ae\/94b\/9650ae94b5538d5ae2f77bf935ff8b4d.jpg\" data-blurred=\"true\"\/><\/figure>\n<p><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043b\u0435\u043a\u0441\u0435\u0439 \u041a\u043e\u043a\u0443\u0445\u0438\u043d, \u044f \u0431\u044d\u043a\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 <\/em><a href=\"https:\/\/friflex.com\"><em>Friflex<\/em><\/a><em>. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0430\u0439\u0442\u044b \u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u0440\u0438\u0442\u0435\u0439\u043b\u0430. \u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0432 \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u2014 \u0437\u043d\u0430\u0447\u0438\u043c\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438\u0437\u0443\u0447\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u0444\u0430\u043a\u0442\u043e\u0440\u044b \u043d\u0430 \u043d\u0435\u0435 \u0432\u043b\u0438\u044f\u044e\u0442.<\/em><\/p>\n<p><em>\u0427\u0430\u0441\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0443\u0445\u043e\u0434\u044f\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u043d\u0435 \u0441\u043c\u043e\u0433 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441. \u041f\u043e <\/em><a href=\"https:\/\/baymard.com\/blog\/ecommerce-search-query-types\"><em><u>\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435<\/u><\/em><\/a><em> Baymard Institute, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0435\u0441\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043d\u043b\u0430\u0439\u043d-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043b \u0434\u0432\u0430 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u0438\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u2014 \u0442\u043e\u0447\u043d\u044b\u0435 \u0438 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0435.<\/em><\/p>\n<h2>\u0422\u043e\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u0449\u0435\u0442, \u043e\u043d \u0432\u0432\u043e\u0434\u0438\u0442 \u0442\u043e\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s\u00bb. \u0422\u043e\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u0441\u0430\u043c\u044b\u0439 \u043b\u0435\u0433\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f. \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 <strong>\u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u043e\u0438\u0441\u043a<\/strong>.\u00a0<\/p>\n<p>\u041f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u043e\u0438\u0441\u043a \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 \u0441\u043b\u043e\u0432\u0430 \u0438 \u0444\u0440\u0430\u0437\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0418\u043d\u0434\u0435\u043a\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u0433\u0434\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u044d\u0442\u0438 \u0441\u043b\u043e\u0432\u0430 \u0438 \u0444\u0440\u0430\u0437\u044b, \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432\u0435\u0441 \u0438\u043b\u0438 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0438\u0448\u0435\u0442 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s\u00bb, \u043f\u043e\u0438\u0441\u043a \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u00ab\u0447\u0438\u043f\u0441\u044b\u00bb \u0438 \u00abLay\u2019s\u00bb, \u0438\u0449\u0435\u0442 \u044d\u0442\u0438 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u0433\u0434\u0435 \u043e\u043d\u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443 \u0442\u043e\u0432\u0430\u0440\u0430 \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s \u0441\u043c\u0435\u0442\u0430\u043d\u0430 \u0438 \u0437\u0435\u043b\u0435\u043d\u044c\u00bb, \u043d\u043e\u0432\u043e\u0441\u0442\u044c \u00ab\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0447\u0438\u043f\u0441\u044b Lay\u2019s \u0441\u043e \u0432\u043a\u0443\u0441\u043e\u043c \u043c\u0430\u043b\u043e\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043e\u0433\u0443\u0440\u0447\u0438\u043a\u043e\u0432\u00bb \u0438 \u0441\u0442\u0430\u0442\u044c\u044e \u00ab5 \u0440\u0435\u0446\u0435\u043f\u0442\u043e\u0432 \u0441 \u0447\u0438\u043f\u0441\u0430\u043c\u0438 Lays\u00bb.\u00a0<\/p>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u043d\u0436\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0430\u043c\u044b\u0435 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435. \u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430 \u0442\u043e\u0432\u0430\u0440\u0430 \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s \u0441\u043c\u0435\u0442\u0430\u043d\u0430 \u0438 \u0437\u0435\u043b\u0435\u043d\u044c\u00bb: \u0432 \u043d\u0435\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u043b\u043e\u0432 \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0438 \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430.\u00a0<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u041c\u044b \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <strong>Elasticsearch \u0438 Diginetica<\/strong>. <a href=\"https:\/\/anyquery.diginetica.com\/?utm_medium=cpc&amp;utm_source=eLama-yandex&amp;utm_campaign=%D0%91%D1%80%D0%B5%D0%BD%D0%B4%D1%8B\/%D0%92%D1%81%D0%B5\/%D0%9F%D0%BE%D0%B8%D1%81%D0%BA\/%D0%A0%D0%A4+%D0%9A%D0%97+%D0%A0%D0%91&amp;utm_content=cid%7C54954785%7Cgid%7C4993896746%7Caid%7C12550460183%7Cadp%7Cno%7Cdvc%7Cmobile%7Cpid%7C40488828556%7Crid%7C40488828556%7Cdid%7C40488828556%7Cpos%7Cpremium1%7Cadn%7Csearch%7Ccrid%7C0%7C&amp;utm_term=diginetica&amp;utm_banner=12550460183&amp;utm_phrase=40488828556&amp;type=search&amp;roistat=direct2_search_12550460183_diginetica&amp;roistat_referrer=none&amp;roistat_pos=premium_1&amp;etext=&amp;yclid=7160220207680847871\"><u>Diginetica<\/u><\/a> \u2014 \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430\u0445. \u041e\u043d \u0441\u0430\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. Elasticsearch \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441 \u043d\u0438\u043c.\u00a0<\/p>\n<h3>\u041f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u043e\u0438\u0441\u043a\u00a0<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b, \u043a\u0430\u043a \u0438 \u044f, \u043f\u0438\u0448\u0435\u0442\u0435 \u043d\u0430 Ruby, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 <code>Elasticsearch<\/code>, \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>Elasticsearch gem<\/code>.\u00a0<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442 Elasticsearch, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a <code>Elasticsearch<\/code> \u043d\u0430 <code>localhost:9200<\/code>:  <\/p>\n<pre><code class=\"ruby\">require 'elasticsearch'  client = Elasticsearch::Client.new(url: 'http:\/\/localhost:9200')<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>products<\/code>:<\/p>\n<pre><code class=\"ruby\">client.indices.create(index: 'products')<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0432 \u0438\u043d\u0434\u0435\u043a\u0441 <code>products<\/code> \u0441 ID 1:\u00a0<\/p>\n<pre><code class=\"ruby\">client.index(index: 'products', id: 1, body: {   name: '\u0427\u0438\u043f\u0441\u044b Lay\u2019s',   description: '\u0412\u043a\u0443\u0441\u043d\u044b\u0435 \u0438 \u0445\u0440\u0443\u0441\u0442\u044f\u0449\u0438\u0435 \u0447\u0438\u043f\u0441\u044b \u0441\u043e \u0432\u043a\u0443\u0441\u043e\u043c \u0441\u043c\u0435\u0442\u0430\u043d\u044b \u0438 \u0437\u0435\u043b\u0435\u043d\u0438.' })<\/code><\/pre>\n<p>\u0418 \u0438\u0449\u0435\u043c \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u0433\u0434\u0435 \u043f\u043e\u043b\u0435 name \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0435\u043a\u0441\u0442 \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s\u00bb:\u00a0<\/p>\n<pre><code class=\"ruby\">response = client.search(index: 'products',                           body: {                            query: {                              match: {                                name: '\u0447\u0438\u043f\u0441\u044b Lay\u2019s'                              }                            }                          } ) <\/code><\/pre>\n<p>\u0438\u043b\u0438<\/p>\n<pre><code class=\"ruby\">response = client.search(q: '\u0447\u0438\u043f\u0441\u044b Lay\u2019s')<\/code><\/pre>\n<p>\u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430, \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0438\u043c\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"ruby\">results = response['hits']['hits'] results.each do |result|   puts result['_source']['name'] end <\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043f\u043e\u0438\u0441\u043a\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>AND, OR<\/code> \u0438 <code>NOT<\/code>. \u0427\u0442\u043e\u0431\u044b \u0441\u0443\u0437\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b.   <\/p>\n<h2>\u0417\u0430\u043f\u0440\u043e\u0441 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438\u043b\u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u043e\u0439<\/h2>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438\u043b\u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u043e\u0439 \u2014\u00a0\u0442\u043e\u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u043e\u0434\u0438\u0442 \u0442\u0438\u043f \u0442\u043e\u0432\u0430\u0440\u0430, \u0435\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438\u043b\u0438 \u0431\u0440\u0435\u043d\u0434, \u043d\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u0447\u0438\u043f\u0441\u044b Lays\u00bb, \u00ab\u0447\u0438\u0441\u043f\u044b Lay\u2019s\u00bb \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u00abxbgcs Lay\u2019s\u00bb. Baymard Institute \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e 42% \u043e\u043d\u043b\u0430\u0439\u043d-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u044e\u0442. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442, \u0440\u0438\u0441\u043a\u0443\u044e\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0443\u043c\u0430\u044e\u0442, \u0447\u0442\u043e \u0442\u043e\u0432\u0430\u0440 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0441\u044f.\u00a0<\/p>\n<p>\u041d\u0430\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0418\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u0441\u0430\u043c\u044b\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430\u043c\u0438. \u0418\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0438\u0441\u043a.\u00a0<\/p>\n<h3>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u0430\u0432\u0442\u043e\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0412 <code>Elasticsearch<\/code> \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>Elasticsearch Suggester<\/code>. \u041e\u043d\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043f\u0438\u0448\u0443\u0442 \u0438\u0445 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u044e. <code>Suggester<\/code> \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 <code>Elasticsearch<\/code>.\u00a0<\/p>\n<p>\u041d\u043e \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u0430\u0432\u0442\u043e\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>Hunspell<\/code> \u0438\u043b\u0438 <code>Peter Norvig\u2019s Spelling Corrector<\/code>.<\/p>\n<p><a href=\"https:\/\/hunspell.github.io\/\"><u>Hunspell<\/u><\/a> \u2014 \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0415\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 <code>Elasticsearch<\/code> <a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/current\/analysis-hunspell-tokenfilter.html\"><u>\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/u><\/a>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u0442\u044c <a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/plugins\/current\/index.html\"><u>\u043f\u043b\u0430\u0433\u0438\u043d\u044b Elasticsearch<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Hunspell.\u00a0<\/p>\n<p><a href=\"https:\/\/norvig.com\/spell-correct.html\"><u>Peter Norvig&#8217;s Spelling Corrector<\/u><\/a> \u2014 \u044d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0442\u0435\u043e\u0440\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0441\u0442\u0430\u0432\u043e\u043a, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0437\u0430\u043c\u0435\u043d, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0441\u043b\u043e\u0432\u043e \u0432 \u0434\u0440\u0443\u0433\u043e\u0435. \u0427\u0442\u043e\u0431\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>Peter Norvig's Spelling Corrector<\/code> \u0441 <code>Elasticsearch<\/code>, \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/plugins\/current\/index.html\"><u>\u043f\u043b\u0430\u0433\u0438\u043d\u044b<\/u><\/a>.\u00a0<\/p>\n<h3>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a<\/h3>\n<p>\u0421\u0432\u043e\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0447\u0430\u0441\u0442\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u043f\u044b\u0442. \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0432 <code>Elasticsearch<\/code> \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ruby-\u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c Ruby-\u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044f. \u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, CSV-\u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 JSON-\u0444\u0430\u0439\u043b\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0430\u043a\u043e\u0439 JSON-\u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"ruby\">\"{\\\"words\\\":[{\\\"word\\\":\\\"\u043f\u0440\u0438\u0432\u0435\u0442\\\",\\\"error\\\":\\\"\u043f\u0440\u0435\u0432\u0435\u0434\\\"},{\\\"word\\\":\\\"\u0445\u043b\u0435\u0431\\\",\\\"error\\\":\\\"\u043f\u0438\u0432\u043e\\\"},{\\\"word\\\":\\\"\u043c\u0435\u0434\u0432\u0435\u0434\u044c\\\",\\\"error\\\":\\\"\u043c\u0435\u0434\u0432\u0435\u0434\\\"}]}\" <\/code><\/pre>\n<pre><code class=\"ruby\"># \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a Elasticsearch client = Elasticsearch::Client.new(url: 'http:\/\/localhost:9200') # \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a Elasticsearch client = Elasticsearch::Client.new(url: 'http:\/\/localhost:9200')  # \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 JSON-\u0444\u0430\u0439\u043b\u0430 data = JSON.parse(File.read('data.json'))  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f dictionary = {} data['words'].each do |object|   dictionary[object['error']] = object['word'] end  # \u0418\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0432 Elasticsearch client.index(index: 'dictionary', type: 'word', body: dictionary)  # \u0421\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 puts \"\u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d!\" <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442:\u00a0<\/p>\n<pre><code class=\"ruby\">ruby script.rb<\/code><\/pre>\n<p>\u041f\u043e\u0442\u043e\u043c \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u044b.\u00a0<\/p>\n<h3>\u0424\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0438\u0441\u043a\u00a0<\/h3>\n<p>\u0423 \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>Soundex<\/code>, <code>Metaphone<\/code>, <code>Double Metaphone<\/code> \u0438 <code>NYSIIS<\/code>. \u0412\u0441\u0435 \u043e\u043d\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0441\u043b\u043e\u0432\u0430 \u0432 \u043a\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u0438\u0445 \u0437\u0432\u0443\u0447\u0430\u043d\u0438\u0438. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438.\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0438\u0441\u043a \u0432 <code>Elasticsearch<\/code>, \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0438\u043d\u0434\u0435\u043a\u0441 <code>Elasticsearch<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 <code>Elasticsearch \u00abphonetic\u00bb<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \u0432 \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"ruby\"># \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a Elasticsearch client = Elasticsearch::Client.new(url: 'http:\/\/localhost:9200') # \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441 client.indices       .create(index: 'my_index',               body: {                 mappings: {                   properties: {                     name: {                       type: 'text',                       analyzer: 'phonetic'                     }                   }                 }               }) <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0439\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u043e\u0432.   <\/p>\n<pre><code class=\"ruby\"># \u0418\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 client.index(index: 'my_index',              type: 'doc',              id: 1,              body: { name: '\u0447\u0438\u043f\u0441\u044b \u043b\u0435\u0439\u0441' }) <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0438\u0441\u043a <code>Elasticsearch<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s\u00bb \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u00ab\u0447\u0438\u043f\u0441\u044b \u043b\u0435\u0439\u0441\u00bb.\u00a0<\/p>\n<pre><code class=\"ruby\"># \u041f\u043e\u0438\u0441\u043a response = client.search(index: 'my_index',                          body: {                            query: {                              match: {                                name: {                                  query: '\u0447\u0438\u043f\u0441\u044b \u043b\u0435\u0439\u0441',                                  fuzziness: 'AUTO'                                }                              }                            }                          })   puts response['hits']['hits'][0]['_source']['name'] <\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:\u00a0<code>\u0447\u0438\u043f\u0441\u044b Lay's<\/code><\/p>\n<p><em>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0447\u043d\u044b\u0445 \u0438 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435: \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c, \u043f\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0441\u043b\u0435\u043d\u0433\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043d\u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u0430 \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c.<\/em>  <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/798743\/\"> https:\/\/habr.com\/ru\/articles\/798743\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043b\u0435\u043a\u0441\u0435\u0439 \u041a\u043e\u043a\u0443\u0445\u0438\u043d, \u044f \u0431\u044d\u043a\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 <\/em><a href=\"https:\/\/friflex.com\"><em>Friflex<\/em><\/a><em>. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0430\u0439\u0442\u044b \u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u0440\u0438\u0442\u0435\u0439\u043b\u0430. \u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0432 \u043f\u043e\u043a\u0443\u043f\u043a\u0443 \u2014 \u0437\u043d\u0430\u0447\u0438\u043c\u0430\u044f \u043c\u0435\u0442\u0440\u0438\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438\u0437\u0443\u0447\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u0444\u0430\u043a\u0442\u043e\u0440\u044b \u043d\u0430 \u043d\u0435\u0435 \u0432\u043b\u0438\u044f\u044e\u0442.<\/em><\/p>\n<p><em>\u0427\u0430\u0441\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0443\u0445\u043e\u0434\u044f\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u043d\u0435 \u0441\u043c\u043e\u0433 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441. \u041f\u043e <\/em><a href=\"https:\/\/baymard.com\/blog\/ecommerce-search-query-types\"><em><u>\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435<\/u><\/em><\/a><em> Baymard Institute, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0435\u0441\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043d\u043b\u0430\u0439\u043d-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043b \u0434\u0432\u0430 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u0438\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u2014 \u0442\u043e\u0447\u043d\u044b\u0435 \u0438 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0435.<\/em><\/p>\n<h2>\u0422\u043e\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/h2>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u0449\u0435\u0442, \u043e\u043d \u0432\u0432\u043e\u0434\u0438\u0442 \u0442\u043e\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s\u00bb. \u0422\u043e\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u2014 \u0441\u0430\u043c\u044b\u0439 \u043b\u0435\u0433\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f. \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 <strong>\u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u043e\u0438\u0441\u043a<\/strong>.\u00a0<\/p>\n<p>\u041f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u043e\u0438\u0441\u043a \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 \u0441\u043b\u043e\u0432\u0430 \u0438 \u0444\u0440\u0430\u0437\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0418\u043d\u0434\u0435\u043a\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u0433\u0434\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u044d\u0442\u0438 \u0441\u043b\u043e\u0432\u0430 \u0438 \u0444\u0440\u0430\u0437\u044b, \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432\u0435\u0441 \u0438\u043b\u0438 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0438\u0448\u0435\u0442 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s\u00bb, \u043f\u043e\u0438\u0441\u043a \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u00ab\u0447\u0438\u043f\u0441\u044b\u00bb \u0438 \u00abLay\u2019s\u00bb, \u0438\u0449\u0435\u0442 \u044d\u0442\u0438 \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u0433\u0434\u0435 \u043e\u043d\u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443 \u0442\u043e\u0432\u0430\u0440\u0430 \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s \u0441\u043c\u0435\u0442\u0430\u043d\u0430 \u0438 \u0437\u0435\u043b\u0435\u043d\u044c\u00bb, \u043d\u043e\u0432\u043e\u0441\u0442\u044c \u00ab\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0447\u0438\u043f\u0441\u044b Lay\u2019s \u0441\u043e \u0432\u043a\u0443\u0441\u043e\u043c \u043c\u0430\u043b\u043e\u0441\u043e\u043b\u044c\u043d\u044b\u0445 \u043e\u0433\u0443\u0440\u0447\u0438\u043a\u043e\u0432\u00bb \u0438 \u0441\u0442\u0430\u0442\u044c\u044e \u00ab5 \u0440\u0435\u0446\u0435\u043f\u0442\u043e\u0432 \u0441 \u0447\u0438\u043f\u0441\u0430\u043c\u0438 Lays\u00bb.\u00a0<\/p>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u043d\u0436\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0430\u043c\u044b\u0435 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435. \u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430 \u0442\u043e\u0432\u0430\u0440\u0430 \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s \u0441\u043c\u0435\u0442\u0430\u043d\u0430 \u0438 \u0437\u0435\u043b\u0435\u043d\u044c\u00bb: \u0432 \u043d\u0435\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u043b\u043e\u0432 \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0438 \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430.\u00a0<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u041c\u044b \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <strong>Elasticsearch \u0438 Diginetica<\/strong>. <a href=\"https:\/\/anyquery.diginetica.com\/?utm_medium=cpc&amp;utm_source=eLama-yandex&amp;utm_campaign=%D0%91%D1%80%D0%B5%D0%BD%D0%B4%D1%8B\/%D0%92%D1%81%D0%B5\/%D0%9F%D0%BE%D0%B8%D1%81%D0%BA\/%D0%A0%D0%A4+%D0%9A%D0%97+%D0%A0%D0%91&amp;utm_content=cid%7C54954785%7Cgid%7C4993896746%7Caid%7C12550460183%7Cadp%7Cno%7Cdvc%7Cmobile%7Cpid%7C40488828556%7Crid%7C40488828556%7Cdid%7C40488828556%7Cpos%7Cpremium1%7Cadn%7Csearch%7Ccrid%7C0%7C&amp;utm_term=diginetica&amp;utm_banner=12550460183&amp;utm_phrase=40488828556&amp;type=search&amp;roistat=direct2_search_12550460183_diginetica&amp;roistat_referrer=none&amp;roistat_pos=premium_1&amp;etext=&amp;yclid=7160220207680847871\"><u>Diginetica<\/u><\/a> \u2014 \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430\u0445. \u041e\u043d \u0441\u0430\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. Elasticsearch \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441 \u043d\u0438\u043c.\u00a0<\/p>\n<h3>\u041f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u043e\u0438\u0441\u043a\u00a0<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b, \u043a\u0430\u043a \u0438 \u044f, \u043f\u0438\u0448\u0435\u0442\u0435 \u043d\u0430 Ruby, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 <code>Elasticsearch<\/code>, \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>Elasticsearch gem<\/code>.\u00a0<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442 Elasticsearch, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a <code>Elasticsearch<\/code> \u043d\u0430 <code>localhost:9200<\/code>:  <\/p>\n<pre><code class=\"ruby\">require 'elasticsearch'  client = Elasticsearch::Client.new(url: 'http:\/\/localhost:9200')<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>products<\/code>:<\/p>\n<pre><code class=\"ruby\">client.indices.create(index: 'products')<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0432 \u0438\u043d\u0434\u0435\u043a\u0441 <code>products<\/code> \u0441 ID 1:\u00a0<\/p>\n<pre><code class=\"ruby\">client.index(index: 'products', id: 1, body: {   name: '\u0427\u0438\u043f\u0441\u044b Lay\u2019s',   description: '\u0412\u043a\u0443\u0441\u043d\u044b\u0435 \u0438 \u0445\u0440\u0443\u0441\u0442\u044f\u0449\u0438\u0435 \u0447\u0438\u043f\u0441\u044b \u0441\u043e \u0432\u043a\u0443\u0441\u043e\u043c \u0441\u043c\u0435\u0442\u0430\u043d\u044b \u0438 \u0437\u0435\u043b\u0435\u043d\u0438.' })<\/code><\/pre>\n<p>\u0418 \u0438\u0449\u0435\u043c \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u0433\u0434\u0435 \u043f\u043e\u043b\u0435 name \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0435\u043a\u0441\u0442 \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s\u00bb:\u00a0<\/p>\n<pre><code class=\"ruby\">response = client.search(index: 'products',                           body: {                            query: {                              match: {                                name: '\u0447\u0438\u043f\u0441\u044b Lay\u2019s'                              }                            }                          } ) <\/code><\/pre>\n<p>\u0438\u043b\u0438<\/p>\n<pre><code class=\"ruby\">response = client.search(q: '\u0447\u0438\u043f\u0441\u044b Lay\u2019s')<\/code><\/pre>\n<p>\u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430, \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0438\u043c\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"ruby\">results = response['hits']['hits'] results.each do |result|   puts result['_source']['name'] end <\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043f\u043e\u0438\u0441\u043a\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>AND, OR<\/code> \u0438 <code>NOT<\/code>. \u0427\u0442\u043e\u0431\u044b \u0441\u0443\u0437\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b.   <\/p>\n<h2>\u0417\u0430\u043f\u0440\u043e\u0441 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438\u043b\u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u043e\u0439<\/h2>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438\u043b\u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u043e\u0439 \u2014\u00a0\u0442\u043e\u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u043e\u0434\u0438\u0442 \u0442\u0438\u043f \u0442\u043e\u0432\u0430\u0440\u0430, \u0435\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438\u043b\u0438 \u0431\u0440\u0435\u043d\u0434, \u043d\u043e \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u0447\u0438\u043f\u0441\u044b Lays\u00bb, \u00ab\u0447\u0438\u0441\u043f\u044b Lay\u2019s\u00bb \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u00abxbgcs Lay\u2019s\u00bb. Baymard Institute \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e 42% \u043e\u043d\u043b\u0430\u0439\u043d-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u044e\u0442. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442, \u0440\u0438\u0441\u043a\u0443\u044e\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0443\u043c\u0430\u044e\u0442, \u0447\u0442\u043e \u0442\u043e\u0432\u0430\u0440 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0441\u044f.\u00a0<\/p>\n<p>\u041d\u0430\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0418\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u0441\u0430\u043c\u044b\u043c\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430\u043c\u0438. \u0418\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0438\u0441\u043a.\u00a0<\/p>\n<h3>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u0430\u0432\u0442\u043e\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0412 <code>Elasticsearch<\/code> \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>Elasticsearch Suggester<\/code>. \u041e\u043d\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043f\u0438\u0448\u0443\u0442 \u0438\u0445 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u044e. <code>Suggester<\/code> \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 <code>Elasticsearch<\/code>.\u00a0<\/p>\n<p>\u041d\u043e \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u0430\u0432\u0442\u043e\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>Hunspell<\/code> \u0438\u043b\u0438 <code>Peter Norvig\u2019s Spelling Corrector<\/code>.<\/p>\n<p><a href=\"https:\/\/hunspell.github.io\/\"><u>Hunspell<\/u><\/a> \u2014 \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0415\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 <code>Elasticsearch<\/code> <a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/current\/analysis-hunspell-tokenfilter.html\"><u>\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430<\/u><\/a>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u0442\u044c <a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/plugins\/current\/index.html\"><u>\u043f\u043b\u0430\u0433\u0438\u043d\u044b Elasticsearch<\/u><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Hunspell.\u00a0<\/p>\n<p><a href=\"https:\/\/norvig.com\/spell-correct.html\"><u>Peter Norvig&#8217;s Spelling Corrector<\/u><\/a> \u2014 \u044d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0442\u0435\u043e\u0440\u0438\u0438 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0441\u0442\u0430\u0432\u043e\u043a, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0437\u0430\u043c\u0435\u043d, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0441\u043b\u043e\u0432\u043e \u0432 \u0434\u0440\u0443\u0433\u043e\u0435. \u0427\u0442\u043e\u0431\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>Peter Norvig's Spelling Corrector<\/code> \u0441 <code>Elasticsearch<\/code>, \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/plugins\/current\/index.html\"><u>\u043f\u043b\u0430\u0433\u0438\u043d\u044b<\/u><\/a>.\u00a0<\/p>\n<h3>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a<\/h3>\n<p>\u0421\u0432\u043e\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0447\u0430\u0441\u0442\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u043f\u044b\u0442. \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0432 <code>Elasticsearch<\/code> \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ruby-\u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c Ruby-\u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044f. \u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, CSV-\u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 JSON-\u0444\u0430\u0439\u043b\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0430\u043a\u043e\u0439 JSON-\u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"ruby\">\"{\\\"words\\\":[{\\\"word\\\":\\\"\u043f\u0440\u0438\u0432\u0435\u0442\\\",\\\"error\\\":\\\"\u043f\u0440\u0435\u0432\u0435\u0434\\\"},{\\\"word\\\":\\\"\u0445\u043b\u0435\u0431\\\",\\\"error\\\":\\\"\u043f\u0438\u0432\u043e\\\"},{\\\"word\\\":\\\"\u043c\u0435\u0434\u0432\u0435\u0434\u044c\\\",\\\"error\\\":\\\"\u043c\u0435\u0434\u0432\u0435\u0434\\\"}]}\" <\/code><\/pre>\n<pre><code class=\"ruby\"># \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a Elasticsearch client = Elasticsearch::Client.new(url: 'http:\/\/localhost:9200') # \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a Elasticsearch client = Elasticsearch::Client.new(url: 'http:\/\/localhost:9200')  # \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 JSON-\u0444\u0430\u0439\u043b\u0430 data = JSON.parse(File.read('data.json'))  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f dictionary = {} data['words'].each do |object|   dictionary[object['error']] = object['word'] end  # \u0418\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0432 Elasticsearch client.index(index: 'dictionary', type: 'word', body: dictionary)  # \u0421\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 puts \"\u0421\u043b\u043e\u0432\u0430\u0440\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d!\" <\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442:\u00a0<\/p>\n<pre><code class=\"ruby\">ruby script.rb<\/code><\/pre>\n<p>\u041f\u043e\u0442\u043e\u043c \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u044b.\u00a0<\/p>\n<h3>\u0424\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0438\u0441\u043a\u00a0<\/h3>\n<p>\u0423 \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>Soundex<\/code>, <code>Metaphone<\/code>, <code>Double Metaphone<\/code> \u0438 <code>NYSIIS<\/code>. \u0412\u0441\u0435 \u043e\u043d\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0441\u043b\u043e\u0432\u0430 \u0432 \u043a\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u0438\u0445 \u0437\u0432\u0443\u0447\u0430\u043d\u0438\u0438. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438.\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0438\u0441\u043a \u0432 <code>Elasticsearch<\/code>, \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0438\u043d\u0434\u0435\u043a\u0441 <code>Elasticsearch<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 <code>Elasticsearch \u00abphonetic\u00bb<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \u0432 \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"ruby\"># \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a Elasticsearch client = Elasticsearch::Client.new(url: 'http:\/\/localhost:9200') # \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441 client.indices       .create(index: 'my_index',               body: {                 mappings: {                   properties: {                     name: {                       type: 'text',                       analyzer: 'phonetic'                     }                   }                 }               }) <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0439\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u043e\u0432.   <\/p>\n<pre><code class=\"ruby\"># \u0418\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 client.index(index: 'my_index',              type: 'doc',              id: 1,              body: { name: '\u0447\u0438\u043f\u0441\u044b \u043b\u0435\u0439\u0441' }) <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u043e\u043d\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0438\u0441\u043a <code>Elasticsearch<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u00ab\u0447\u0438\u043f\u0441\u044b Lay\u2019s\u00bb \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u00ab\u0447\u0438\u043f\u0441\u044b \u043b\u0435\u0439\u0441\u00bb.\u00a0<\/p>\n<pre><code class=\"ruby\"># \u041f\u043e\u0438\u0441\u043a response = client.search(index: 'my_index',                          body: {                            query: {                              match: {                                name: {                                  query: '\u0447\u0438\u043f\u0441\u044b \u043b\u0435\u0439\u0441',                                  fuzziness: 'AUTO'                                }                              }                            }                          })   puts response['hits']['hits'][0]['_source']['name'] <\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:\u00a0<code>\u0447\u0438\u043f\u0441\u044b Lay's<\/code><\/p>\n<p><em>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0447\u043d\u044b\u0445 \u0438 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435: \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c, \u043f\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0441\u043b\u0435\u043d\u0433\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043d\u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u0430 \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c.<\/em>  <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/798743\/\"> https:\/\/habr.com\/ru\/articles\/798743\/<\/a><br \/><\/br><\/br><\/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-370224","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370224","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=370224"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370224\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=370224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=370224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=370224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}