|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IndexService
Index service to index nodes with a key and a value. The Neo4j Kernel has no indexing features built-in. Instead you'll have to manage indexing manually. IndexService is a means of providing those indexing capabilities for a Neo4j graph and integrate it as tightly as possible with the graph engine.
Note that changes on Node properties respective nodes that are
deleted must be propagated to the index by the application.
See more at The Neo4j wiki page on "Indexing with IndexService".
| Method Summary | |
|---|---|
IndexHits<Node> |
getNodes(String key,
Object value)
Returns all nodes indexed with key and value. |
Node |
getSingleNode(String key,
Object value)
Returns a single node indexed with associated with key and
value. |
void |
index(Node node,
String key,
Object value)
Index node with key and value. |
void |
removeIndex(Node node,
String key)
Dissociates a node from all indexed values for the given key. |
void |
removeIndex(Node node,
String key,
Object value)
Dissociates a key-value pair from node. |
void |
removeIndex(String key)
Dissociates all key-value pairs which key is part of, i.e. |
void |
shutdown()
Shuts down the index service. |
| Method Detail |
|---|
void index(Node node,
String key,
Object value)
node with key and value. A
node can be associated with any number of key-value pairs.
Note about updating an index: If you've indexed a value from a property
on a Node and that value gets updated, you'll have to remove the
old value in addition to indexing the new value, else both values (the
new and the old) will be indexed for that node.
When deleting a Node, application should remove the index entries
for the node as well, to keep the index consistent with the node space.
node - node to indexkey - the key in the key-value pair to associate with node.value - the value in the key-value pair to associate with node.
Node getSingleNode(String key,
Object value)
key and
value. If no such node exist null is returned.
If more then one node is found a runtime exception is thrown.
key - the key for indexvalue - the value for index
null
IndexHits<Node> getNodes(String key,
Object value)
key and value.
key - the key for indexvalue - the value for index
void removeIndex(Node node,
String key,
Object value)
node. If no such association
exist this method silently returns.
node - the node to dissociate from the key-value pair.key - the key in the key-value pair.value - the value in the key-value pair.
void removeIndex(Node node,
String key)
key.
If no such association exists this method silently returns.
Implementations may choose to not implement this method and should
in such a case throw UnsupportedOperationException.
node - the node to dissociate from all indexed values for the given
key.key - the key in the key-value pairs to remove.void removeIndex(String key)
key is part of, i.e.
clearing the an entire index key is cleared.
Implementations may choose to not implement this method and should
in such a case throw UnsupportedOperationException.
key - the index to clear.void shutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||