Class VectorQuery


public final class VectorQuery extends StreamableQuery<VectorQuerySnapshot>
A query that finds the documents whose vector fields are closest to a certain query vector. Create an instance of `VectorQuery` with Query.findNearest(java.lang.String, double[], int, com.google.cloud.firestore.VectorQuery.DistanceMeasure).
  • Method Details

    • get

      @Nonnull public com.google.api.core.ApiFuture<VectorQuerySnapshot> get()
      Executes the query and returns the results as QuerySnapshot.
      Specified by:
      get in class StreamableQuery<VectorQuerySnapshot>
      Returns:
      An ApiFuture that will be resolved with the results of the VectorQuery.
    • explain

      @Nonnull public com.google.api.core.ApiFuture<ExplainResults<VectorQuerySnapshot>> explain(ExplainOptions options)
      Plans and optionally executes this VectorQuery. Returns an ApiFuture that will be resolved with the planner information, statistics from the query execution (if any), and the query results (if any).
      Overrides:
      explain in class StreamableQuery<VectorQuerySnapshot>
      Returns:
      An ApiFuture that will be resolved with the planner information, statistics from the query execution (if any), and the query results (if any).
    • equals

      public boolean equals(Object obj)
      Returns true if this VectorQuery is equal to the provided object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to compare against.
      Returns:
      Whether this VectorQuery is equal to the provided object.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toRunQueryRequestBuilder

      protected RunQueryRequest.Builder toRunQueryRequestBuilder(@Nullable com.google.protobuf.ByteString transactionId, @Nullable com.google.cloud.Timestamp readTime, @Nullable ExplainOptions explainOptions)