org.hibernate.search.impl
Class SearchFactoryImpl

java.lang.Object
  extended by org.hibernate.search.impl.SearchFactoryImpl
All Implemented Interfaces:
SearchFactoryImplementor, SearchFactory

public class SearchFactoryImpl
extends Object
implements SearchFactoryImplementor

Author:
Emmanuel Bernard

Constructor Summary
SearchFactoryImpl(SearchConfiguration cfg)
           
 
Method Summary
 void addClassToDirectoryProvider(Class<?> clazz, DirectoryProvider<?> directoryProvider)
           
 void addDirectoryProvider(DirectoryProvider<?> provider)
           
 void addIndexingParameters(DirectoryProvider<?> provider, LuceneIndexingParameters indexingParams)
           
 void addOptimizerStrategy(DirectoryProvider<?> provider, OptimizerStrategy optimizerStrategy)
           
 void close()
           
 org.apache.lucene.analysis.Analyzer getAnalyzer(Class clazz)
          Retrieves the scoped analyzer for a given class.
 org.apache.lucene.analysis.Analyzer getAnalyzer(String name)
          Experimental API retrieve an analyzer instance by its definition name
 BackendQueueProcessorFactory getBackendQueueProcessorFactory()
           
 Set<Class<?>> getClassesInDirectoryProvider(DirectoryProvider<?> directoryProvider)
           
 java.util.concurrent.locks.ReentrantLock getDirectoryProviderLock(DirectoryProvider<?> dp)
           
 Set<DirectoryProvider<?>> getDirectoryProviders()
           
 DirectoryProvider[] getDirectoryProviders(Class<?> entity)
          Provide access to the DirectoryProviders (hence the Lucene Directories) for a given entity In most cases, the returned type will be a one element array.
<T> DocumentBuilderContainedEntity<T>
getDocumentBuilderContainedEntity(Class<T> entityType)
           
