Package com.google.cloud.firestore
Class VectorQuery
java.lang.Object
com.google.cloud.firestore.StreamableQuery<VectorQuerySnapshot>
com.google.cloud.firestore.VectorQuery
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).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe distance measure to use when comparing vectors in aVectorQuery. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if this VectorQuery is equal to the provided object.com.google.api.core.ApiFuture<ExplainResults<VectorQuerySnapshot>>explain(ExplainOptions options) Plans and optionally executes this VectorQuery.com.google.api.core.ApiFuture<VectorQuerySnapshot>get()Executes the query and returns the results asQuerySnapshot.inthashCode()protected RunQueryRequest.BuildertoRunQueryRequestBuilder(com.google.protobuf.ByteString transactionId, com.google.cloud.Timestamp readTime, ExplainOptions explainOptions) toString()Methods inherited from class com.google.cloud.firestore.StreamableQuery
getFirestore
-
Method Details
-
get
Executes the query and returns the results asQuerySnapshot.- Specified by:
getin classStreamableQuery<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:
explainin classStreamableQuery<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
Returns true if this VectorQuery is equal to the provided object. -
hashCode
public int hashCode() -
toRunQueryRequestBuilder
protected RunQueryRequest.Builder toRunQueryRequestBuilder(@Nullable com.google.protobuf.ByteString transactionId, @Nullable com.google.cloud.Timestamp readTime, @Nullable ExplainOptions explainOptions) -
toString
- Overrides:
toStringin classStreamableQuery<VectorQuerySnapshot>
-