org.hibernate.search.cfg.spi

## Interface SearchConfiguration

- All Known Implementing Classes:
    IncrementalSearchConfiguration, ReflectionReplacingSearchConfiguration, SearchConfigurationBase, SearchConfigurationFromHibernateCore

      public interface SearchConfiguration

  Provides configuration to Hibernate Search. This is the entry point for bootstrapping Search.
  Author:
    Navin Surtani - navin@surtani.org, Emmanuel Bernard, Hardy Ferentschik

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default BeanResolver` | `getBeanResolver()`
    `ClassLoaderService` | `getClassLoaderService()`
    `Class<?>` | `getClassMapping(String name)` Returns a `Class` from a String parameter.
    `Iterator<Class<?>>` | `getClassMappings()` Returns an iterator over the list of indexed classes
    `InstanceInitializer` | `getInstanceInitializer()` Returns the initializer to be used to initialize potentially lazy entities or collections.
    `SearchMapping` | `getProgrammaticMapping()`
    `Properties` | `getProperties()` Gets properties as a java.util.Properties object.
    `String` | `getProperty(String propertyName)` Gets a configuration property from its name or null if not present
    `Map<Class<? extends Service>,Object>` | `getProvidedServices()` Return the provided services.
    `org.hibernate.annotations.common.reflection.ReflectionManager` | `getReflectionManager()` Returns a reflection manager if already available in the environment null otherwise
    `boolean` | `isDeleteByTermEnforced()`
    `boolean` | `isIdProvidedImplicit()`
    `boolean` | `isIndexMetadataComplete()`
    `boolean` | `isJPAAnnotationsProcessingEnabled()`
    `boolean` | `isMultitenancyEnabled()`
    `boolean` | `isTransactionManagerExpected()` By default Hibernate Search expects to execute in the context of a transaction, and will log warning when certain operations are executed out of such a scope.

- - ### Method Detail

    - #### getClassMappings

          Iterator<Class<?>> getClassMappings()

      Returns an iterator over the list of indexed classes
      Returns:
        iterator of indexed classes.

    - #### getClassMapping

          Class<?> getClassMapping(String name)

      Returns a `Class` from a String parameter.
      Parameters:
        `name` - the class name as string
      Returns:
        corresponding class instance

    - #### getProperty

          String getProperty(String propertyName)

      Gets a configuration property from its name or null if not present
      Parameters:
        `propertyName` - - as a String.
      Returns:
        the property as a String

    - #### getProperties

          Properties getProperties()

      Gets properties as a java.util.Properties object.
      Returns:
        a java.util.Properties object.
      See Also:
        `object`

    - #### getReflectionManager

          org.hibernate.annotations.common.reflection.ReflectionManager getReflectionManager()

      Returns a reflection manager if already available in the environment null otherwise
      Returns:
        ReflectionManager

    - #### getProgrammaticMapping

          SearchMapping getProgrammaticMapping()

      Returns:
        the programmatic configuration or `null`

    - #### getProvidedServices

          Map<Class<? extends Service>,Object> getProvidedServices()

      Return the provided services. These services are passed untouched by Hibernate Search. Provided services have priority over managed services (ie the ones using the service locator pattern).
      Returns:
        a map of service roles to service instances

    - #### isTransactionManagerExpected

          boolean isTransactionManagerExpected()

      By default Hibernate Search expects to execute in the context of a transaction, and will log warning when certain operations are executed out of such a scope.
      Returns:
        when returning `false` Search will avoid logging such warnings.

    - #### isIndexMetadataComplete

          boolean isIndexMetadataComplete()

      Returns:
        `true` if it is safe to assume that the information we have about index metadata is accurate. This should be set to false for example if the index could contain Documents related to types not known to this SearchFactory instance.

    - #### isDeleteByTermEnforced

          boolean isDeleteByTermEnforced()

      Returns:
        `true` if regardless of `isIndexMetadataComplete` and the number of types present in the index it is safe to delete by term given that the underlying store guarantees uniqueness of ids

    - #### getInstanceInitializer

          InstanceInitializer getInstanceInitializer()

      Returns the initializer to be used to initialize potentially lazy entities or collections.
      Returns:
        the initializer to be used to initialize potentially lazy entities or collections.

    - #### isIdProvidedImplicit

          boolean isIdProvidedImplicit()

      Returns:
        `true` if we should treat indexed entities as implicitly annotated with a `ProvidedId`, if no other Id is specified.

    - #### isMultitenancyEnabled

          boolean isMultitenancyEnabled()

      Returns:
        `true` if `multitenancy` should be enabled. When in doubt, this should return `true`.

    - #### getClassLoaderService

          ClassLoaderService getClassLoaderService()

      Returns:
        a classloader service for this configuration of Search. Access to the service is via the `ServiceManager.getClassLoaderService()`

    - #### getBeanResolver

          default BeanResolver getBeanResolver()

      Returns:
        a bean resolver for this configuration of Search, or `null` to use the default one. Access to the service is via the `ServiceManager.getBeanResolver()`

    - #### isJPAAnnotationsProcessingEnabled

          boolean isJPAAnnotationsProcessingEnabled()

      Returns:
        `true` if the Hibernate Search mapping should look for JPA annotations to affect the mapping. Disable this if the JPA API is not available, or to ignore them. Ignoring them implies to ignore, among others, the javax.persistence.Id annotation, which implies the primary identifiers will require explicit mapping over the "provided id" mechanism or the use of `DocumentId`.

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved