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 EventContext
eventContext()
Optional<IndexFieldDescriptor>
field(String absolutePath)
Get a field by its path.F
fieldOrNull(String absolutePath)
F
fieldOrNull(String absolutePath, IndexFieldFilter filter)
String
hibernateSearchName()
IndexIdentifier
identifier()
String
mappedTypeName()
R
root()
protected abstract S
self()
Collection<IndexFieldDescriptor>
staticFields()
Get all statically-defined fields for this index.String
toString()
-
-
-
Method Detail
-
self
protected abstract S self()
-
eventContext
public final EventContext eventContext()
- Specified by:
eventContext
in interfaceEventContextProvider
-
hibernateSearchName
public final String hibernateSearchName()
- Specified by:
hibernateSearchName
in 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:
root
in interfaceIndexDescriptor
- 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 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: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 interfaceIndexDescriptor
- Returns:
- A collection containing all fields.
-
mappedTypeName
public final String mappedTypeName()
-
-