基于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