org.hibernate.search
Interface SearchFactory

All Known Subinterfaces:
SearchFactoryImplementor, SearchFactoryImplementorWithShareableState, SearchFactoryIntegrator
All Known Implementing Classes:
ImmutableSearchFactory, MutableSearchFactory

public interface SearchFactory

Provide application wide operations as well as access to the underlying Lucene resources.

Author:
Emmanuel Bernard, Hardy Ferentschik, Sanne Grinovero

Method Summary
 QueryContextBuilder buildQueryBuilder()
           
 org.apache.lucene.analysis.Analyzer getAnalyzer(Class<?> clazz)
          Retrieves the scoped analyzer for a given class.
 org.apache.lucene.analysis.Analyzer getAnalyzer(String name)
          Retrieve an analyzer instance by its definition name
 IndexReaderAccessor getIndexReaderAccessor()
          Provides access to the IndexReader API
 Statistics getStatistics()
          Retrieve the statistics instance for this factory.
 void optimize()
          Optimize all indexes
 void optimize(Class entityType)
          Optimize the index holding entityType
 

Method Detail

optimize

void optimize()
Optimize all indexes


optimize

void optimize(Class entityType)
Optimize the index holding entityType

Parameters:
entityType - the entity type (index) to optimize

getAnalyzer

org.apache.lucene.analysis.Analyzer getAnalyzer(String name)
Retrieve an analyzer instance by its definition name

Parameters:
name - the name of the analyzer
Returns:
analyzer with the specified name
Throws:
SearchException - if the definition name is unknown

getAnalyzer

org.apache.lucene.analysis.Analyzer getAnalyzer(Class<?> clazz)
Retrieves the scoped analyzer for a given class.

Parameters:
clazz - The class for which to retrieve the analyzer.
Returns:
The scoped analyzer for the specified class.
Throws:
IllegalArgumentException - in case clazz == null or the specified class is not an indexed entity.

buildQueryBuilder

QueryContextBuilder buildQueryBuilder()
Returns:
return a query builder providing a fluent API to create Lucene queries

getStatistics

Statistics getStatistics()
Retrieve the statistics instance for this factory.

Returns:
The statistics.

getIndexReaderAccessor

IndexReaderAccessor getIndexReaderAccessor()
Provides access to the IndexReader API

Returns:
the IndexReaderAccessor for this SearchFactory


Copyright © 2006-2013 Red Hat Middleware, LLC. All Rights Reserved