@@ -37,13 +37,11 @@ def active_search_settings() -> tuple[SearchSettings, SearchSettings | None]:
37
37
)
38
38
)
39
39
search_settings_fetch = result .fetchall ()
40
- print (search_settings_fetch )
41
40
search_settings = (
42
41
SearchSettings (** search_settings_fetch [0 ]._asdict ())
43
42
if search_settings_fetch
44
43
else None
45
44
)
46
- print (search_settings )
47
45
48
46
result2 = op .get_bind ().execute (
49
47
sa .text (
@@ -303,10 +301,6 @@ def delete_document_chunks_from_vespa(index_name: str, doc_id: str) -> None:
303
301
if not hits :
304
302
break # No more chunks to process
305
303
306
- print (
307
- f"Deleting { len (hits )} chunks (offset { offset } ) for duplicate document { doc_id } "
308
- )
309
-
310
304
# Delete each chunk in this batch
311
305
for hit in hits :
312
306
vespa_doc_id = hit .get ("id" ) # This is the internal Vespa document ID
@@ -334,8 +328,6 @@ def delete_document_chunks_from_vespa(index_name: str, doc_id: str) -> None:
334
328
if len (hits ) < limit :
335
329
break
336
330
337
- print (f"Successfully deleted { total_deleted } chunks for document { doc_id } " )
338
-
339
331
340
332
def update_document_id_in_vespa (
341
333
index_name : str , old_doc_id : str , new_doc_id : str
@@ -485,8 +477,6 @@ def delete_document_from_db(current_doc_id: str, index_name: str) -> None:
485
477
# Delete chunks from vespa
486
478
delete_document_chunks_from_vespa (index_name , current_doc_id )
487
479
488
- print (f"Successfully deleted duplicate document: { current_doc_id } " )
489
-
490
480
except Exception as e :
491
481
print (f"Failed to delete duplicate document { current_doc_id } : { e } " )
492
482
# Continue with other documents instead of failing the entire migration
@@ -522,28 +512,19 @@ def upgrade() -> None:
522
512
523
513
# Check for duplicates
524
514
if normalized_doc_id in all_normalized_doc_ids :
525
- print (f"Found duplicate document with normalized ID: { normalized_doc_id } " )
526
- print (f"Deleting duplicate document: { current_doc_id } " )
527
-
528
515
delete_document_from_db (current_doc_id , index_name )
529
516
continue
530
517
531
518
all_normalized_doc_ids .add (normalized_doc_id )
532
519
533
520
# If the document ID already doesn't have query parameters, skip it
534
521
if current_doc_id == normalized_doc_id :
535
- print (
536
- f"Skipping document { current_doc_id } -> { normalized_doc_id } because it already has no query parameters"
537
- )
538
522
continue
539
523
540
- # print(f"Updating document ID: {current_doc_id} -> {normalized_doc_id}")
541
-
542
524
try :
543
525
# Update both database and Vespa in order
544
526
# Database first to ensure consistency
545
527
update_document_id_in_database (current_doc_id , normalized_doc_id )
546
- print (f"Updated database for { current_doc_id } -> { normalized_doc_id } " )
547
528
548
529
# For Vespa, we can now use the original document IDs since we're using contains matching
549
530
update_document_id_in_vespa (index_name , current_doc_id , normalized_doc_id )
0 commit comments