Change Vespa Query to Post from Get (#1044)

This commit is contained in:
Yuhong Sun 2024-02-05 13:40:39 -08:00 committed by GitHub
parent 6768c24723
commit 988e9aa682
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,