Interface IndexDefinition
-
Method Summary
Modifier and TypeMethodDescriptionvoid
drop()
Drops this index.Get the index configuration that this index was created with.Get the index type of this index.Return the set of node labels (in no particular order) that this index applies to.getName()
Get the name given to this index when it was created.Return the set of properties that are indexed by this index.Return the set of relationship types (in no particular order) that this index applies to.boolean
A composite index is an index that indexes nodes or relationships by more than one property.boolean
boolean
A multi-token index is an index that indexes nodes or relationships that have any or all of a given set of labels or relationship types, respectively.boolean
boolean
-
Method Details
-
getLabels
Return the set of node labels (in no particular order) that this index applies to. This method works for bothmulti-token
indexes, and "single-token" indexes.Note that this assumes that this is a node index (that
isNodeIndex()
returnstrue
). If this is not the case, then anIllegalStateException
is thrown.- Returns:
- the set of
labels
this index definition is associated with.
-
getRelationshipTypes
Iterable<RelationshipType> getRelationshipTypes()Return the set of relationship types (in no particular order) that this index applies to. This method works for bothmult-token
indexes, and "single-token" indexes.Note that this assumes that this is a relationship index (that
isRelationshipIndex()
returnstrue
). If thisk is not the case, then anIllegalStateException
is thrown.- Returns:
- the set of
relationship types
this index definition is associated with.
-
getPropertyKeys
Return the set of properties that are indexed by this index.Most indexes will only have a single property, but
composite indexes
will have multiple properties.- Returns:
- the property keys this index was created on.
- See Also:
-
getIndexType
IndexType getIndexType()Get the index type of this index.- Returns:
- The
IndexType
this index was defined with.
-
drop
void drop()Drops this index.Schema.getIndexes(Label)
will no longer include this index and any related background jobs and files will be stopped and removed. -
isConstraintIndex
boolean isConstraintIndex()- Returns:
true
if this index is used to power a uniqueness constraint.
-
isNodeIndex
boolean isNodeIndex()- Returns:
true
if this index is indexing nodes, otherwisefalse
.
-
isRelationshipIndex
boolean isRelationshipIndex()- Returns:
true
if this index is indexing relationships, otherwisefalse
.
-
isMultiTokenIndex
boolean isMultiTokenIndex()A multi-token index is an index that indexes nodes or relationships that have any or all of a given set of labels or relationship types, respectively.For instance, a multi-token index could apply to all
Movie
andBook
nodes that have adescription
property. A node or relationship do not need to have all of the labels or relationship types for it to be indexed. A node that has any of the given labels, or a relationship that has any of the given relationship types, will be a candidate for indexing, depending on their properties.- Returns:
true
if this is a multi-token index.
-
isCompositeIndex
boolean isCompositeIndex()A composite index is an index that indexes nodes or relationships by more than one property.For instance, a composite index for
PhoneNumber
nodes could be indexing thecountry_code
,area_code
,prefix
, andline_number
. Note: it is index-implementation specific if a node or relationship must have all of the properties in order to be indexable, or if having any of the properties is enough for the given node or relationship to be indexed. For instance,NODE KEY
constraint indexes require that all of the properties be present on a node before it will be included in the index, while a full-text index will index nodes or relationships that have any of the given properties.- Returns:
true
if this is a composite index.
-
getName
String getName()Get the name given to this index when it was created. Indexes that were not explicitly given a name at creation, will have an auto-generated name.- Returns:
- the unique name of the index.
-
getIndexConfiguration
Map<IndexSetting,Object> getIndexConfiguration()Get the index configuration that this index was created with.- Returns:
- The index configuration as a read-only map.
-