基於lucene搜索引擎的Hibernate Search,官方文檔翻譯
由於自己的項目需要用到搜索引擎,於是想到使用lucene,封裝了lucene的框架有compass,solr,hibernate search.
網上對這些框架的描述有:
-
Compass:是在Lucene的基礎上做了封裝,支持索引事務控製和增量索引,同時也能夠和主流的SSH框架完美地整合在一起,操作Compass類似於操作Hibernate,它們的類/方法等設計的非常相似。
項目主頁:https://www.compass-project.org/
該項目已經很久沒有更新維護了,官方網站顯示最後維護時間在2009-04-06
-
Solr:同樣由Apache軟件基金會提供和支持,基於Lucene的全文搜索服務器,采用Java5開發。同時對其進行了擴展,提供了比Lucene更為豐富的查詢語言,同時實現了可配置、可擴展並對查詢性能進行了優化,並且提供了一個完善的功能管理界麵,是一款非常優秀的全文搜索引擎。
Solr是一個獨立的企業級搜索應用服務器,它對外提供類似於Web-service的API接口。用戶可以通過http請求,向搜索引擎服務器提交一定格式的XML文件,生成索引;也可以通過Http Get操作提出查找請求,並得到XML格式的返回結果
-
Hibernate Search:基於Lucene的基礎上建立的主要用於Hibernate的持久化模型的全文檢索工具。像Lucene這樣的檢索引擎能夠給我們的項目在進行檢索的時候帶來非常高的效率,但是它們在基於對象的檢索時會有一些問題,比如不能實現檢索內容跟實體的轉換,Hibernate Search正是在這樣的情況下發展起來的,基於對象的檢索引擎,能夠很方便的將檢索出來的內容轉換為具體的POJO(實體對象)。此外Hibernate Search能夠根據需要進行同步或異步的索引更新。
我的項目使用的開發語言是java,搭配ssh框架的j2ee應用。所以我選用hibernate search.方便快捷,開箱即用、
學習參考資料是通過官方的文檔。
網上好像沒有中文文檔的翻譯。找到了一個是3.3版本,別人翻譯的。是從第4章開始翻譯。
還搜到一個https://wiki.redsaga.com,但是不知道為什麼不能訪問,翻牆了也不行
現在已經是到4.2 Final,所以我從第一章開始邊學邊翻譯吧。第4章以後就參考上麵那個兄弟翻譯的,綜合自己的吧。
接下來我會不定期的更新翻譯的章節...
有朋友覺得翻譯不妥,需要更改的地方可以給我留言、
- Preface
- 1. Getting started
- 2. Architecture
- 3. Configuration
-
- 3.1. Enabling Hibernate Search and automatic indexing
- 3.2. Configuring the IndexManager
- 3.3. Directory configuration
- 3.4. Worker configuration
- 3.5. Reader strategy configuration
- 3.6. Tuning Lucene indexing performance
- 3.7. LockFactory configuration
- 3.8. Exception Handling Configuration
- 3.9. Index format compatibility
- 4. Mapping entities to the index structure
-
- 4.1. Mapping an entity
- 4.2. Boosting
- 4.3. Analysis
- 4.4. Bridges
- 4.5. Conditional indexing: to index or not based on entity state
- 4.6. Providing your own id
- 4.7. Programmatic API
-
- 4.7.1. Mapping an entity as indexable
- 4.7.2. Adding DocumentId to indexed entity
- 4.7.3. Defining analyzers
- 4.7.4. Defining full text filter definitions
- 4.7.5. Defining fields for indexing
- 4.7.6. Programmatically defining embedded entities
- 4.7.7. Contained In definition
- 4.7.8. Date/Calendar Bridge
- 4.7.9. Defining bridges
- 4.7.10. Mapping class bridge
- 4.7.11. Mapping dynamic boost
- 5. Querying
- 6. Manual index changes
- 7. Index Optimization
- 8. Monitoring
- 9. Spatial
- 10. Advanced features
- 11. Further reading
最後更新:2017-04-03 18:52:02