中文数据库检索

2017-08-20 16:17:59 jazdbmin1639整理 数据库检索 数据库检索

全文检索数据库

Q1: 所有全文数据库的检索行为以什么为最终目的

好处上面已经说了。最大的优点其实就是检索速度快,对服务器的负荷降低
缺点,如果说有的话,就是需要进行填充
上一次填充后,你增加的内容,直到你再次增量填充,否则是检索不到的。
你可以根据自己更新内容的频率设置调度来自动执行。

Q2: 以下哪些数据库是全文检索数据库

#一个完整的演示
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from whoosh.index import create_in
from whoosh.fields import *
from whoosh.analysis import RegexAnalyzer
analyzer = RegexAnalyzer(ur”([一-龥])|(\w+(\.?\w+)*)”)
schema = Schema(title=TEXT(stored=True), path=ID(stored=True), content=TEXT(stored=True, analyzer=analyzer))
ix = create_in(“indexdir”, schema)
writer = ix.writer()
writer.add_document(title=u”First document”, path=u”/a”,
content=u”This is the first document we’ve added!”)
writer.add_document(title=u”Second document”, path=u”/b”,
content=u”The second one 你 中文测试中文 is even more interesting!”)
writer.commit()
searcher = ix.searcher()
results = searcher.find(“content”, u”first”)
print results[0]
results = searcher.find(“content”, u”你”)
print results[0]
results = searcher.find(“content”, u”测试”)
print results[0]

小提示:内容仅供参考,如果您需解决具体问题(尤其法律、医学等领域),建议您详细咨询相关领域专业人士。

数据库检索 推荐文章:
推荐不满意?点这里  ››  

数据库检索