PyLucene - Python搜索引擎
Apache
跨平台
Python
软件简介
PyLucene 是 Python 语言用来访问 Lucene 索引库的封装。通过 PyLucene
可以用来创建索引和对索引进行搜索。PyLucene 使用 JCC 构建。
示例说明:
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']