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,EventContextProvider
public abstract class AbstractIndexModel<S extends AbstractIndexModel<?,R,F>,R extends IndexCompositeNode<?,?,?>,F extends IndexField<?,?>> extends Object implements EventContextProvider, IndexDescriptor
-
-
Constructor Summary
Constructors Constructor Description AbstractIndexModel(String hibernateSearchIndexName, String mappedTypeName, IndexIdentifier identifier, R root, Map<String,F> staticFields, List<? extends AbstractIndexFieldTemplate<? super S,? extends F,? super R,?>> fieldTemplates)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description EventContexteventContext()Optional<IndexFieldDescriptor>field(String absolutePath)Get a field by its path.FfieldOrNull(String absolutePath)FfieldOrNull(String absolutePath, IndexFieldFilter filter)StringhibernateSearchName()IndexIdentifieridentifier()StringmappedTypeName()Rroot()protected abstract Sself()Collection<IndexFieldDescriptor>staticFields()Get all statically-defined fields for this index.StringtoString()
-
-
-
Method Detail
-
self
protected abstract S self()
-
eventContext
public final EventContext eventContext()
- Specified by:
eventContextin interfaceEventContextProvider
-
hibernateSearchName
public final String hibernateSearchName()
- Specified by:
hibernateSearchNamein interfaceIndexDescriptor- 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:
rootin interfaceIndexDescriptor- Returns:
- A descriptor of the
root elementof this index.
-
field
public final Optional<IndexFieldDescriptor> field(String absolutePath)
Description copied from interface:IndexDescriptorGet a field by its path.This method can find static fields as well as dynamic fields, unlike
IndexDescriptor.staticFields().- Specified by:
fieldin interfaceIndexDescriptor- 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, IndexFieldFilter filter)
-
staticFields
public final Collection<IndexFieldDescriptor> staticFields()
Description copied from interface:IndexDescriptorGet all statically-defined fields for this index.Only statically-defined fields are returned; fields created dynamically through
templatesare not included in the collection.- Specified by:
staticFieldsin interfaceIndexDescriptor- Returns:
- A collection containing all fields.
-
mappedTypeName
public final String mappedTypeName()
-
-