基于Redis的Python搜索引擎 pyredise
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
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
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
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 个回复