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

    Fields
    Modifier and Type
    Field
    Description
    static final Graph.Index
    No-op singleton returned by the default Graph.index() implementation.
  • Method Summary

    Modifier and Type
    Method
    Description
    default long
    Returns the number of vertices where the given property key equals the given value, or Long.MAX_VALUE when the key is not indexed or the count is unknown.
    default Iterator<Vertex>
    Returns an iterator over all vertices where the given property key equals the given value.
  • Field Details

  • Method Details

    • queryVertexIndex

      default Iterator<Vertex> queryVertexIndex(String key, Object value)
      Returns an iterator over all vertices where the given property key equals the given value. Must return an empty iterator (not null) when no match exists or when the key is not indexed.
      Parameters:
      key - the property key to look up
      value - the property value to match
      Returns:
      an iterator over matching vertices; never null
    • countVertexIndex

      default long countVertexIndex(String key, Object value)
      Returns the number of vertices where the given property key equals the given value, or Long.MAX_VALUE when the key is not indexed or the count is unknown.

      A return value of Long.MAX_VALUE signals 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 than Long.MAX_VALUE (including 0) indicates that an index exists and was consulted.

      Parameters:
      key - the property key to look up
      value - the property value to count
      Returns:
      the indexed count, or Long.MAX_VALUE if not indexed