From 1edd27d86091d0ca64307809c7f4870f36ec5321 Mon Sep 17 00:00:00 2001 From: Christopher Menon <16004217+cmenon12@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:10:12 +0000 Subject: [PATCH] docs: fix SQL-based metadata filter syntax, add link to BigQuery docs (#29736) Fix the syntax for SQL-based metadata filtering in the [Google BigQuery Vector Search docs](https://python.langchain.com/docs/integrations/vectorstores/google_bigquery_vector_search/#searching-documents-with-metadata-filters). Also add a link to learn more about BigQuery operators that can be used here. I have been using this library, and have found that this is the correct syntax to use for the SQL-based filters. **Issue**: no open issue. **Dependencies**: none. **Twitter handle**: none. No tests as this is only a change to the documentation. --- .../vectorstores/google_bigquery_vector_search.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/integrations/vectorstores/google_bigquery_vector_search.ipynb b/docs/docs/integrations/vectorstores/google_bigquery_vector_search.ipynb index f5cc0e92c4e..d8878b61bc0 100644 --- a/docs/docs/integrations/vectorstores/google_bigquery_vector_search.ipynb +++ b/docs/docs/integrations/vectorstores/google_bigquery_vector_search.ipynb @@ -331,7 +331,7 @@ "- Dictionary-based Filters\n", " - You can pass a dictionary (dict) where the keys represent metadata fields and the values specify the filter condition. This method applies an equality filter between the key and the corresponding value. When multiple key-value pairs are provided, they are combined using a logical AND operation.\n", "- SQL-based Filters\n", - " - Alternatively, you can provide a string representing an SQL WHERE clause to define more complex filtering conditions. This allows for greater flexibility, supporting SQL expressions such as comparison operators and logical operators." + " - Alternatively, you can provide a string representing an SQL WHERE clause to define more complex filtering conditions. This allows for greater flexibility, supporting SQL expressions such as comparison operators and logical operators. Learn more about [BigQuery operators](https://cloud.google.com/bigquery/docs/reference/standard-sql/operators)." ] }, { @@ -356,7 +356,7 @@ "source": [ "# SQL-based Filters\n", "# This should return \"Banana\", \"Apples and oranges\" and \"Cars and airplanes\" documents.\n", - "docs = store.similarity_search_by_vector(query_vector, filter={\"len = 6 AND len > 17\"})\n", + "docs = store.similarity_search_by_vector(query_vector, filter=\"len = 6 AND len > 17\")\n", "print(docs)" ] },