{"id":957,"date":"2016-10-20T08:23:53","date_gmt":"2016-10-20T00:23:53","guid":{"rendered":"http:\/\/www.daycode.net\/?p=957"},"modified":"2018-01-30T21:34:34","modified_gmt":"2018-01-30T13:34:34","slug":"%e6%9c%80%e6%96%b02016%e7%99%be%e5%ba%a6%e4%ba%91%e7%bd%91%e7%9b%98%e6%90%9c%e7%b4%a2%e5%bc%95%e6%93%8ephp%e6%ba%90%e7%a0%81_%e9%99%84%e5%b8%a6python%e7%88%ac%e8%99%abphp%e7%bd%91%e7%ab%99xunsearch","status":"publish","type":"post","link":"https:\/\/www.daycode.net\/957.html","title":{"rendered":"\u6700\u65b02016\u767e\u5ea6\u4e91\u7f51\u76d8\u641c\u7d22\u5f15\u64cePHP\u6e90\u7801_\u9644\u5e26Python\u722c\u866b+PHP\u7f51\u7ad9+Xunsearch\u641c\u7d22\u5f15\u64ce"},"content":{"rendered":"<h2>\u6e90\u7801\u7b80\u4ecb<\/h2>\n<p>\u5206\u4eab\u7684\u662f\u4e00\u6b3e<a href=\"https:\/\/www.daycode.net\/tag\/195\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e \u641c\u7d22\u5f15\u64ce \u7684\u6587\u7ae0\" target=\"_blank\">\u641c\u7d22\u5f15\u64ce<\/a>\u6e90\u7801\uff0c\u767e\u5ea6\u4e91\u76d8\u722c\u866b\u6e90\u7801\uff0cPython\u767e\u5ea6\u4e91<a href=\"https:\/\/www.daycode.net\/tag\/193\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e \u7f51\u76d8\u641c\u7d22 \u7684\u6587\u7ae0\" target=\"_blank\">\u7f51\u76d8\u641c\u7d22<\/a>\u5f15\u64ce\uff0c\u722c\u866b+\u7f51\u7ad9\uff0c<a href=\"https:\/\/www.daycode.net\/tag\/195\" class=\"tag-tooltip\" data-toggle=\"tooltip\" title=\"\u67e5\u770b\u66f4\u591a\u5173\u4e8e \u641c\u7d22\u5f15\u64ce \u7684\u6587\u7ae0\" target=\"_blank\">\u641c\u7d22\u5f15\u64ce<\/a>\u91c7\u7528Xunsearch\u9ad8\u6548\u641c\u7d22\uff0c\u6e90\u7801\u5f88\u7b80\u5355\uff0c\u9644\u5e26\u5b89\u88c5\u6559\u7a0b\uff0c\u53ef\u4e8c\u5f00\uff0c\u8fd9\u91ccAlphaCoder\u514d\u8d39\u5206\u4eab\u7ed9\u5927\u5bb6\uff0c\u5168\u81ea\u52a8\u66f4\u65b0\u767e\u5ea6\u4e91\u76d8\u5185\u5bb9\uff0c\u5168\u81ea\u52a8\u91c7\u96c6\u54e6\uff01<\/p>\n<h2>\u9002\u7528\u8303\u56f4<\/h2>\n<p>\u767e\u5ea6\u4e91\u7f51\u76d8\u641c\u7d22\u5f15\u64ce\u6e90\u7801\uff0c\u767e\u5ea6\u641c\u7d22\u5f15\u64ce\u6e90\u7801\uff0c\u7f51\u76d8\u641c\u7d22\u722c\u866b\u6e90\u7801<\/p>\n<h2>\u8fd0\u884c\u73af\u5883<\/h2>\n<p>PHP+MYSQL+Python<\/p>\n<h2>\u6d4b\u8bd5\u622a\u56fe<\/h2>\n<p><a href=\"https:\/\/pic.rmb.bdstatic.com\/bjh\/32e520f7e90fa00fbd974c17797c3e98.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-958\" src=\"https:\/\/pic.rmb.bdstatic.com\/bjh\/32e520f7e90fa00fbd974c17797c3e98.png\" title=\"\u6700\u65b02016\u767e\u5ea6\u4e91\u7f51\u76d8\u641c\u7d22\u5f15\u64cePHP\u6e90\u7801_\u9644\u5e26Python\u722c\u866b+PHP\u7f51\u7ad9+Xunsearch\u641c\u7d22\u5f15\u64ce\u63d2\u56fe\" alt=\"\u6700\u65b02016\u767e\u5ea6\u4e91\u7f51\u76d8\u641c\u7d22\u5f15\u64cePHP\u6e90\u7801_\u9644\u5e26Python\u722c\u866b+PHP\u7f51\u7ad9+Xunsearch\u641c\u7d22\u5f15\u64ce\u63d2\u56fe\" \/><\/a><a href=\"https:\/\/pic.rmb.bdstatic.com\/bjh\/482cc76f864f287b1c20a0cfe329bd47.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-959\" src=\"https:\/\/pic.rmb.bdstatic.com\/bjh\/482cc76f864f287b1c20a0cfe329bd47.png\" title=\"\u6700\u65b02016\u767e\u5ea6\u4e91\u7f51\u76d8\u641c\u7d22\u5f15\u64cePHP\u6e90\u7801_\u9644\u5e26Python\u722c\u866b+PHP\u7f51\u7ad9+Xunsearch\u641c\u7d22\u5f15\u64ce\u63d2\u56fe1\" alt=\"\u6700\u65b02016\u767e\u5ea6\u4e91\u7f51\u76d8\u641c\u7d22\u5f15\u64cePHP\u6e90\u7801_\u9644\u5e26Python\u722c\u866b+PHP\u7f51\u7ad9+Xunsearch\u641c\u7d22\u5f15\u64ce\u63d2\u56fe1\" \/><\/a><a href=\"https:\/\/pic.rmb.bdstatic.com\/bjh\/451961b4efa38a51a610633af1db8649.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-960\" src=\"https:\/\/pic.rmb.bdstatic.com\/bjh\/451961b4efa38a51a610633af1db8649.png\" title=\"\u6700\u65b02016\u767e\u5ea6\u4e91\u7f51\u76d8\u641c\u7d22\u5f15\u64cePHP\u6e90\u7801_\u9644\u5e26Python\u722c\u866b+PHP\u7f51\u7ad9+Xunsearch\u641c\u7d22\u5f15\u64ce\u63d2\u56fe2\" alt=\"\u6700\u65b02016\u767e\u5ea6\u4e91\u7f51\u76d8\u641c\u7d22\u5f15\u64cePHP\u6e90\u7801_\u9644\u5e26Python\u722c\u866b+PHP\u7f51\u7ad9+Xunsearch\u641c\u7d22\u5f15\u64ce\u63d2\u56fe2\" \/><\/a><\/p>\n<h2>\u5b89\u88c5\u8bf4\u660e<\/h2>\n<p>1\u3001\u4e0a\u4f20\u6e90\u7801\u5230\u7f51\u7ad9<br \/>\n2\u3001\u521b\u5efa\u540d\u4e3a`pan`\u7684\u6570\u636e\u5e93\uff0c\u7f16\u7801\u8bbe\u4e3a`utf-8`\u3002\u7136\u540e\u5bfc\u5165`sql`\uff0c\u5b8c\u6210\u8868\u7684\u521b\u5efa\u3002<br \/>\n3\u3001`config.php` \u6587\u4ef6\u4fee\u6539\u7f51\u7ad9\u6807\u9898\uff0c\u63cf\u8ff0\u7b49\u4fe1\u606f<br \/>\n`database.php` \u4fee\u6539\u6570\u636e\u5e93\u8d26\u53f7\uff0c\u5bc6\u7801\u7b49\u4fe1\u606f<br \/>\n4\u3001\u542f\u52a8\u722c\u866b<br \/>\n\u8fdb\u5165 `spider\/`\u76ee\u5f55\uff0c\u4fee\u6539`spider.py` \u4e2d\u6570\u636e\u5e93\u4fe1\u606f\u3002<br \/>\n__\u5982\u679c\u4f60\u662f\u7b2c\u4e00\u6b21\u90e8\u7f72\uff0c\u9700\u8fd0\u884c\u4e0b\u9762\u547d\u4ee4\uff0c\u5b8c\u6210\u505a\u79cd__<br \/>\npython spider.py --seed-user<br \/>\n\u4e0a\u9762\u5176\u5b9e\u5c31\u662f\u6293\u53d6\u767e\u5ea6\u4e91\u70ed\u95e8\u5206\u4eab\u7528\u6237\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u7136\u540e\u4ece\u4ed6\u4eec\u5f00\u59cb\u5165\u624b\u722c\u53d6\u6570\u636e<br \/>\n\u7136\u540e\u8fd0\u884c<br \/>\npython spider.py<br \/>\n5\u3001\u5b89\u88c5xunsearch<br \/>\n\u76ee\u524d\u4f7f\u7528__xunsearch__\u4f5c\u4e3a\u641c\u7d22\u5f15\u64ce\uff0c\u540e\u9762\u4f1a\u66f4\u6362\u4e3a`elasticsearch`\u3002<br \/>\n\u5b89\u88c5\u8fc7\u7a0b\u8bf7\u53c2\u8003\uff08\u4e0d\u9700\u8981\u5b89\u88c5\uff0cPHP SDK\uff0c\u6211\u5df2\u7ecf\u6574\u5408\u5230web\u91cc\u4e86\uff09<br \/>\nhttp:\/\/xunsearch.com\/doc\/php\/guide\/start.installation<br \/>\n\u6b64\u65f6\u722c\u866b\u5df2\u7ecf\u5f00\u59cb\u5de5\u4f5c\u4e86<br \/>\n6\u3001\u7d22\u5f15\u6570\u636e<br \/>\n\u4e0a\u9762\u6211\u4eec\u5b8c\u6210\u4e86\u722c\u866b\u7684\u6570\u636e\u6293\u53d6\uff0c\u7f51\u7ad9\u7684\u642d\u5efa\uff0c\u4f46\u8fd8\u4e0d\u80fd\u641c\u7d22\uff0c\u4e0b\u9762\u5f00\u59cb\u6700\u540e\u4e00\u6b65\uff0c\u7d22\u5f15\u7684\u5efa\u7acb\u3002<br \/>\n\u8fdb\u5165 `indexer\/`\u76ee\u5f55\uff0c\u5728`indexer.php`\u4e2d\u5c06$prefix\uff0c\u66ff\u6362\u4e3a\u4f60web\u7684\u6839\u8def\u5f84<br \/>\nrequire '$prefix\/application\/helpers\/xs\/lib\/XS.php';<br \/>\n\u5e76\u4fee\u6539\u6570\u636e\u5e93\u8d26\u53f7\u5bc6\u7801<br \/>\n\u7136\u540e\u8fd0\u884c<br \/>\npython .\/index.php<br \/>\n\u5230\u6b64\u4e3a\u6b62\u7a0b\u5e8f\u5df2\u5168\u90e8\u5b89\u88c5\u5b8c\u6bd5<br \/>\n<!-- [\u805a\u5408\u56fe\u5e8a\u67e5\u8be2: 0] --><\/p>\n","protected":false},"excerpt":{"rendered":"\u6e90\u7801\u7b80\u4ecb \u5206\u4eab\u7684\u662f\u4e00\u6b3e\u641c\u7d22\u5f15\u64ce\u6e90\u7801\uff0c\u767e\u5ea6\u4e91\u76d8\u722c\u866b\u6e90\u7801\uff0cPython\u767e\u5ea6\u4e91\u7f51\u76d8\u641c\u7d22\u5f15\u64ce\uff0c\u722c\u866b+\u7f51\u7ad9\uff0c\u641c\u7d22\u5f15\u64ce\u91c7\u7528Xunsearch\u9ad8\u6548\u641c\u7d22\uff0c\u6e90\u7801\u5f88\u7b80\u5355\uff0c\u9644\u5e26\u5b89\u88c5\u6559\u7a0b\uff0c\u53ef\u4e8c\u5f00\uff0c\u8fd9\u91ccAlphaCoder\u514d\u8d39 \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[195,194,193],"class_list":["post-957","post","type-post","status-publish","format-standard","hentry","category-php_ym","tag-195","tag-194","tag-193"],"views":6337,"_links":{"self":[{"href":"https:\/\/www.daycode.net\/api\/wp\/v2\/posts\/957"}],"collection":[{"href":"https:\/\/www.daycode.net\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.daycode.net\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.daycode.net\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.daycode.net\/api\/wp\/v2\/comments?post=957"}],"version-history":[{"count":0,"href":"https:\/\/www.daycode.net\/api\/wp\/v2\/posts\/957\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.daycode.net\/api\/wp\/v2\/media?parent=957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.daycode.net\/api\/wp\/v2\/categories?post=957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.daycode.net\/api\/wp\/v2\/tags?post=957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}