{"id":9042,"date":"2017-03-22T15:05:27","date_gmt":"2017-03-22T06:05:27","guid":{"rendered":"http:\/\/sitest.jp\/blog\/?p=9042"},"modified":"2017-03-22T19:50:03","modified_gmt":"2017-03-22T10:50:03","slug":"%e9%ab%98%e9%80%9f%e6%a4%9c%e7%b4%a2%e3%82%a8%e3%83%b3%e3%82%b8%e3%83%b3elasticsearch%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f%ef%bc%81%ef%bc%88%e5%85%b6%e3%81%ae%ef%bc%91%ef%bc%89","status":"publish","type":"post","link":"https:\/\/sitest.jp\/blog\/?p=9042","title":{"rendered":"\u9ad8\u901f\u691c\u7d22\u30a8\u30f3\u30b8\u30f3ElasticSearch\u3092\u4f7f\u3063\u3066\u307f\u305f\uff01\uff08\u5176\u306e\uff11\uff09"},"content":{"rendered":"<p>\u30ad\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u30b5\u30a4\u30c8\u306a\u3069\u3067\u3001\u30b5\u30a4\u30c8\u5185\u306e\u8a18\u4e8b\u3092\u5168\u6587\u691c\u7d22\u3059\u308b\u8981\u671b\u306f\u3001\u307b\u307c\u5fc5\u9808\u304b\u3068\u601d\u308f\u308c\u307e\u3059\u3002\u3057\u304b\u3057\u3001100\u4e07\u4ef6\u8d85\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066RDB\u3067\u300clike \u2018%xxxx%\u2019\u300d\u306a\u3069\u3067\u306f\u3001\u304b\u306a\u308a\u53b3\u3057\u3044\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\u306b\u306a\u308b\u3068\u601d\u308f\u308c\u307e\u3059\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u5168\u6587\u691c\u7d22\u30a8\u30f3\u30b8\u30f3\u306e\u767b\u5834\u3067\u3059\u3002<\/p>\n<p>\u5168\u6587\u691c\u7d22\u30a8\u30f3\u30b8\u30f3\u306f\u53e4\u304f\u304b\u3089\u3044\u308d\u3044\u308d\u3042\u308a\u307e\u3059\u304c\u3001ElasticSearch\u306e\u7279\u5fb4\u306f\u305d\u306e\u540d\u306e\u901a\u308aelastic\u306b\u30b9\u30b1\u30fc\u30eb\u30a2\u30a6\u30c8\u304c\u5bb9\u6613\u306a\u3068\u3053\u308d\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002<br \/>\n\u4ed6\u306e\u5168\u6587\u691c\u7d22\u30a8\u30f3\u30b8\u30f3\u3067\u6709\u540d\u3069\u3053\u308d\u3060\u3068Solr\u306a\u3069\u3082\u3042\u308a\u3001\u4e2d\u8eab\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u3001\u3069\u3061\u3089\u3082Lucene API \u3092\u5229\u7528\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u30b9\u30b1\u30fc\u30eb\u30a2\u30a6\u30c8\u306e\u9762\u3067\u306fElasticSearch\u304c\u79c0\u3067\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u305d\u3053\u3067\u3001\u4eca\u56de\u306fElasticSearch\u3092\u4f7f\u3063\u3066\u307f\u3066\u3001\u305d\u306e\u901f\u3055\u3092\u4f53\u9a13\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><!--more--><\/p>\n<div class=\"frame_headding\">\n<ul>\n<li>\n<h3 style=\"text-align: left;\">\u25a0 \u8a66\u3057\u3066\u307f\u3088\u3046<\/h3>\n<\/li>\n<\/ul>\n<\/div>\n<p>\u5f0a\u793e\u3067\u306f\u3001\u300c<a href=\"http:\/\/spaia.jp\" title=\"SPAIA\" target=\"_blank\">SPAIA<\/a>\u300d\u3068\u3044\u3046\u5f93\u6765\u306e\u30b9\u30dd\u30fc\u30c4\u30cb\u30e5\u30fc\u30b9\u30e1\u30c7\u30a3\u30a2\u3068\u306f\u9055\u3044\u3001\u30b9\u30dd\u30fc\u30c4\u30c7\u30fc\u30bf\u3092AI\u306b\u3088\u3063\u3066\u89e3\u6790\u3057\u3001\u65b0\u3057\u3044\u30b9\u30dd\u30fc\u30c4\u306e\u898b\u65b9\u3084\u697d\u3057\u307f\u65b9\u304c\u5b9f\u73fe\u3067\u304d\u308b\u3053\u3068\u306b\u52a0\u3048\u3001\u5f0a\u793e\u72ec\u81ea\u3067\u7de8\u96c6\u90e8\u304c\u53d6\u6750\u30fb\u7de8\u96c6\u3057\u305f\u30aa\u30ea\u30b8\u30ca\u30eb\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u306e\u30b9\u30dd\u30fc\u30c4\u30b3\u30e9\u30e0\u8a18\u4e8b\u306b\u5bfe\u3057\u3066\u3001\u691c\u7d22\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u30ad\u30fc\u30ef\u30c9\u3068\u3057\u3066\u306f\u300c\u76f8\u64b2\u300d\u3001\u5bfe\u8c61\u30d5\u30a3\u30fc\u30eb\u30c9\u306f\u30b3\u30e9\u30e0\u8a18\u4e8b\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308bbody\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u5f0a\u793e\u3067\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u3057\u3066\u3001\u4e3b\u306bMongoDB\u3092\u5229\u7528\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305a\u6700\u521d\u306b\u3001MongoDB\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code>time mongo main --eval 'db.posts.find( { body:\/\u76f8\u64b2\/ } )'\n<\/code><\/pre>\n<p>\nMongoDB\u3067\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\u306f\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre><code>real   0m1.573s\nuser  0m0.116s\nsys   0m0.028s\n<\/code><\/pre>\n<p>\n\u6b21\u306bElasticSearch\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089curl \u30b3\u30de\u30f3\u30c9\u3067REST API\u306b \u691c\u7d22\u3092\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u30af\u30a8\u30ea\u3082\u30ec\u30b9\u30dd\u30f3\u30b9\u3082json\u5f62\u5f0f\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code>time curl -XGET 'http:\/\/localhost:9201\/p_index\/p_type\/_search?pretty=true' -d '\n    {\n        \"query\" : {\n                \"simple_query_string\" : {\n                        \"query\": \"\u76f8\u64b2\",\n                        \"fields\": [\"body\"]              \n                        }\n\u3000\u3000\u3000\u3000    }\n    }'\n<\/code><\/pre>\n<p>\nElasticSearch\u3067\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\u306f\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre><code>real   0m0.155s\nuser  0m0.005s\nsys   0m0.005s\n<\/code><\/pre>\n<p><\/p>\n<p>MongoDB\u306b\u5bfe\u3057\u3066\u306e\u5168\u6587\u691c\u7d22\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\u306f\u3001\u304a\u3088\u305d10\u500d\u307b\u3069\u306e\u5dee\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nElasticSearch\u7206\u901f\u3067\u3057\u305f\u306d\uff01<\/p>\n<p><!--more--><\/p>\n<div class=\"frame_headding\">\n<h3 style=\"text-align: left;\">\u25a0 \u6700\u5f8c\u306b<\/h3>\n<\/div>\n<p>\u3053\u306e\u3088\u3046\u306b\u5168\u6587\u691c\u7d22\u306e\u7d50\u679c\u306e\u9055\u3044\u3092\u898b\u3066\u307f\u308b\u3068\u3001ElasticSearch\u3092\u5229\u7528\u3059\u308b\u3068\u304a\u624b\u8efd\u306b\u5b9f\u73fe\u51fa\u6765\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u5168\u6587\u691c\u7d22\u30b7\u30b9\u30c6\u30e0\u3092\u5b9f\u88c5\u3059\u308b\u306b\u306f\u3001ElasticSearch \u304c\u304a\u3059\u3059\u3081\u3067\u3059\u3002<br \/>\n\u4ed6\u306b\u3082\u985e\u4f3c\u6587\u66f8\u3092\u691c\u7d22\u3059\u308b\u6a5f\u80fd\u3084\u3001\u30d5\u30a1\u30b8\u30fc\u691c\u7d22\u3001\u30d5\u30a1\u30bb\u30c3\u30c8\u6a5f\u80fd\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u6b21\u56de\u306f\u3001\u985e\u4f3c\u6587\u66f8\u3092\u691c\u7d22\u3057\u3066\u95a2\u9023\u8a18\u4e8b\u3092\u30ec\u30b3\u30e1\u30f3\u30c9\u3059\u308b\u6a5f\u80fd\u3092\u8a66\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ad\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u30b5\u30a4\u30c8\u306a\u3069\u3067\u3001\u30b5\u30a4\u30c8\u5185\u306e\u8a18\u4e8b\u3092\u5168\u6587\u691c\u7d22\u3059\u308b\u8981\u671b\u306f\u3001\u307b\u307c\u5fc5\u9808\u304b\u3068\u601d\u308f\u308c\u307e\u3059\u3002\u3057\u304b\u3057\u3001100\u4e07\u4ef6\u8d85\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066RDB\u3067\u300clike \u2018%xxxx%\u2019\u300d\u306a\u3069\u3067\u306f\u3001\u304b\u306a\u308a\u53b3\u3057\u3044\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\u306b\u306a\u308b\u3068\u601d\u308f\u308c\u307e\u3059\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u5168\u6587\u691c\u7d22\u30a8\u30f3\u30b8\u30f3\u306e\u767b\u5834\u3067\u3059\u3002 \u5168\u6587\u691c\u7d22\u30a8\u30f3\u30b8\u30f3\u306f\u53e4\u304f\u304b\u3089\u3044\u308d\u3044\u308d\u3042\u308a\u307e\u3059\u304c\u3001ElasticSearch\u306e\u7279\u5fb4\u306f\u305d\u306e\u540d\u306e\u901a\u308aelastic\u306b\u30b9\u30b1\u30fc\u30eb\u30a2\u30a6\u30c8\u304c\u5bb9\u6613\u306a\u3068\u3053\u308d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9046,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[25],"tags":[],"acf":false,"_links":{"self":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/9042"}],"collection":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/comments?post=9042"}],"version-history":[{"count":18,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/9042\/revisions"}],"predecessor-version":[{"id":9197,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/posts\/9042\/revisions\/9197"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/media\/9046"}],"wp:attachment":[{"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/media?parent=9042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/categories?post=9042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sitest.jp\/blog\/wp-json\/wp\/v2\/tags?post=9042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}