JBoss Enterprise Web Platform 5

Hibernate Search Reference Guide

for Use with JBoss Enterprise Web Platform 5

Edition 5.1.1

Red Hat Documentation Group

Legal Notice

Copyright © 2011 Red Hat, Inc.
This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack Logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
June, 2011

Abstract

The Hibernate Search Reference Guide for JBoss Enterprise Web Platform 5 and its patch releases.
Preface
1. Document Conventions
1.1. Typographic Conventions
1.2. Pull-quote Conventions
1.3. Notes and Warnings
2. Getting Help and Giving Feedback
2.1. Do You Need Help?
2.2. Give us Feedback
1. Introduction
2. Getting started
2.1. System Requirements
2.2. Using Maven
2.3. Configuration
2.4. Indexing
2.5. Searching
2.6. Analyzer
2.7. What's next
3. Architecture
3.1. Overview
3.2. Back end
3.2.1. Back end types
3.2.2. Work execution
3.3. Reader strategy
3.3.1. Shared
3.3.2. Not-shared
3.3.3. Custom
4. Configuration
4.1. Directory configuration
4.2. Sharding indexes
4.3. Sharing indexes (two entities into the same directory)
4.4. Worker configuration
4.5. JMS Master/Slave configuration
4.5.1. Slave nodes
4.5.2. Master node
4.6. Reader strategy configuration
4.7. Enabling Hibernate Search and automatic indexing
4.7.1. Enabling Hibernate Search
4.7.2. Automatic indexing
4.8. Tuning Lucene indexing performance
4.9. LockFactory configuration
5. Mapping entities to the index structure
5.1. Mapping an entity
5.1.1. Basic mapping
5.1.2. Mapping properties multiple times
5.1.3. Embedded and associated objects
5.1.4. Boost factor
5.1.5. Dynamic boost factor
5.1.6. Analyzer
5.2. Property/Field Bridge
5.2.1. Built-in bridges
5.2.2. Custom Bridge
5.3. Providing your own id
5.3.1. The ProvidedId annotation
6. Querying
6.1. Building queries
6.1.1. Building a Lucene query
6.1.2. Building a Hibernate Search query
6.2. Retrieving the results
6.2.1. Performance considerations
6.2.2. Result size
6.2.3. ResultTransformer
6.2.4. Understanding results
6.3. Filters
6.4. Optimizing the query process
6.5. Native Lucene Queries
7. Manual indexing
7.1. Indexing
7.2. Purging
8. Index Optimization
8.1. Automatic optimization
8.2. Manual optimization
8.3. Adjusting optimization
9. Advanced features
9.1. SearchFactory
9.2. Accessing a Lucene Directory
9.3. Using an IndexReader
9.4. Customizing Lucene's scoring formula
A. Revision History