{"id":152485,"date":"2020-09-06T23:24:22","date_gmt":"2020-09-06T15:24:22","guid":{"rendered":"http:\/\/4563.org\/?p=152485"},"modified":"2020-09-06T23:24:22","modified_gmt":"2020-09-06T15:24:22","slug":"python-whoosh-%e5%a6%82%e4%bd%95%e4%bc%98%e5%8c%96%e5%8a%a0%e9%80%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=152485","title":{"rendered":"Python whoosh \u5982\u4f55\u4f18\u5316\u52a0\u901f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Python whoosh \u5982\u4f55\u4f18\u5316\u52a0\u901f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lixuda <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u7b2c\u4e00\u6b21\u4f7f\u7528 whoosh \u6570\u636e\u91cf 300 \u4e07\u6761\uff0c\u7d22\u5f15\u540e 1.5G \u6587\u4ef6<\/p>\n<p>\u6839\u636e\u6587\u6863\u67e5\u8be2\uff0c\u65f6\u95f4\u7ecf\u5e38\u9700\u8981 7 \u79d2\u4ee5\u4e0a\uff0c\u95ee\u95ee\u5927\u795e\u5982\u4f55\u52a0\u901f\u4f18\u5316\u4e0b\uff1f\u611f\u8c22<\/p>\n<pre><code>    ix = open_dir(\"indexdir\")     with ix.searcher() as searcher:         myquery = Term(\"subject\", \"\u5173\u952e\u8bcd\")         results = searcher.search(myquery,limit=10)         for result1 in results:             print(dict(result1))          <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>20<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3194967\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : JasperYanky <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0a es                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194968\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wzw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u662f\u81ea\u5df1\u5199\uff0c\u5168\u90e8\u653e\u5185\u5b58\uff0c\u7528 fastapi                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194969\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : lixuda <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wzw \u80fd\u53c2\u8003\u4e0b\u5417\uff1f<br \/>\u5c0f\u767d\u7528\u6237\uff0c\u653e\u5185\u5b58\u600e\u4e48\u5199\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194970\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wzw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lixuda #3 \u4f60\u770b\u770b expiringdict \u6211\u8fd9\u4e2a\u65b9\u6cd5\u4e5f\u6709\u4e0d\u597d\u7684\u5730\u65b9, \u597d\u7684\u5730\u65b9\u662f \u5feb!                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194971\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sylvos <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             expiringdict \u600e\u4e48\u7528\uff0c\u6709\u591a\u5feb                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194972\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : lixuda <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wzw https:\/\/github.com\/mailgun\/expiringdict \u8fd9\u4e2a\uff1f\u5b57\u5178\u7f13\u5b58\uff1f\u80fd\u5426\u518d\u8be6\u7ec6\u70b9\uff0c\u975e\u5e38\u611f\u8c22                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194973\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhuangzhuang1988 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             pypy??<br \/>whoosh \u53cd\u6b63\u662f\u7eaf python \u7684.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194974\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : lixuda <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @zhuangzhuang1988 \u4e3b\u8981\u662f\u60f3\u786e\u8ba4\uff0c\u662f\u6211\u4f7f\u7528\u7684\u4e0d\u5bf9\uff0c\u8fd8\u662f\u672c\u6765\u5c31\u662f\u8fd9\u4e48\u6162\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194975\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nooper <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             2016 \u90a3\u90fd\u4e0d\u7ef4\u62a4\u4e86\uff0c\u4f60\u7528\u5b83\u5e72\u5565\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194976\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : lixuda <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nooper \u56fe\u5b83\u7b80\u5355\u65b9\u4fbf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194977\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nonduality <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6216\u8bb8\u4f60\u53ef\u4ee5\u770b\u4e0b whoosh \u7684\u7d22\u5f15\u6570\u636e\u7ed3\u6784\uff0c\u7136\u540e\u628a\u5b83\u6539\u4e3a\u4f7f\u7528 diskcache \u6216 redis \u505a\u7f13\u5b58\u540e\u7aef\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194978\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nonduality <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u4f60\u5728 Django \u4e0b\u4f7f\u7528 Whoosh\uff0c\u53ef\u4ee5\u8bd5\u4e0b Haystack \uff08\u6539\u8d77\u6765\u5e94\u8be5\u5f88\u5feb\uff09\uff0c\u770b\u662f\u4e0d\u662f\u4e5f\u8fd9\u4e48\u6162\uff0c\u662f\u5426\u5b58\u5728\u4e0d\u6070\u5f53\u4f7f\u7528\u7684\u5730\u65b9\u3002<\/p>\n<p>\u5982\u679c\u8fd8\u662f\u5f88\u6162\uff0c\u4f46\u53c8\u4e0d\u559c\u6b22 ES \u592a\u91cd\uff0c\u53ef\u4ee5\u8003\u8651\u7528 Xapian \u505a\u5f15\u64ce\uff0c\u4e0d\u8fc7\u5b83\u5bf9\u4e2d\u6587\u5206\u8bcd\u7684\u652f\u6301\u4f1a\u6709\u70b9\u9ebb\u70e6\uff0c\u77e5\u9053\u600e\u4e48\u641e\u7684\u8bdd\u9ebb\u70e6\u544a\u8bc9\u4e0b\u6211\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194979\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : lixuda <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nonduality \u73b0\u5728\u7528 flask+whoosh\uff0c\u76ee\u524d\u6d4b\u8bd5\u4e0b\u6765\uff0c20 \u4e07\u6761\u5728 1-3 \u79d2\uff0c200 \u4e07\uff0c\u5c31 7 \u79d2\u4ee5\u4e0a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194980\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nonduality <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lixuda Whoosh \u6709\u4e2a\u652f\u6301 GAE blobstore \u7684\u7d22\u5f15\u540e\u7aef\uff0c\u539f\u5219\u4e0a\u5728\u5b83\u57fa\u7840\u4e0a\u6539\u51fa\u4e00\u4e2a\u652f\u6301 Diskcache \u540e\u7aef\u7684\u7684\u4e0d\u592a\u96be\uff08 Diskcache \u5f88\u4e0d\u9519\uff0c\u7528\u78c1\u76d8\u505a\u7f13\u5b58\uff0c\u901f\u5ea6\u8ddf redis \u76f8\u5f53\uff09                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194981\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nonduality <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lixuda \u7ecf\u8fc7\u641c\u7d22\uff0c\u53d1\u73b0\u6709\u7bc7\u6587\u7ae0\u300c\u7528 xapian \u8ddf mmseg \u5b9e\u73b0\u4e2d\u6587\u641c\u7d22\u300d\u7684\u65b9\u6848\u5f88\u597d<\/p>\n<p>Xapian \u6bd4 Whoosh \u5feb 4 \u500d\u5230 60 \u500d\uff0c\u4e0a\u4ebf\u6761\u6570\u636e\u51e0\u79d2\u5185\u5c31\u80fd\u641e\u5b9a\uff0c\u5efa\u8bae\u4f60\u8bd5\u8bd5                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194982\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yucongo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             elasticsearch \u5427\uff0c\u79d2\u641c\uff0c\u4e5f\u5c31 1G \u786c\u76d8\u9700\u6c42                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194983\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nonduality <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u5df2\u7ecf\u6539\u597d\u51fa\u6765\u4e00\u4e2a\u57fa\u4e8e xapian \u7684\u641c\u7d22\u5f15\u64ce\uff0c\u901f\u5ea6\u786e\u5b9e\u5feb\u5f88\u591a\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194984\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : lixuda <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nonduality \u80fd\u5426\u5206\u4eab\u4e0b\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194985\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nonduality <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lixuda \u6211\u7684\u662f\u914d\u5408 django haystack \u7684 xapian \u540e\u7aef\u3002\u4f60\u53ef\u4ee5\u6839\u636e\u300c\u7528 xapian \u8ddf mmseg \u5b9e\u73b0\u4e2d\u6587\u641c\u7d22\u300d\u8fd9\u7bc7\u6587\u7ae0\u6539\uff0c\u6211\u7528\u7684\u662f jieba \u5206\u8bcd\uff0c\u7528\u8d77\u6765\u8fd8\u6bd4\u8f83\u65b9\u4fbf\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3194986\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mcds <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u65f6\u95f4\u5e94\u8be5\u90fd\u82b1\u5728 open_dir \u4e0a\u4e86\u5427\uff1f\u628a\u5b83\u505a\u6210 web \u670d\u52a1\u5e38\u9a7b\u5185\u5b58\u5c31\u597d\uff0c\u6211\u73b0\u5728\u7d22\u5f15\u6587\u4ef6\u5927\u6982\u5728 700m \u5de6\u53f3\uff0c\u67e5\u8be2\u65f6\u95f4 0.1s \u5de6\u53f3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Python whoosh \u5982\u4f55\u4f18&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/152485"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=152485"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/152485\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=152485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=152485"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=152485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}