没有合适的资源?快使用搜索试试~ 我知道了~
Hibernate3.4.X 代码快速查询 实体更快 更方便
需积分: 0 1 下载量 128 浏览量
2009-06-28
16:47:19
上传
评论
收藏 416KB PDF 举报
温馨提示
试读
96页
Hibernate3.4.X 代码快速查询 实体更快 更方便 SQL不在疲劳
资源详情
资源评论
资源推荐
Hibernate Search
Apache Lucene™ Integration
Reference Guide
3.1.1.GA
Hibernate Search
Hibernate 3.1.1.GA iii
Preface .......................................................................................................... v
1. Getting started ........................................................................................ 1
1.1. System Requirements ................................................................... 2
1.2. Using Maven .................................................................................. 3
1.3. Configuration ................................................................................. 5
1.4. Indexing ....................................................................................... 10
1.5. Searching ..................................................................................... 11
1.6. Analyzer ....................................................................................... 12
1.7. What's next .................................................................................. 15
2. Architecture .......................................................................................... 17
2.1. Overview ...................................................................................... 17
2.2. Back end ..................................................................................... 18
2.2.1. Back end types ................................................................. 18
2.2.1.1. Lucene ................................................................... 18
2.2.1.2. JMS ........................................................................ 19
2.2.2. Work execution ................................................................. 20
2.2.2.1. Synchronous .......................................................... 20
2.2.2.2. Asynchronous ......................................................... 20
2.3. Reader strategy ........................................................................... 20
2.3.1. Shared .............................................................................. 20
2.3.2. Not-shared ........................................................................ 21
2.3.3. Custom .............................................................................. 21
3. Configuration ........................................................................................ 23
3.1. Directory configuration ................................................................. 23
3.2. Sharding indexes ......................................................................... 25
3.3. Sharing indexes (two entities into the same directory) ................. 27
3.4. Worker configuration .................................................................... 28
3.5. JMS Master/Slave configuration .................................................. 29
3.5.1. Slave nodes ...................................................................... 29
3.5.2. Master node ...................................................................... 30
3.6. Reader strategy configuration ...................................................... 32
3.7. Enabling Hibernate Search and automatic indexing .................... 33
3.7.1. Enabling Hibernate Search ............................................... 33
3.7.2. Automatic indexing ............................................................ 34
3.8. Tuning Lucene indexing performance .......................................... 35
4. Mapping entities to the index structure ............................................. 39
4.1. Mapping an entity ........................................................................ 39
4.1.1. Basic mapping .................................................................. 39
4.1.2. Mapping properties multiple times .................................... 42
4.1.3. Embedded and associated objects ................................... 42
4.1.4. Boost factor ....................................................................... 47
4.1.5. Analyzer ............................................................................ 48
4.1.5.1. Analyzer definitions ................................................ 49
iv Hibernate 3.1.1.GA
4.1.5.2. Available analyzers ................................................ 51
4.1.5.3. Analyzer discriminator (experimental) .................... 52
4.1.5.4. Retrieving an analyzer ........................................... 55
4.2. Property/Field Bridge ................................................................... 56
4.2.1. Built-in bridges .................................................................. 56
4.2.2. Custom Bridge .................................................................. 58
4.2.2.1. StringBridge ............................................................ 58
4.2.2.2. FieldBridge ............................................................. 60
4.2.2.3. ClassBridge ............................................................ 63
4.3. Providing your own id .................................................................. 65
4.3.1. The ProvidedId annotation ................................................ 65
5. Querying ................................................................................................ 67
5.1. Building queries ........................................................................... 68
5.1.1. Building a Lucene query ................................................... 68
5.1.2. Building a Hibernate Search query ................................... 68
5.1.2.1. Generality ............................................................... 68
5.1.2.2. Pagination .............................................................. 69
5.1.2.3. Sorting .................................................................... 70
5.1.2.4. Fetching strategy .................................................... 70
5.1.2.5. Projection ............................................................... 71
5.2. Retrieving the results ................................................................... 72
5.2.1. Performance considerations ............................................. 73
5.2.2. Result size ........................................................................ 73
5.2.3. ResultTransformer ............................................................ 74
5.2.4. Understanding results ....................................................... 74
5.3. Filters ........................................................................................... 75
5.4. Optimizing the query process ...................................................... 80
5.5. Native Lucene Queries ................................................................ 80
6. Manual indexing ................................................................................... 81
6.1. Indexing ....................................................................................... 81
6.2. Purging ........................................................................................ 82
7. Index Optimization ............................................................................... 85
7.1. Automatic optimization ................................................................. 85
7.2. Manual optimization ..................................................................... 86
7.3. Adjusting optimization .................................................................. 86
8. Advanced features ............................................................................... 87
8.1. SearchFactory .............................................................................. 87
8.2. Accessing a Lucene Directory ..................................................... 87
8.3. Using an IndexReader ................................................................. 87
8.4. Customizing Lucene's scoring formula ........................................ 88
Hibernate 3.1.1.GA v
Preface
Full text search engines like Apache Lucene are very powerful technologies
to add efficient free text search capabilities to applications. However,
Lucene suffers several mismatches when dealing with object domain model.
Amongst other things indexes have to be kept up to date and mismatches
between index structure and domain model as well as query mismatches
have to be avoided.
Hibernate Search addresses these shortcomings - it indexes your domain
model with the help of a few annotations, takes care of database/index
synchronization and brings back regular managed objects from free
text queries. To achieve this Hibernate Search is combining the
power of Hibernate [http://www.hibernate.org] and Apache Lucene
[http://lucene.apache.org].
剩余95页未读,继续阅读
GeniusPK
- 粉丝: 1
- 资源: 179
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0