org.neo4j.graphdb.index
Interface IndexManager


public interface IndexManager

A one stop shop for accessing Indexs for Nodes and Relationships. An IndexManager is paired with a GraphDatabaseService via GraphDatabaseService.index() so that indexes can be accessed directly from the graph database.


Method Summary
 boolean existsForNodes(String indexName)
          Returns whether or not there exists a node index with the name indexName.
 boolean existsForRelationships(String indexName)
          Returns whether or not there exists a relationship index with the name indexName.
 Index<Node> forNodes(String indexName)
          Returns an Index for Nodes with the name indexName.
 Index<Node> forNodes(String indexName, Map<String,String> customConfiguration)
          Returns an Index for Nodes with the name indexName.
 RelationshipIndex forRelationships(String indexName)
          Returns an Index for Relationships with the name indexName.
 RelationshipIndex forRelationships(String indexName, Map<String,String> customConfiguration)
          Returns an Index for Relationships with the name indexName.
 

Method Detail

existsForNodes

boolean existsForNodes(String indexName)
Returns whether or not there exists a node index with the name indexName. Indexes are created when needed in calls to forNodes(String) and forNodes(String, Map).

Parameters:
indexName - the name of the index to check.
Returns:
whether or not there exists a node index with the name indexName.

forNodes

Index<Node> forNodes(String indexName)
Returns an Index for Nodes with the name indexName. If such an index doesn't exist it will be created with default configuration.

Parameters:
indexName - the name of the node index.
Returns:
the Index corresponding to the indexName.

forNodes

Index<Node> forNodes(String indexName,
                     Map<String,String> customConfiguration)
Returns an Index for Nodes with the name indexName. If the index exists it will be returned if the provider and customConfiguration matches, else an IllegalArgumentException will be thrown. If the index doesn't exist it will be created with the given provider (specifies the type of index, f.ex. Lucene. See IndexProvider) and customConfiguration.

Parameters:
indexName - the name of the index to create.
customConfiguration - extra configuration for the index being created. Use the provider key provider to control which index implementation, i.e. the IndexProvider to use for this index if it's created. The value represents the service name corresponding to the IndexProvider. Other options can f.ex. say that the index will be a fulltext index, that it should be case insensitive. The parameters given here are not generic parameters, but instead interpreted by the implementation represented by the provider.

existsForRelationships

boolean existsForRelationships(String indexName)
Returns whether or not there exists a relationship index with the name indexName. Indexes are created when needed in calls to forRelationships(String) and forRelationships(String, Map).

Parameters:
indexName - the name of the index to check.
Returns:
whether or not there exists a relationship index with the name indexName.

forRelationships

RelationshipIndex forRelationships(String indexName)
Returns an Index for Relationships with the name indexName. If such an index doesn't exist it will be created with default configuration.

Parameters:
indexName - the name of the node index.
Returns:
the Index corresponding to the indexName.

forRelationships

RelationshipIndex forRelationships(String indexName,
                                   Map<String,String> customConfiguration)
Returns an Index for Relationships with the name indexName. If the index exists it will be returned if the provider and customConfiguration matches, else an IllegalArgumentException will be thrown. If the index doesn't exist it will be created with the given provider (specifies the type of index, f.ex. Lucene. See IndexProvider) and customConfiguration.

Parameters:
indexName - the name of the index to create.
customConfiguration - extra configuration for the index being created. Use the provider key provider to control which index implementation, i.e. the IndexProvider to use for this index if it's created. The value represents the service name corresponding to the IndexProvider. Other options can f.ex. say that the index will be a fulltext index, that it should be case insensitive. The parameters given here are not generic parameters, but instead interpreted by the implementation represented by the provider.


Copyright © 2010 The Neo4j Graph Database Project. All Rights Reserved.