|
||||||||||
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,
Object value)
Dissociates a key-value pair from node . |
void |
setIsolation(Isolation level)
Changes isolation level for the running transaction. |
void |
shutdown()
Stops this indexing service committing any asynchronous requests that are currently queued (see Isolation ). |
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 setIsolation(Isolation level)
index(Node, String, Object)
,
removeIndex(Node, String, Object)
) has been performed in the
current transaction. The default isolation level is
Isolation.SAME_TX
. The isolation level is thread confined.
level
- new isolation levelvoid shutdown()
Isolation
). After this method has been
invoked any following method invocation on this instance is invalid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |