public void updateRelationshipIndex ( EntityMetadata entityMetadata , GraphDatabaseService graphDb , Relationship relationship , MetamodelImpl metaModel ) { if ( ! isRelationshipAutoIndexingEnabled ( graphDb ) && entityMetadata . isIndexable ( ) ) { Index < Relationship > relationshipIndex = graphDb . index ( ) . forRelationships ( entityMetadata . getIndexName ( ) ) ; // Remove all existing relationship entries from Index relationshipIndex . remove ( relationship ) ; // Recreate fresh index on this relationship addRelationshipIndex ( entityMetadata , relationship , relationshipIndex , metaModel ) ; } }
If relationship auto - indexing is disabled Update index for this relationship manually