{"id":281,"date":"2014-07-30T12:34:53","date_gmt":"2014-07-30T10:34:53","guid":{"rendered":"http:\/\/www.maxx.net.ua\/?p=281"},"modified":"2014-07-30T12:34:53","modified_gmt":"2014-07-30T10:34:53","slug":"%d0%bd%d0%b0%d1%81%d1%82%d1%80%d0%be%d0%b9%d0%ba%d0%b0-%d1%81%d0%b8%d0%bd%d0%be%d0%bd%d0%b8%d0%bc%d0%be%d0%b2-%d0%b2-elasticsearch","status":"publish","type":"post","link":"https:\/\/www.maxx.net.ua\/?p=281","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0438\u043d\u043e\u043d\u0438\u043c\u043e\u0432 \u0432 Elasticsearch"},"content":{"rendered":"<p>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0448\u0442\u0443\u043a\u0430 ElasticSearch, \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0442 \u0432\u0438\u0434\u0438\u043c\u043e \u0432\u0441\u0435 \u0441\u0438\u043b\u044b \u043e\u0442\u0434\u0430\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043a\u043e\u0434\u0430, \u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043d\u0438 \u0441\u0438\u043b, \u043d\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430: \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u043b\u044f\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0438\u043d\u043e\u043d\u0438\u043c\u043e\u0432. \u0421\u0438\u043d\u043e\u043d\u0438\u043c\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u043e \u043d\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u044f\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0437 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430\u00a0 \u0441\u043f\u0438\u0441\u043a\u0430 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b.<\/p>\n<p>\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:<\/p>\n<p>1. \u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0435\u0433\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c:<\/p>\n<pre class=\"lang:sh decode:true \">curl -XPOST 'http:\/\/localhost:9200\/test_direct\/_close'<\/pre>\n<p>&nbsp;<\/p>\n<p>2. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e\u00a0\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439\u00a0:<\/p>\n<pre class=\"lang:default decode:true \">curl -XPUT 'localhost:9200\/pocket_dwh_direct\/_settings' -d '\n {'settings': {\n      \"index\": {\n         \"analysis\" : {\n              \"analyzer\" : {\n                  \"my_search_analyzer\" : {\n                       \"tokenizer\" : \"whitespace\",\n                       \"filter\" : [\"standard\", \"asciifolding\", \"lowercase\", \"kstem\", \"search_synonym\"]\n                  }\n             },\n          \"filter\" : {\n                \"search_synonym\" : {\n                    \"ignore_case\" : \"true\",\n                    \"type\" : \"synonym\",\n                    \"synonyms\" : [\"aaaa , bbb, ccc\"]\n                 }\n           }\n    }\n   }\n  },\n  \"mappings\": {\n        \"mydoc_data\": {\n            \"properties\": {\n                 \"mysocName\": {\n                    \"type\": \"string\",\n                    \"index_analyzer\": \"standard\",\n                    \"search_analyzer\": \"my_search_analyzer\"\n                  }, \n                  \"mydocSecondName\": { \n                    \"type\": \"string\",\n                    \"index_analyzer\": \"standard\",\n                    \"search_analyzer\": \"my_search_analyzer\"\n                  }\n             }\n         }\n   }\n}'<\/pre>\n<p>&nbsp;<\/p>\n<p>\u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0439:<\/p>\n<pre class=\"toolbar:2 lang:default decode:true\">{ \n\t'settings': \n\t\t{ \"index\": \n\t\t\t{ \"analysis\" : \n\t\t\t\t{\"analyzer\" : \n\t\t\t\t{\/\/ \u041f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \n\t\t\t\t\t\"my_search_analyzer\" : { \n\t\t\t\t\t\t\"tokenizer\" : \"whitespace\",\n\t\t\t\t\t\t\/\/ \u042d\u0442\u043e\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440 \u0441\u0438\u043d\u043e\u043d\u0438\u043c\u043e\u0432 \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0444\u0440\u0430\u0437 \n\t\t\t\t\t\t\"filter\" : [\"standard\", \"asciifolding\", \"lowercase\", \"kstem\", \"search_synonym\"] \n\t\t\t\t\t} \n\t\t\t\t},\n\t\t\t\t\/\/ \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u0430-\u0441\u0438\u043d\u043e\u043d\u0438\u043c\u0430 \n\t\t\t\t\"filter\" : { \n\t\t\t\t\t\"search_synonym\" : { \n\t\t\t\t\t\t\"ignore_case\" : \"true\", \n\t\t\t\t\t\t\"type\" : \"synonym\", \n\t\t\t\t\t\t\"synonyms\" : [\"aaaa , bbb, ccc\"] \n\t\t\t\t\t} \n\t\t\t\t} \n\t\t\t} \n\t\t} \n\t},\n\t\/\/ \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441 \n\t\"mappings\": {\n\t\/\/ \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f. \n\t\t\"mydoc_data\": { \n\t\t\t\"properties\": {\n\t\t\t\t\/\/ \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u043b\u0435\u0439 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u0442\u043e\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\tmy_search_analyzer \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435\n\t\t\t\t\"mydocName\": { \n\t\t\t\t\t\"type\": \"string\", \n\t\t\t\t\t\"index_analyzer\": \"standard\", \n\t\t\t\t\t\"search_analyzer\": \"my_search_analyzer\" },\n\t\t\t\t\/\/ \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \n\t\t\t\t\"mydocSecondName\": { \n\t\t\t\t\t\"type\": \"string\", \n\t\t\t\t\t\"index_analyzer\": \"standard\", \n\t\t\t\t\t\"search_analyzer\": \"my_search_analyzer\" \n\t\t\t\t}\n\t\t\t} \n\t\t} \n\t} \n}\n<\/pre>\n<p>3. \u041f\u043e\u0441\u043b\u0435 \u043e\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre class=\"lang:sh decode:true \">\u0441url -XPOST 'http:\/\/localhost:9200\/test_direct\/_open'<\/pre>\n<p>&nbsp;<\/p>\n<p>4. \u0423\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439<\/p>\n<pre class=\"lang:sh decode:true \">curl -XGET 'http:\/\/localhost:9200\/test_direct\/_analyze\/?analyzer=my_search_analyzer&amp;amp;text=aaa'<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0412 \u043e\u0442\u0432\u0435\u0442 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u044b\u0434\u0430\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430:<\/p>\n<pre class=\"toolbar:2 show-lang:2 nums:false lang:css decode:true \">{ \uf147 \n   \"tokens\":[ \uf147 \n      { \uf147 \n         \"token\":\"aaa\",\n         \"start_offset\":0,\n         \"end_offset\":4,\n         \"type\":\"SYNONYM\",\n         \"position\":1\n      },\n      { \uf147 \n         \"token\":\"bbb\",\n         \"start_offset\":0,\n         \"end_offset\":4,\n         \"type\":\"SYNONYM\",\n         \"position\":1\n      },\n      { \uf147 \n         \"token\":\"ccc\",\n         \"start_offset\":0,\n         \"end_offset\":4,\n         \"type\":\"SYNONYM\",\n         \"position\":1\n      }\n   ]\n}\n<\/pre>\n<p>\u0433\u043e\u0432\u043e\u0440\u044f\u0449\u0430\u044f, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u0444\u0440\u0430\u0437\u044b aaa \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c\u0441\u044f bbb \u0438 ccc<\/p>\n<p>&nbsp;<\/p>\n<p>\u041b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0430<\/p>\n<p>1. https:\/\/gist.github.com\/clintongormley\/4095280<\/p>\n<p>2. http:\/\/bitsandbites.me\/blog\/2014\/04\/08\/elasticsearch-synonyms\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0448\u0442\u0443\u043a\u0430 ElasticSearch, \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0442 \u0432\u0438\u0434\u0438\u043c\u043e \u0432\u0441\u0435 \u0441\u0438\u043b\u044b \u043e\u0442\u0434\u0430\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043a\u043e\u0434\u0430, \u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043d\u0438 \u0441\u0438\u043b, \u043d\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e. \u0417\u0430\u0434\u0430\u0447\u0430: \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u043b\u044f\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0438\u043d\u043e\u043d\u0438\u043c\u043e\u0432. \u0421\u0438\u043d\u043e\u043d\u0438\u043c\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u043e \u043d\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u044f\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/281"}],"collection":[{"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=281"}],"version-history":[{"count":0,"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/281\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}