Neo4j Community

org.neo4j.graphdb.index
Interface AutoIndexer<T extends PropertyContainer>


public interface AutoIndexer<T extends PropertyContainer>

The primary interaction point with the auto indexing infrastructure of neo4j. From here it is possible to enable/disable the auto indexing functionality, set/unset auto indexed properties and retrieve index hits. It only exposes a ReadOnlyIndex (see getAutoIndex()) and the idea is that the mutating operations are managed by the AutoIndexer only and the user should have no access other than mutating operations on the database primitives.


Method Summary
 ReadOnlyIndex<T> getAutoIndex()
          Returns the auto index used by the auto indexer.
 Set<String> getAutoIndexedProperties()
          Returns the set of property names that are currently monitored for auto indexing.
 boolean isEnabled()
          Returns true iff this auto indexer is enabled, false otherwise.
 void setEnabled(boolean enabled)
          Sets the AutoIndexer as enabled or not.
 void startAutoIndexingProperty(String propName)
          Start auto indexing a property.
 void stopAutoIndexingProperty(String propName)
          Removes the argument from the set of auto indexed properties.
 

Method Detail

setEnabled

void setEnabled(boolean enabled)
Sets the AutoIndexer as enabled or not. Enabled means that appropriately configured properties are auto indexed and hits can be returned, disabled means that no index additions happen but the index can be queried.

Parameters:
enabled - True to enable this auto indexer, false to disable it.

isEnabled

boolean isEnabled()
Returns true iff this auto indexer is enabled, false otherwise. For a cursory definition of enabled indexer, look at setAutoIndexingEnabled(boolean)

Returns:
true iff this auto indexer is enabled
See Also:
setEnabled(boolean)

getAutoIndex

ReadOnlyIndex<T> getAutoIndex()
Returns the auto index used by the auto indexer. This should be able to be released safely (read only) to the outside world.

Returns:
A read only index

startAutoIndexingProperty

void startAutoIndexingProperty(String propName)
Start auto indexing a property. This could lead to an IllegalStateException in case there are already ignored properties. Adding an already auto indexed property is a no-op.

Parameters:
propName - The property name to start auto indexing.

stopAutoIndexingProperty

void stopAutoIndexingProperty(String propName)
Removes the argument from the set of auto indexed properties. If the property was not already monitored, nothing happens

Parameters:
propName - The property name to stop auto indexing.

getAutoIndexedProperties

Set<String> getAutoIndexedProperties()
Returns the set of property names that are currently monitored for auto indexing. If this auto indexer is set to ignore properties, the result is the empty set.

Returns:
An immutable set of the auto indexed property names, possibly empty.

Neo4j Community

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