浏览:516 2008-05-26 13:59 来自 雨中漫步的太阳      :

lucene2.3 中增加了 MemoryIndex,这个类根据lucene的api的实例如下:

Analyzer analyzer = PatternAnalyzer.DEFAULT_ANALYZER;
//Analyzer analyzer = new SimpleAnalyzer();
MemoryIndex index = new MemoryIndex();
index.addField("content", "Readings about Salmons and other select Alaska fishing Manuals", analyzer);
index.addField("author", "Tales of James", analyzer);
QueryParser parser = new QueryParser("content", analyzer);
float score = index.search(parser.parse("+author:james +salmon~ +fish* manual~"));
if (score > 0.0f) {
     System.out.println("it's a match");
} else {
     System.out.println("no match found");
}
System.out.println("indexData=" + index.toString());

 似乎是将Ramdictory 和IndexSerarch 两个类的一些功能给合并了.但是MemoryIndex 能不能将内存中的索引合并到Fsdictory中呢?

收藏 楼主
  4个月前  shenjk      :
.net 的还是java版的。http://incubator.apache.org/lucene.net/ 中没找到2.3
1楼 回到顶楼 
  4个月前  雨中漫步的太阳      :
java版本
2楼 回到顶楼 

注册用户登录后才能回复,登录注册
> 返回“Lucene”


其他话题

相关内容

相关链接

1 29044