Table of Contents
Preface ............................................................................................................................................iv
1. Getting started ............................................................................................................................1
1.1. System Requirements .........................................................................................................1
1.2. Using Maven .....................................................................................................................1
1.3. Configuration .....................................................................................................................2
1.4. Indexing ............................................................................................................................5
1.5. Searching ...........................................................................................................................6
1.6. Analyzer ............................................................................................................................7
1.7. What's next ........................................................................................................................9
2. Architecture .............................................................................................................................. 10
2.1. Overview ......................................................................................................................... 10
2.2. Back end ......................................................................................................................... 10
2.2.1. Back end types ...................................................................................................... 11
2.2.1.1. Lucene ....................................................................................................... 11
2.2.1.2. JMS ........................................................................................................... 11
2.2.2. Work execution ..................................................................................................... 12
2.2.2.1. Synchronous ............................................................................................... 12
2.2.2.2. Asynchronous ............................................................................................ 13
2.3. Reader strategy ................................................................................................................ 13
2.3.1. Shared .................................................................................................................. 13
2.3.2. Not-shared ............................................................................................................ 13
2.3.3. Custom ................................................................................................................. 13
3. Configuration ............................................................................................................................ 14
3.1. Directory configuration .................................................................................................... 14
3.2. Sharding indexes .............................................................................................................. 16
3.3. Sharing indexes (two entities into the same directory) ......................................................... 17
3.4. Worker configuration ....................................................................................................... 17
3.5. JMS Master/Slave configuration ........................................................................................ 18
3.5.1. Slave nodes ........................................................................................................... 19
3.5.2. Master node .......................................................................................................... 20
3.6. Reader strategy configuration ............................................................................................ 21
3.7. Enabling Hibernate Search and automatic indexing ............................................................ 21
3.7.1. Enabling Hibernate Search ..................................................................................... 21
3.7.2. Automatic indexing ............................................................................................... 22
3.8. Tuning Lucene indexing performance ................................................................................ 22
4. Mapping entities to the index structure ..................................................................................... 26
4.1. Mapping an entity ............................................................................................................ 26
4.1.1. Basic mapping ....................................................................................................... 26
4.1.2. Mapping properties multiple times .......................................................................... 28
4.1.3. Embedded and associated objects ........................................................................... 28
4.1.4. Boost factor .......................................................................................................... 31
4.1.5. Analyzer ............................................................................................................... 32
4.1.5.1. Analyzer definitions .................................................................................... 33
4.1.5.2. Available analyzers ..................................................................................... 34
4.1.5.3. Analyzer discriminator (experimental) ......................................................... 35
4.1.5.4. Retrieving an analyzer ................................................................................ 36
4.2. Property/Field Bridge ....................................................................................................... 37
4.2.1. Built-in bridges ..................................................................................................... 37
Hibernate 3.1.0.GA ii
评论0