husseinelsaadi Claude Opus 4.8 commited on
Commit
889b393
·
1 Parent(s): 145f34b

rebuild_qdrant.py: also create the job_role keyword index needed for filtering

Browse files
Files changed (1) hide show
  1. scripts/rebuild_qdrant.py +10 -0
scripts/rebuild_qdrant.py CHANGED
@@ -71,6 +71,16 @@ def main() -> int:
71
  vectors_config=VectorParams(size=VECTOR_SIZE, distance=Distance.COSINE),
72
  )
73
 
 
 
 
 
 
 
 
 
 
 
74
  # Build the points. We embed the QUESTION text, exactly like the original
75
  # notebook, and store role/question/answer in the payload.
76
  questions, payloads = [], []
 
71
  vectors_config=VectorParams(size=VECTOR_SIZE, distance=Distance.COSINE),
72
  )
73
 
74
+ # The app filters questions by job_role, which requires a keyword payload
75
+ # index — without it Qdrant returns HTTP 400 and the interview silently
76
+ # falls back to generic default questions.
77
+ client.create_payload_index(
78
+ collection_name=COLLECTION_NAME,
79
+ field_name="job_role",
80
+ field_schema="keyword",
81
+ )
82
+ logging.info("Created keyword payload index on 'job_role'")
83
+
84
  # Build the points. We embed the QUESTION text, exactly like the original
85
  # notebook, and store role/question/answer in the payload.
86
  questions, payloads = [], []