Class QueryParameters (0.9.0)
QueryParameters(
algorithm=NearestNeighborsAlgorithm.EXACT_NEAREST_NEIGHBOR,
distance_strategy=DistanceStrategy.EUCLIDEAN,
read_timestamp: typing.Optional[datetime.datetime] = None,
min_read_timestamp: typing.Optional[datetime.datetime] = None,
max_staleness: typing.Optional[datetime.timedelta] = None,
exact_staleness: typing.Optional[datetime.timedelta] = None,
)
Class representing query parameters for nearest neighbors search.
Classes
NearestNeighborsAlgorithm
NearestNeighborsAlgorithm(value)
Enum for nearest neighbors search algorithms.
Methods
QueryParameters
QueryParameters(
algorithm=NearestNeighborsAlgorithm.EXACT_NEAREST_NEIGHBOR,
distance_strategy=DistanceStrategy.EUCLIDEAN,
read_timestamp: typing.Optional[datetime.datetime] = None,
min_read_timestamp: typing.Optional[datetime.datetime] = None,
max_staleness: typing.Optional[datetime.timedelta] = None,
exact_staleness: typing.Optional[datetime.timedelta] = None,
)
Initialize query parameters.
Parameters:
- algorithm (NearestNeighborsAlgorithm): The nearest neighbors search algorithm. Defaults to NearestNeighborsAlgorithm.BRUTE_FORCE.
- distance_strategy (DistanceStrategy): The distance calculation strategy. Defaults to DistanceStrategy.EUCLIDEAN.
- staleness (int): The staleness value. Defaults to 0.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class QueryParameters (0.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.9.0 (latest)](/python/docs/reference/langchain-google-spanner/latest/langchain_google_spanner.vector_store.QueryParameters)\n- [0.8.2](/python/docs/reference/langchain-google-spanner/0.8.2/langchain_google_spanner.vector_store.QueryParameters)\n- [0.7.0](/python/docs/reference/langchain-google-spanner/0.7.0/langchain_google_spanner.vector_store.QueryParameters)\n- [0.6.0](/python/docs/reference/langchain-google-spanner/0.6.0/langchain_google_spanner.vector_store.QueryParameters)\n- [0.5.0](/python/docs/reference/langchain-google-spanner/0.5.0/langchain_google_spanner.vector_store.QueryParameters)\n- [0.4.1](/python/docs/reference/langchain-google-spanner/0.4.1/langchain_google_spanner.vector_store.QueryParameters)\n- [0.3.0](/python/docs/reference/langchain-google-spanner/0.3.0/langchain_google_spanner.vector_store.QueryParameters) \n\n QueryParameters(\n algorithm=NearestNeighborsAlgorithm.EXACT_NEAREST_NEIGHBOR,\n distance_strategy=DistanceStrategy.EUCLIDEAN,\n read_timestamp: typing.Optional[datetime.datetime] = None,\n min_read_timestamp: typing.Optional[datetime.datetime] = None,\n max_staleness: typing.Optional[datetime.timedelta] = None,\n exact_staleness: typing.Optional[datetime.timedelta] = None,\n )\n\nClass representing query parameters for nearest neighbors search.\n\nClasses\n-------\n\n### NearestNeighborsAlgorithm\n\n NearestNeighborsAlgorithm(value)\n\nEnum for nearest neighbors search algorithms.\n\nMethods\n-------\n\n### QueryParameters\n\n QueryParameters(\n algorithm=NearestNeighborsAlgorithm.EXACT_NEAREST_NEIGHBOR,\n distance_strategy=DistanceStrategy.EUCLIDEAN,\n read_timestamp: typing.Optional[datetime.datetime] = None,\n min_read_timestamp: typing.Optional[datetime.datetime] = None,\n max_staleness: typing.Optional[datetime.timedelta] = None,\n exact_staleness: typing.Optional[datetime.timedelta] = None,\n )\n\nInitialize query parameters.\n\nParameters:\n\n- algorithm (NearestNeighborsAlgorithm): The nearest neighbors search algorithm. Defaults to NearestNeighborsAlgorithm.BRUTE_FORCE.\n- distance_strategy (DistanceStrategy): The distance calculation strategy. Defaults to DistanceStrategy.EUCLIDEAN.\n- staleness (int): The staleness value. Defaults to 0."]]