基于Redis的Python搜索引擎 pyredise

Apache
Python
跨平台
2012-04-29
红薯

pyredise 是一个基于 Python 和 Redis 的简单快速的搜索引擎。

示例代码:

import query_handler
import redis
db = = redis.Redis(host='localhost', port=6379, db=0)
QH = query_handler.QueryHandler(db=db)

# issue some queries, returning a list of tuples such as [(doc_id1, score1), (doc_id2, score2), ...]
print QH.process_query("google security data /pure_tfidf") # ranking only according to tf-idf
print QH.process_query("google security data /complete") # complete
print QH.process_query("google security data /title_only") # search in titles
加载中

评论(0)

暂无评论

暂无资讯

暂无问答

暂无博客

返回顶部
顶部