本站首页    管理页面    写新日志    退出


«September 2025»
123456
78910111213
14151617181920
21222324252627
282930


公告
 本博客在此声明所有文章均为转摘,只做资料收集使用。

我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:
日志总数:1304
评论数量:2242
留言数量:5
访问次数:7621947
建立时间:2006年5月29日




[Django]TextIndexingAbstractionLayer
软件技术

lhwork 发表于 2007/2/1 11:53:15

IntroductionWhy do we need an abstraction layer for full-text indexing?Developers often must implement search methods for their database, but unfortunately so far it has been easier to roll your own simple search than to deploy an existing project such as Lucene. Merquery provides an abstraction layer for popular text indexing engines and makes it easy for anyone to attach them to their database. Using MerqueryYou can enable Lucene indexing of a database table like so (assuming the library is in contrib.search): from contrib.search.backends import LuceneIndexerclass Person(models.Model):   first_name = models.CharField(maxlength=30)   last_name = models.CharField(maxlength=30)   biography = models.TextField()indexer = LuceneIndexer('/tmp/person-index', Person,                       {'first': 'Person.first_name',                        'last': 'Person.last_name'},                       text_fields=['Person.biography']                      )indexer.update()indexer.search("brian -last:beck", order_by='last_name')Current StatusMerquery is in a working state but needs some polish. XapianIndexer? and LuceneIndexer? currently works fine and is about 90% complete. HypeIndexer? are not yet fully functional, this are about 50% complete. Note: You should see the ticket #2707 if you want use XapianIndexer?. More info from the author in this blog post.


阅读全文(1539) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.078 second(s), page refreshed 144787027 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号