PyLucenePython搜索引擎
PyLucene 是 Python 語言用來訪問 Lucene 索引庫的封裝。通過 PyLucene 可以用來創(chuàng)建索引和對索引進(jìn)行搜索。PyLucene 使用 JCC 構(gòu)建。
示例說明:
Java 代碼:
for (int i = 0; i < hits.length(); i++) {
Document doc = hits.doc(i);
System.out.println(hits.score(i) + " : " + doc.get("title"));
}
而 Python 的代碼則是:
for hit in hits: hit = Hit.cast_(hit) print hit.getScore(), ':', hit.getDocument['title']
評論
圖片
表情
