org.neo4j.graphdb.index
Interface RelationshipIndex

All Superinterfaces:
Index<Relationship>

public interface RelationshipIndex
extends Index<Relationship>

Extends the Index interface with additional get/query methods which are specific to Relationships. Each of Index.get(String, Object), Index.query(String, Object) and Index.query(Object) have an additional method which allows effient filtering on start/end node of the relationships.

Author:
Mattias Persson

Method Summary
 IndexHits<Relationship> get(String key, Object valueOrNull, Node startNodeOrNull, Node endNodeOrNull)
          Returns exact matches from this index, given the key/value pair.
 IndexHits<Relationship> query(Object queryOrQueryObjectOrNull, Node startNodeOrNull, Node endNodeOrNull)
          Returns matches from this index based on the supplied query object, which can be a query string or an implementation-specific query object.
 IndexHits<Relationship> query(String key, Object queryOrQueryObjectOrNull, Node startNodeOrNull, Node endNodeOrNull)
          Returns matches from this index based on the supplied key and query object, which can be a query string or an implementation-specific query object.
 
Methods inherited from interface org.neo4j.graphdb.index.Index
add, delete, get, getEntityType, getName, query, query, remove, remove, remove
 

Method Detail

get

IndexHits<Relationship> get(String key,
                            Object valueOrNull,
                            Node startNodeOrNull,
                            Node endNodeOrNull)
Returns exact matches from this index, given the key/value pair. Matches will be for key/value pairs just as they were added by the Index.add(PropertyContainer, String, Object) method.

Parameters:
key - the key in the key/value pair to match.
valueOrNull - the value in the key/value pair to match.
startNodeOrNull - filter so that only Relationships with that given start node will be returned.
endNodeOrNull - filter so that only Relationships with that given end node will be returned.
Returns:
the result wrapped in an IndexHits object. If the entire result set isn't looped through, IndexHits.close() must be called before disposing of the result.

query

IndexHits<Relationship> query(String key,
                              Object queryOrQueryObjectOrNull,
                              Node startNodeOrNull,
                              Node endNodeOrNull)
Returns matches from this index based on the supplied key and query object, which can be a query string or an implementation-specific query object.

Parameters:
key - the key in this query.
queryOrQueryObjectOrNull - the query for the key to match.
startNodeOrNull - filter so that only Relationships with that given start node will be returned.
endNodeOrNull - filter so that only Relationships with that given end node will be returned.
Returns:
the result wrapped in an IndexHits object. If the entire result set isn't looped through, IndexHits.close() must be called before disposing of the result.

query

IndexHits<Relationship> query(Object queryOrQueryObjectOrNull,
                              Node startNodeOrNull,
                              Node endNodeOrNull)
Returns matches from this index based on the supplied query object, which can be a query string or an implementation-specific query object.

Parameters:
queryOrQueryObjectOrNull - the query to match.
startNodeOrNull - filter so that only Relationships with that given start node will be returned.
endNodeOrNull - filter so that only Relationships with that given end node will be returned.
Returns:
the result wrapped in an IndexHits object. If the entire result set isn't looped through, IndexHits.close() must be called before disposing of the result.


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