Python搜索引擎 PyLucene

fmms 12年前
     <p>PyLucene 是 Python 语言用来访问 <a href="http://www.open-open.com/lib/view/open1325236004827.html" target="_blank">Lucene </a>索引库的封装。通过 PyLucene 可以用来创建索引和对索引进行搜索。</p>    <p>示例说明:</p>    <p>Java 代码:</p>    <pre class="code">for (int i = 0; i < hits.length(); i++) {      Document doc = hits.doc(i);      System.out.println(hits.score(i) + " : " + doc.get("title")); }</pre>    <p>而 Python 的代码则是:</p>    <pre class="code">for hit in hits:     hit = Hit.cast_(hit)     print hit.getScore(), ':', hit.getDocument['title']</pre>    <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1325420124109" target="_blank">http://www.open-open.com/lib/view/home/1325420124109</a></p>