{
"event": "PreToolUse",
"tool_name": "Bash",
"tool_input": {
"command": "cd \/var\/www\/scripts\/pipeline\n\necho \"=== Backup dokumentation_chunks ===\"\n.\/venv\/bin\/python << 'EOF'\nimport requests\nimport json\n\nall_points = []\noffset = None\nwhile True:\n req = {'limit': 100, 'with_vector': True, 'with_payload': True}\n if offset:\n req['offset'] = offset\n resp = requests.post('http:\/\/localhost:6333\/collections\/dokumentation_chunks\/points\/scroll', json=req).json()\n points = resp['result']['points']\n if not points:\n break\n all_points.extend(points)\n offset = resp['result'].get('next_page_offset')\n if not offset:\n break\n\nprint(f'Backed up {len(all_points)} points')\nwith open('\/tmp\/dokumentation_backup.json', 'w') as f:\n json.dump(all_points, f)\nEOF\n\necho \"\"\necho \"=== Recreate with HNSW config ===\"\ncurl -s -X DELETE \"http:\/\/localhost:6333\/collections\/dokumentation_chunks\"\ncat > \/tmp\/create_doku.json << 'EOF'\n{\n \"vectors\": {\"size\": 1024, \"distance\": \"Cosine\"},\n \"hnsw_config\": {\"m\": 16, \"ef_construct\": 128, \"full_scan_threshold\": 50},\n \"optimizer_config\": {\"indexing_threshold\": 0, \"default_segment_number\": 1}\n}\nEOF\ncurl -s -X PUT \"http:\/\/localhost:6333\/collections\/dokumentation_chunks\" -H \"Content-Type: application\/json\" -d @\/tmp\/create_doku.json\necho \"\"\n\necho \"=== Restore points ===\"\n.\/venv\/bin\/python << 'EOF'\nimport requests\nimport json\nwith open('\/tmp\/dokumentation_backup.json') as f:\n all_points = json.load(f)\nfor i in range(0, len(all_points), 100):\n batch = all_points[i:i+100]\n requests.put('http:\/\/localhost:6333\/collections\/dokumentation_chunks\/points?wait=true', json={'points': batch})\nprint(f'Restored {len(all_points)} points')\nEOF",
"timeout": 120000,
"description": "Fix dokumentation_chunks"
}
}
{
"tool_response": {
"stdout": "=== Backup dokumentation_chunks ===\nBacked up 374 points\n\n=== Recreate with HNSW config ===\n{\"result\":true,\"status\":\"ok\",\"time\":0.007436493}{\"result\":true,\"status\":\"ok\",\"time\":0.010890939}\n=== Restore points ===\nRestored 374 points",
"stderr": "",
"interrupted": false,
"isImage": false
}
}