Skip to content

Commit 63b805d

Browse files
committed
Handle query_type as both list and string in cache document analysis
1 parent 6a06d02 commit 63b805d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/vfbquery/solr_result_cache.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,9 @@ def get_cache_stats(self) -> Dict[str, Any]:
427427

428428
# Analyze each cache document
429429
for doc in docs:
430-
query_type = doc.get("query_type", "unknown")
430+
query_type_field = doc.get("query_type", "unknown")
431+
# Handle both list and string formats
432+
query_type = query_type_field[0] if isinstance(query_type_field, list) else query_type_field
431433
type_stats[query_type] = type_stats.get(query_type, 0) + 1
432434

433435
try:

0 commit comments

Comments
 (0)