public interface IndexDefinition
NOTE: This is part of the index API introduced in Neo4j 2.0.
The explicit index API lives in IndexManager
.
Modifier and Type | Method and Description |
---|---|
void |
drop()
Drops this index.
|
Label |
getLabel()
Deprecated.
This method is deprecated and will be removed in next major release. Please consider using
getLabels() instead. |
Iterable<Label> |
getLabels()
Return the set of node labels (in no particular order) that this index applies to.
|
String |
getName()
Get the name given to this index when it was created, if any.
|
Iterable<String> |
getPropertyKeys()
Return the set of properties that are indexed by this index.
|
RelationshipType |
getRelationshipType()
Deprecated.
This method is deprecated and will be removed in next major release. Please consider using
getRelationshipTypes() instead. |
Iterable<RelationshipType> |
getRelationshipTypes()
Return the set of relationship types (in no particular order) that this index applies to.
|
boolean |
isCompositeIndex()
A composite index is an index that indexes nodes or relationships by more than one property.
|
boolean |
isConstraintIndex() |
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.
|
boolean |
isNodeIndex() |
boolean |
isRelationshipIndex() |
@Deprecated Label getLabel()
getLabels()
instead.
Note that this assumes that this is a node index (that isNodeIndex()
returns true
) and not a multi-token index
(that isMultiTokenIndex()
returns false
). If this is not the case, then an IllegalStateException
is thrown.
label
this index definition is associated with.Iterable<Label> getLabels()
multi-token
indexes, and "single-token" indexes.
Note that this assumes that this is a node index (that isNodeIndex()
returns true
). If this is not the case, then an
IllegalStateException
is thrown.
labels
this index definition is associated with.@Deprecated RelationshipType getRelationshipType()
getRelationshipTypes()
instead.
Note that this assumes that this is a relationship index (that isRelationshipIndex()
returns true
) and not a multi-token index
(that isMultiTokenIndex()
returns false
). If this is not the case, then an IllegalStateException
is thrown.
relationship type
this index definition is associated with.Iterable<RelationshipType> getRelationshipTypes()
mult-token
indexes, and "single-token" indexes.
Note that this assumes that this is a relationship index (that isRelationshipIndex()
returns true
). If thisk is not the case, then an
IllegalStateException
is thrown.
relationship types
this index definition is associated with.Iterable<String> getPropertyKeys()
Most indexes will only have a single property, but composite indexes
will have multiple properties.
isCompositeIndex()
void drop()
Schema.getIndexes(Label)
will no longer include this index
and any related background jobs and files will be stopped and removed.boolean isConstraintIndex()
true
if this index is created as a side effect of the creation of a uniqueness constraint.boolean isNodeIndex()
true
if this index is indexing nodes, otherwise false
.boolean isRelationshipIndex()
true
if this index is indexing relationships, otherwise false
.boolean isMultiTokenIndex()
For instance, a multi-token index could apply to all Movie
and Book
nodes that have a description
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.
true
if this is a multi-token index.boolean isCompositeIndex()
For instance, a composite index for PhoneNumber
nodes could be indexing the country_code
, area_code
, prefix
,
and line_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.
true
if this is a composite index.String getName()
"Unnamed index"
is returned instead.Copyright © 2002–2018 The Neo4j Graph Database Project. All rights reserved.