Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hibernate.search
Interface SearchFactory

All Known Subinterfaces:
  SearchFactoryImplementor

All Known Implementing Classes:
  SearchFactoryImpl

    public interface SearchFactory

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

Author:
  Emmanuel Bernard

Method Summary
`QueryContextBuilder` | `buildQueryBuilder()` Return a query builder providing a fluent API to create Lucene queries
`org.apache.lucene.analysis.Analyzer` | `getAnalyzer(java.lang.Class<?> clazz)` Retrieves the scoped analyzer for a given class.
`org.apache.lucene.analysis.Analyzer` | `getAnalyzer(java.lang.String name)` Experimental API retrieve an analyzer instance by its definition name
`DirectoryProvider[]` | `getDirectoryProviders(java.lang.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.
`ReaderProvider` | `getReaderProvider()` Provide the configured readerProvider strategy, hence access to a Lucene IndexReader
`void` | `optimize()` Optimize all indexes
`void` | `optimize(java.lang.Class entityType)` Optimize the index holding `entityType`

Method Detail

### getReaderProvider

    ReaderProvider getReaderProvider()

  Provide the configured readerProvider strategy, hence access to a Lucene IndexReader

### getDirectoryProviders

    DirectoryProvider[] getDirectoryProviders(java.lang.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. 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.

### optimize

    void optimize()

  Optimize all indexes

### optimize

    void optimize(java.lang.Class entityType)

  Optimize the index holding `entityType`

### getAnalyzer

    org.apache.lucene.analysis.Analyzer getAnalyzer(java.lang.String name)

  Experimental API retrieve an analyzer instance by its definition name

  Throws:
    `SearchException` - if the definition name is unknown

### getAnalyzer

    org.apache.lucene.analysis.Analyzer getAnalyzer(java.lang.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:
    `java.lang.IllegalArgumentException` - in case `clazz == null` or the specified class is not an indexed entity.

### buildQueryBuilder

    QueryContextBuilder buildQueryBuilder()

  Return a query builder providing a fluent API to create Lucene queries

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2010 Hibernate. All Rights Reserved.