From 988e9aa682d5078d5fe61a1d0d5a33d69bd696e8 Mon Sep 17 00:00:00 2001 From: Yuhong Sun Date: Mon, 5 Feb 2024 13:40:39 -0800 Subject: [PATCH] Change Vespa Query to Post from Get (#1044) --- backend/danswer/document_index/vespa/index.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/danswer/document_index/vespa/index.py b/backend/danswer/document_index/vespa/index.py index 6cb84dd4c7..4d58bee22c 100644 --- a/backend/danswer/document_index/vespa/index.py +++ b/backend/danswer/document_index/vespa/index.py @@ -157,7 +157,7 @@ def _get_vespa_chunk_ids_by_document_id( "hits": hits_per_page, } while True: - results = requests.get(SEARCH_ENDPOINT, params=params).json() + results = requests.post(SEARCH_ENDPOINT, json=params).json() hits = results["root"].get("children", []) doc_chunk_ids.extend( @@ -559,9 +559,9 @@ def _query_vespa(query_params: Mapping[str, str | int | float]) -> list[Inferenc if "query" in query_params and not cast(str, query_params["query"]).strip(): raise ValueError("No/empty query received") - response = requests.get( + response = requests.post( SEARCH_ENDPOINT, - params=dict( + json=dict( **query_params, **{ "presentation.timing": True,