Vespa Log No Response (#2295)

This commit is contained in:
Yuhong Sun
2024-09-02 09:14:28 -07:00
committed by GitHub
parent 299cb5035c
commit 32e551b69c
2 changed files with 13 additions and 6 deletions

View File

@@ -292,12 +292,11 @@ def query_vespa(
if LOG_VESPA_TIMING_INFORMATION
else {},
)
response = requests.post(
SEARCH_ENDPOINT,
json=params,
)
try:
response = requests.post(
SEARCH_ENDPOINT,
json=params,
)
response.raise_for_status()
except requests.HTTPError as e:
request_info = f"Headers: {response.request.headers}\nPayload: {params}"
@@ -319,6 +318,12 @@ def query_vespa(
logger.debug("Vespa timing info: %s", response_json.get("timing"))
hits = response_json["root"].get("children", [])
if not hits:
logger.warning(
f"No hits found for YQL Query: {query_params.get('yql', 'No YQL Query')}"
)
logger.debug(f"Vespa Response: {response.text}")
for hit in hits:
if hit["fields"].get(CONTENT) is None:
identifier = hit["fields"].get("documentid") or hit["id"]

View File

@@ -209,7 +209,9 @@ class SearchPipeline:
if inference_section is not None:
expanded_inference_sections.append(inference_section)
else:
logger.warning("Skipped creation of section, no chunks found")
logger.warning(
"Skipped creation of section for full docs, no chunks found"
)
self._retrieved_sections = expanded_inference_sections
return expanded_inference_sections