Lucene
文章平均质量分 81
thundersssss
专注于通用搜索引擎算法,垂直搜索引擎
展开
-
Lucene 倒排原理
Lucene 的索引排序是使用了倒排序原理。 该结构及相应的生成算法如下: 设有两篇文章1和2 文章1的内容为:Tom lives in Guangzhou,I live in Guangzhou too. 文章2的内容为:He once lived in Shanghai. 1. 由于lucene是基于关键词索引和查询的,首先我们要取得这两篇文章的关键词,通常我们需要如下处理措施 a.原创 2009-09-16 16:10:00 · 860 阅读 · 0 评论 -
Lucene的排序算法
公式: 1 tf(t in d) term frequency与term的出现次数(frequency)有关系(correlate to),定义为(defined as)term t在当前算分(currently scored)的文档d中出现(appear in)的次数(number of times)。对一个给定(gived)的t原创 2009-09-16 16:12:00 · 6418 阅读 · 1 评论 -
LUCENE 2.9 如何正常读取压缩后的整形,长整形及浮点数值?(解读 Invalid shift value in prefixCoded string 异常)
今天有一个需要从索引中读取数值型数据的需求,然后就轻车熟路写了如下代码: Document doc2 = ir.document(counter);sb.append(doc2.get(field)); 结果竟发现读出的数据为 null !!!??? 一番GOOGLE,刚开始还觉得新的版本对LUCENE做了较大改动,为了提升整形,浮点的检索及排序效率,LUCENE使用了原创 2010-03-05 16:46:00 · 4553 阅读 · 3 评论 -
Lucene2.9 TokenStream新的遍历方法
TermAttribute termAtt = (TermAttribute) tokenStream.getAttribute(TermAttribute.class); TypeAttribute typeAtt = (TypeAttribute) tokenStream.getAttribute(TypeAttribute.class);转载 2010-03-10 18:04:00 · 1051 阅读 · 1 评论