Hibernate搜索框架 Hibernate Search 4.0.0.Beta1 發布

openkk 13年前發布 | 20K 次閱讀 Hibernate

Hibernate Search的作用是對數據庫中的數據進行檢索的。它是hibernate對著名的全文檢索系統Lucene的一個集成方案,作用在于對數據表中某些內容龐大的字段(如聲明為text的字段)建立全文索引,這樣通過hibernate search就可以對這些字段進行全文檢索后獲得相應的POJO,從而加快了對內容龐大字段進行模糊搜索的速度(sql語句中like匹配)。

Hibernate Search主要有以下功能特點:

1,功能強大,配置簡單 - 配置只需要修改persistence.xml(JPA),hibernate.cfg.xml(Hibernate)
2,支持Hibernate,以及EJB3 JPA標準應用
3,集成全文搜索引擎Lucene - Lucene是Apache項目組下的一個功能強大的全文搜索引擎項目
4,可以簡單透明索引查詢過的數據
5,支持復雜檢索 - 支持Wild Card(諸如*, ?等通配符號),多關鍵字,模糊查詢,排序等
6,支持Clustering
7,支持直接訪問Lucene API
8,對Lucene索引,API的高效管理

Hibernate Search運行的環境如下:

  • 1、JDK或JRE 5.0以上
  • 2、Hibernate-Search以及相應的依賴包
  • 3、Hibernate Core 3.2.X
  • 4、Hibernate Annotations 3.3.X

從 Alpha2 到 Beta1,今天 Hibernate Search 團隊很高興的發布了 4.0 的首個 Beta 版本,完整改進記錄請看 Jira release notes. 值得關注的改進有:

  • The parameter list of the annotation org.hibernate.search.annotation.Field has changed (HSEARCH-710, HSEARCH-711).
  • The annotation mixed the concepts of analyzing and storing of norms into a single index parameter (NO, TOKENIZED, UN_TOKENIZED and NO_NORMS).
  • There was no option for analyzed indexing while storing no norms and the terminology was using the term tokenizing instead of analyzing.
  • For this reason we changed the API and made the different choices more explicit:
     @Field(index=Index.YES|NO, analyze=Analyze.YES|NO, norms=Norms.YES|NO, ...) 
  • Another important API change is the ability to access an IndexReader by name (HSEARCH-903). For this purpose an new interface IndexReaderAccessor got introduced. It can be accessed via SearchFactory#getIndexReaderAccessor. The interface offers the following methods:
    public interface IndexReaderAccessor {
        IndexReader open(Class... entities);
    
        IndexReader open(String... indexNames);
    
        void close(IndexReader indexReader);
    }
  • Last but not least, you can now project on fields added by custom bridges (HSEARCH-890).

開發文檔:http://www.baiduhome.net/doc/search?q=Hibernate+&ft=all&od=0
下載地址: SourceForge

 本文由用戶 openkk 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!