{"id":118337,"date":"2018-08-31T08:42:27","date_gmt":"2018-08-31T00:42:27","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=118337"},"modified":"2018-08-30T14:44:05","modified_gmt":"2018-08-30T06:44:05","slug":"sphinx-introduction","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/sphinx-introduction.html","title":{"rendered":"\u89e3\u5bc6sphinx\u5206\u5e03\u5f0f\u7d22\u5f15"},"content":{"rendered":"

sphinx\u5206\u5e03\u5f0f\u7d22\u5f15\u539f\u7406\uff1a
\n\u5f53searchd\u6536\u5230\u4e00\u4e2a\u5bf9\u5206\u5e03\u5f0f\u7d22\u5f15\u7684\u67e5\u8be2\u65f6\uff0c\u5b83\u505a\u5982\u4e0b\u64cd\u4f5c\uff1a\u8fde\u63a5\u5230\u8fdc\u7a0b\u4ee3\u7406\u6267\u884c\u67e5\u8be2\uff08\u5728\u8fdc\u7a0b\u4ee3\u7406\u6267\u884c\u641c\u7d22\u7684\u540c\u65f6\uff09\u5bf9\u672c\u5730\u7d22\u5f15\u8fdb\u884c\u67e5\u8be2\u63a5\u6536\u6765\u81ea\u8fdc\u7a0b\u4ee3\u7406\u7684\u641c\u7d22\u7ed3\u679c\u5c06\u6240\u6709\u7ed3\u679c\u5408\u5e76\uff0c\u5220\u9664\u91cd\u590d\u9879\u5c06\u5408\u5e76\u540e\u7684\u7ed3\u679c\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u3002\u5728\u5e94\u7528\u7a0b\u5e8f\u770b\u6765\uff0c\u666e\u901a\u7d22\u5f15\u548c\u5206\u5e03\u5f0f\u7d22\u5f15\u5b8c\u5168\u6ca1\u6709\u533a\u522b\u3002\u4efb\u4e00\u4e2asearchd\u5b9e\u4f8b\u53ef\u4ee5\u540c\u65f6\u505a\u4e3a\u4e3b\u63a7\u7aef\uff08master\uff0c\u5bf9\u641c\u7d22\u7ed3\u679c\u505a\u805a\u5408\uff09\u548c\u4ece\u5c5e\u7aef\uff08\u53ea\u505a\u672c\u5730\u641c\u7d22\uff09\u3002\u8fd9\u6709\u5982\u4e0b\u51e0\u70b9\u597d\u5904\uff1a
\n1. \u96c6\u7fa4\u4e2d\u7684\u6bcf\u53f0\u673a\u5668\u90fd\u53ef\u4ee5\u505a\u4e3a\u4e3b\u63a7\u7aef\u6765\u641c\u7d22\u6574\u4e2a\u96c6\u7fa4\uff0c\u641c\u7d22\u8bf7\u6c42\u53ef\u4ee5\u5728\u4e3b\u63a7\u7aef\u4e4b\u95f4\u83b7\u5f97\u8d1f\u8f7d\u5e73\u8861\uff0c\u76f8\u5f53\u4e8e\u5b9e\u73b0\u4e86\u4e00\u79cdHA\uff08high availability\uff0c\u9ad8\u53ef\u7528\u6027\uff09\uff0c\u53ef\u4ee5\u5e94\u5bf9\u67d0\u4e2a\u8282\u70b9\u5931\u6548\u7684\u60c5\u51b5\u3002
\n2. \u5982\u679c\u5728\u5355\u53f0\u591aCPU\u6216\u591a\u6838\u673a\u5668\u4e0a\u4f7f\u7528\uff0c\u4e00\u4e2a\u505a\u4e3a\u4ee3\u7406\u5bf9\u672c\u673a\u8fdb\u884c\u641c\u7d22\u7684searchd\u5b9e\u4f8b\u5c31\u53ef\u4ee5\u5229\u7528\u5230\u5168\u90e8\u7684CPU\u6216\u8005\u6838\u3002\u66f4\u597d\u7684HA\u652f\u6301\u5df2\u5728\u8ba1\u5212\u4e4b\u4e2d\uff0c\u5230\u65f6\u5c06\u5141\u8bb8\u6307\u5b9a\u54ea\u4e9b\u4ee3\u7406\u4e4b\u95f4\u4e92\u76f8\u5907\u4efd\u3001\u6709\u6548\u6027\u68c0\u67e5\u3001\u8ddf\u8e2a\u8fd0\u884c\u4e2d\u7684\u4ee3\u7406\u3001\u5bf9\u68c0\u7d22\u8bf7\u6c42\u8fdb\u884c\u8d1f\u8f7d\u5747\u8861\uff0c\u7b49\u7b49\u3002
\nsphinx\u5206\u5e03\u5f0f\u7d22\u5f15\u914d\u7f6e\uff1a<\/p>\n

index dist1{ # local index to be searched # there can be many local indexes configured local = test1 local = test1stemmed # remote agent # multiple remote agents may be specified # syntax for TCP connections is 'hostname:port:index1,[index2[,...]]' # syntax for local UNIX connections is '\/path\/to\/socket:index1,[index2[,...]]' agent = localhost:9313:remote1 agent = localhost:9314:remote2,remote3 # agent = \/var\/run\/searchd.sock:remote4 # blackhole remote agent, for debugging\/testing # network errors and search results will be ignored # agent_blackhole = testbox:9312:testindex1,testindex2 # remote agent connection timeout, milliseconds # optional, default is 1000 ms, ie. 1 sec agent_connect_timeout = 1000 # remote agent query timeout, milliseconds # optional, default is 3000 ms, ie. 3 sec agent_query_timeout = 3000}<\/pre>\n

\u539f\u7406\u548c\u914d\u7f6e\u8fd8\u662f\u6bd4\u8f83\u7b80\u5355\u7684\uff0c\u5bf9\u4e8e\u7d22\u5f15\u6587\u4ef6\u8fc7\u5927\u7684\u60c5\u51b5\uff0c\u5206\u5e03\u5f0f\u7d22\u5f15\u975e\u5e38\u6709\u7528\u3002\u4f46\u662f\u78b0\u5230\u641c\u7d22\u91cf\u975e\u5e38\u5927\u7684\u65f6\u5019\uff0c\u5206\u5e03\u5f0f\u7d22\u5f15\u5c31\u663e\u5f97\u529b\u4e0d\u4ece\u5fc3\u4e86\u3002\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u505a\u7d22\u5f15\u590d\u5236\u4e86\u3002\u7d22\u5f15\u590d\u5236\u540c\u6b65\u7684\u95ee\u9898\u4e00\u822c\u91c7\u7528\u7684\u65b9\u6848\u6709\u4e24\u79cd\u3002
\n\u7b2c\u4e00\u79cd\u65b9\u6848\u662f\u4e3b\u4ece\u540c\u6b65\u3002\u6709\u4e00\u4e2a\u4e3b\u641c\u7d22\u670d\u52a1\u5668\u548c\u591a\u4e2a\u4ece\u641c\u7d22\u670d\u52a1\u5668\u3002\u5728\u4e3b\u641c\u7d22\u670d\u52a1\u5668\u4e0a\u751f\u6210\u7684\u589e\u91cf\u7d22\u5f15\u4f1a\u540c\u6b65\u4ece\u7d22\u5f15\u670d\u52a1\u5668\u3002\u4ece\u800c\u8fbe\u5230\u4e3b\u4ece\u540c\u6b65\u3002\u4e3a\u4e86\u907f\u514d\u7f51\u7edc\u6216\u8005\u5176\u4ed6\u60c5\u51b5\u5bfc\u81f4\u7684\u589e\u91cf\u7d22\u5f15\u4e0d\u540c\u6b65\u7684\u60c5\u51b5\uff0c\u9700\u8981\u5b9a\u671f\u5728\u4e00\u4e2a\u9636\u6bb5\u628a\u4e3b\u4ece\u670d\u52a1\u5668\u7684\u4e3b\u7d22\u5f15\u540c\u6b65\u4e00\u6b21\u3002\u65b0\u589e\u52a0\u641c\u7d22\u670d\u52a1\u5668\u7684\u8bdd\u9700\u8981\u5728\u589e\u91cf\u7d22\u5f15\u751f\u6210\u7684\u95f4\u9694\u6570\u636e\u53bb\u62f7\u8d1d\u5176\u4ed6\u641c\u7d22\u670d\u52a1\u5668\u7684\u4e3b\u7d22\u5f15\u3002
\n\u7b2c\u4e8c\u79cd\u65b9\u6848\u662f\u6bcf\u4e2a\u641c\u7d22\u670d\u52a1\u5668\u6839\u636e\u589e\u91cf\u6570\u636e\u53bb\u751f\u6210\u589e\u91cf\u7d22\u5f15\u3002\u901a\u8fc7\u8868\u6765\u8bb0\u5f55\u4e0d\u540c\u7684\u641c\u7d22\u670d\u52a1\u5668\u662f\u5426\u751f\u6210\u589e\u91cf\u7d22\u5f15\u3002\u6765\u8fbe\u5230\u540c\u6b65\u7684\u76ee\u7684\u3002\u65b0\u589e\u52a0\u641c\u7d22\u670d\u52a1\u5668\u7684\u8bdd\uff0c\u5c31\u9700\u8981\u53bb\u6bd4\u5386\u53f2\u4e0a\u6240\u6709\u7684\u589e\u91cf\u6570\u636e\u5168\u90e8\u751f\u6210\u4e00\u904d\u3002
\n\u8fd9\u4e24\u79cd\u7b56\u7565\u90fd\u662f\u53ef\u884c\u7684\u3002\u589e\u91cf\u6570\u636e\u5728\u4e00\u5b9a\u65f6\u95f4\u6bb5\u91cf\u5f88\u5927\u7684\u8bdd\u5efa\u8bae\u7528\u7b2c\u4e00\u79cd\u65b9\u6848\uff0c\u5426\u5219\u7528\u7b2c\u4e8c\u79cd\u65b9\u6848\u3002<\/p>\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/blog.csdn.net\/u013699800\/article\/details\/47788165<\/a><\/span><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttps:\/\/lrxjmw.cn\/sphinx-introduction<\/span>.html<\/a><\/span> \u200e\u7f16\u8f91\uff1a\u8d3e\u6625\u534e\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

sphinx\u5206\u5e03\u5f0f\u7d22\u5f15\u539f\u7406\uff1a \u5f53searchd\u6536\u5230\u4e00\u4e2a\u5bf9\u5206\u5e03\u5f0f\u7d22\u5f15\u7684\u67e5\u8be2\u65f6\uff0c\u5b83\u505a\u5982\u4e0b\u64cd\u4f5c\uff1a\u8fde\u63a5\u5230\u8fdc\u7a0b\u4ee3\u7406\u6267\u884c\u67e5 […]<\/p>\n","protected":false},"author":63,"featured_media":114917,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-118337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/118337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=118337"}],"version-history":[{"count":10,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/118337\/revisions"}],"predecessor-version":[{"id":118702,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/118337\/revisions\/118702"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/114917"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=118337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=118337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=118337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}