<T> DocumentBuilderIndexedEntity<T>
getDocumentBuilderIndexedEntity(Class<T> entityType)
           
 Map<Class<?>,DocumentBuilderIndexedEntity<?>> getDocumentBuildersIndexedEntities()
           
 int getFilterCacheBitResultsSize()
           
 FilterCachingStrategy getFilterCachingStrategy()
           
 FilterDef getFilterDefinition(String name)
           
 Set<Class<?>> getIndexedTypesPolymorphic(Class<?>[] classes)
           
 LuceneIndexingParameters getIndexingParameters(DirectoryProvider<?> provider)
           
 String getIndexingStrategy()
           
 OptimizerStrategy getOptimizerStrategy(DirectoryProvider<?> provider)
           
 ReaderProvider getReaderProvider()
          Provide the configured readerProvider strategy, hence access to a Lucene IndexReader
 Worker getWorker()
           
 void optimize()
          Optimize all indexes
 void optimize(Class entityType)
          Optimize the index holding entityType
 void setBackendQueueProcessorFactory(BackendQueueProcessorFactory backendQueueProcessorFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchFactoryImpl

public SearchFactoryImpl(SearchConfiguration cfg)
Method Detail

getBackendQueueProcessorFactory

public BackendQueueProcessorFactory getBackendQueueProcessorFactory()
Specified by:
getBackendQueueProcessorFactory in interface SearchFactoryImplementor

setBackendQueueProcessorFactory

public void setBackendQueueProcessorFactory(BackendQueueProcessorFactory backendQueueProcessorFactory)
Specified by:
setBackendQueueProcessorFactory in interface SearchFactoryImplementor

getIndexingStrategy

public String getIndexingStrategy()
Specified by:
getIndexingStrategy in interface SearchFactoryImplementor

close

public void close()
Specified by:
close in interface SearchFactoryImplementor

addClassToDirectoryProvider

public void addClassToDirectoryProvider(Class<?> clazz,
                                        DirectoryProvider<?> directoryProvider)
Specified by:
addClassToDirectoryProvider in interface SearchFactoryImplementor

getClassesInDirectoryProvider

public Set<Class<?>> getClassesInDirectoryProvider(DirectoryProvider<?> directoryProvider)
Specified by:
getClassesInDirectoryProvider in interface SearchFactoryImplementor

getDocumentBuildersIndexedEntities

public Map<Class<?>,DocumentBuilderIndexedEntity<?>> getDocumentBuildersIndexedEntities()
Specified by:
getDocumentBuildersIndexedEntities in interface SearchFactoryImplementor

getDocumentBuilderIndexedEntity

public <T> DocumentBuilderIndexedEntity<T> getDocumentBuilderIndexedEntity(Class<T> entityType)
Specified by:
getDocumentBuilderIndexedEntity in interface SearchFactoryImplementor

getDocumentBuilderContainedEntity

public <T> DocumentBuilderContainedEntity<T> getDocumentBuilderContainedEntity(Class<T> entityType)
Specified by:
getDocumentBuilderContainedEntity in interface SearchFactoryImplementor

getDirectoryProviders

public Set<DirectoryProvider<?>> getDirectoryProviders()
Specified by:
getDirectoryProviders in interface SearchFactoryImplementor

getWorker

public Worker getWorker()
Specified by:
getWorker in interface SearchFactoryImplementor

addOptimizerStrategy

public void addOptimizerStrategy(DirectoryProvider<?> provider,
                                 OptimizerStrategy optimizerStrategy)
Specified by:
addOptimizerStrategy in interface SearchFactoryImplementor

addIndexingParameters

public void addIndexingParameters(DirectoryProvider<?> provider,
                                  LuceneIndexingParameters indexingParams)
Specified by:
addIndexingParameters in interface SearchFactoryImplementor

getOptimizerStrategy

public OptimizerStrategy getOptimizerStrategy(DirectoryProvider<?> provider)
Specified by:
getOptimizerStrategy in interface SearchFactoryImplementor

getIndexingParameters

public LuceneIndexingParameters getIndexingParameters(DirectoryProvider<?> provider)
Specified by:
getIndexingParameters in interface SearchFactoryImplementor

getReaderProvider

public ReaderProvider getReaderProvider()
Description copied from interface: SearchFactory
Provide the configured readerProvider strategy, hence access to a Lucene IndexReader

Specified by:
getReaderProvider in interface SearchFactory

getDirectoryProviders

public DirectoryProvider[] getDirectoryProviders(Class<?> entity)
Description copied from interface: SearchFactory
Provide access to the DirectoryProviders (hence the Lucene Directories) for a given entity In most cases, the returned type will be a one element array. But if the given entity is configured to use sharded indexes, then multiple elements will be returned. In this case all of them should be considered.

Specified by:
getDirectoryProviders in interface SearchFactory

optimize

public void optimize()
Description copied from interface: SearchFactory
Optimize all indexes

Specified by:
optimize in interface SearchFactory

optimize

public void optimize(Class entityType)
Description copied from interface: SearchFactory
Optimize the index holding entityType

Specified by:
optimize in interface SearchFactory

getAnalyzer

public org.apache.lucene.analysis.Analyzer getAnalyzer(String name)
Description copied from interface: SearchFactory
Experimental API retrieve an analyzer instance by its definition name

Specified by:
getAnalyzer in interface SearchFactory

getAnalyzer

public org.apache.lucene.analysis.Analyzer getAnalyzer(Class clazz)
Description copied from interface: SearchFactory
Retrieves the scoped analyzer for a given class.

Specified by:
getAnalyzer in interface SearchFactory
Parameters:
clazz - The class for which to retrieve the analyzer.
Returns:
The scoped analyzer for the specified class.

getFilterCachingStrategy

public FilterCachingStrategy getFilterCachingStrategy()
Specified by:
getFilterCachingStrategy in interface SearchFactoryImplementor

getFilterDefinition

public FilterDef getFilterDefinition(String name)
Specified by:
getFilterDefinition in interface SearchFactoryImplementor

getDirectoryProviderLock

public java.util.concurrent.locks.ReentrantLock getDirectoryProviderLock(DirectoryProvider<?> dp)
Specified by:
getDirectoryProviderLock in interface SearchFactoryImplementor

addDirectoryProvider

public void addDirectoryProvider(DirectoryProvider<?> provider)
Specified by:
addDirectoryProvider in interface SearchFactoryImplementor

getFilterCacheBitResultsSize

public int getFilterCacheBitResultsSize()
Specified by:
getFilterCacheBitResultsSize in interface SearchFactoryImplementor

getIndexedTypesPolymorphic

public Set<Class<?>> getIndexedTypesPolymorphic(Class<?>[] classes)
Specified by:
getIndexedTypesPolymorphic in interface SearchFactoryImplementor