Class AbstractIndexModel<S extends AbstractIndexModel<?,R,F>,R extends IndexCompositeNode<?,?,?>,F extends IndexField<?,?>>

java.lang.Object
org.hibernate.search.engine.backend.document.model.spi.AbstractIndexModel<S,R,F>
All Implemented Interfaces:
IndexDescriptor, org.hibernate.search.util.common.reporting.spi.EventContextProvider

public abstract class AbstractIndexModel<S extends AbstractIndexModel<?,R,F>,R extends IndexCompositeNode<?,?,?>,F extends IndexField<?,?>> extends Object implements org.hibernate.search.util.common.reporting.spi.EventContextProvider, IndexDescriptor
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • self

      protected abstract S self()
    • eventContext

      public final org.hibernate.search.util.common.reporting.EventContext eventContext()
      Specified by:
      eventContext in interface org.hibernate.search.util.common.reporting.spi.EventContextProvider
    • hibernateSearchName

      public final String hibernateSearchName()
      Specified by:
      hibernateSearchName in interface IndexDescriptor
      Returns:
      The name that uniquely identifies this index within the backend. This is the Hibernate Search name; the name of the index on the filesystem or in Elasticsearch may be different (lowercased, with a suffix, ...). See the reference documentation of your backend for more information.
    • identifier

      public IndexIdentifier identifier()
    • root

      public final R root()
      Specified by:
      root in interface IndexDescriptor
      Returns:
      A descriptor of the root element of this index.
    • field

      public final Optional<IndexFieldDescriptor> field(String absolutePath)
      Description copied from interface: IndexDescriptor
      Get a field by its path.

      This method can find static fields as well as dynamic fields, unlike IndexDescriptor.staticFields().

      Specified by:
      field in interface IndexDescriptor
      Parameters:
      absolutePath - An absolute, dot-separated path.
      Returns:
      The corresponding field, or Optional.empty() if no field exists with this path.
    • fieldOrNull

      public final F fieldOrNull(String absolutePath)
    • fieldOrNull

      public final F fieldOrNull(String absolutePath, IndexFieldFilter filter)
    • staticFields

      public final Collection<IndexFieldDescriptor> staticFields()
      Description copied from interface: IndexDescriptor
      Get all statically-defined fields for this index.

      Only statically-defined fields are returned; fields created dynamically through templates are not included in the collection.

      Specified by:
      staticFields in interface IndexDescriptor
      Returns:
      A collection containing all fields.
    • analyzer

      public Optional<? extends AnalyzerDescriptor> analyzer(String name)
      Description copied from interface: IndexDescriptor
      Looks up the configured analyzers available to the index represented by this descriptor.
      Specified by:
      analyzer in interface IndexDescriptor
      Parameters:
      name - The name of the analyzer.
      Returns:
      An empty optional if there is no analyzer configured with the given name.
    • analyzers

      public Collection<? extends AnalyzerDescriptor> analyzers()
      Specified by:
      analyzers in interface IndexDescriptor
      Returns:
      A collection of configured analyzer descriptors available to the index represented by this descriptor.
    • normalizer

      public Optional<? extends NormalizerDescriptor> normalizer(String name)
      Description copied from interface: IndexDescriptor
      Looks up the configured normalizers available to the index represented by this descriptor.
      Specified by:
      normalizer in interface IndexDescriptor
      Parameters:
      name - The name of the normalizer.
      Returns:
      An empty optional if there is no normalizer configured with the given name.
    • normalizers

      public Collection<? extends NormalizerDescriptor> normalizers()
      Specified by:
      normalizers in interface IndexDescriptor
      Returns:
      A collection of configured normalizer descriptors available to the index represented by this descriptor.
    • mappedTypeName

      public final String mappedTypeName()