Lucene学习笔记

  最近用Lucene开发全文检索。《Lucene in Action》这本书用的是Lucene 1.4。我自己下的是最新的2.1。然后就发现了很多不同的地方。

 Field没了Keyword、UnIndexed、UnStored、Text这几个静态成员,只能用
Field(String, String, Store, Index)。
Keyword对应Field.Store.YES, Field.Index.UN_TOKENIZED,
UnIndexed 对应Field.Store.YES, Field.Index.NO,
UnStored对应Field.Store.NO, Field.Index.TOKENIZED,
Text对应Field.Store.YES, Field.Index.TOKENIZED。

FSDirectory.getDirectory的有两个参数的变成了depresed 了。现在要用只有一个参数的。

BooleanQuery的add方法也变了。原来是用两个boolean值组合的,现在 使用BooleanClause.Occur的几个静态成员了。

暂时就发现这点差异。

 

4 thoughts on “Lucene学习笔记

  1. DigitalSonic March 13, 2007 / 11:37 am

    我也用lucene,网上的大多数文档的确是1.4的,但其实变化也没想像的大,结合javadoc看看很快就知道了。。。有很多东西是看了api才知道的,文档可没写这些。

  2. guRuQu March 13, 2007 / 10:24 am

    Apache Lucene现在好像把重点放在他的一个怪怪的Query Language上面了,估计那一块是变化最快的地方把。 赞一个,竟然去blogBus工作了,开心啊!

  3. D.c. March 10, 2007 / 2:23 pm

    看书->看文档->看代码
    必然的趋势

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s