Interface Graph.Index
- Enclosing interface:
- Graph
public static interface Graph.Index
Provides access to property index lookups for the graph.
Index exposes the read
side of a graph's property index structures for use by query planners and executors.
Implementations whose graphs do not support property indexes need not implement this
interface; the default Graph.index() accessor returns EMPTY.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Graph.IndexNo-op singleton returned by the defaultGraph.index()implementation. -
Method Summary
Modifier and TypeMethodDescriptiondefault longcountVertexIndex(String key, Object value) Returns the number of vertices where the given property key equals the given value, orLong.MAX_VALUEwhen the key is not indexed or the count is unknown.queryVertexIndex(String key, Object value) Returns an iterator over all vertices where the given property key equals the given value.
-
Field Details
-
EMPTY
No-op singleton returned by the defaultGraph.index()implementation.
-
-
Method Details
-
queryVertexIndex
Returns an iterator over all vertices where the given property key equals the given value. Must return an empty iterator (notnull) when no match exists or when the key is not indexed.- Parameters:
key- the property key to look upvalue- the property value to match- Returns:
- an iterator over matching vertices; never
null
-
countVertexIndex
Returns the number of vertices where the given property key equals the given value, orLong.MAX_VALUEwhen the key is not indexed or the count is unknown.A return value of
Long.MAX_VALUEsignals to the GQL planner/executor that no index exists for this key — the executor will fall back to a full vertex scan. A value less thanLong.MAX_VALUE(including0) indicates that an index exists and was consulted.- Parameters:
key- the property key to look upvalue- the property value to count- Returns:
- the indexed count, or
Long.MAX_VALUEif not indexed
-