@@ -265,7 +265,7 @@ func (fi *FilesystemIndexer) IndexDirectoryWithProgress(rootPath string, showPro
265265 BarEnd : "]" ,
266266 }),
267267 progressbar .OptionOnCompletion (func () {
268- fmt .Printf ("\n ✅ Indexing completed!\n " )
268+ fmt .Printf ("\n ✔️ Indexing completed!\n " )
269269 }),
270270 )
271271 }
@@ -350,7 +350,10 @@ func (fi *FilesystemIndexer) IndexDirectoriesWithProgress(rootPaths []string, sh
350350 // Track this root path if not already tracked
351351 fi .addRootPath (rootPath )
352352
353- log .Printf ("Starting filesystem indexing for directory %d/%d: %s" , i + 1 , len (rootPaths ), rootPath )
353+ if showProgress {
354+ log .Printf ("Starting filesystem indexing for directory %d/%d: %s" , i + 1 , len (rootPaths ), rootPath )
355+ }
356+
354357 count := 0
355358
356359 err := filepath .WalkDir (rootPath , func (path string , d fs.DirEntry , err error ) error {
@@ -407,15 +410,17 @@ func (fi *FilesystemIndexer) IndexDirectoriesWithProgress(rootPaths []string, sh
407410 }
408411 }
409412
410- log .Printf ("Completed indexing directory %s: %d files/directories" , rootPath , count )
413+ if showProgress {
414+ log .Printf ("Completed indexing directory %s: %d files/directories" , rootPath , count )
415+ }
411416 }
412417
413418 if showProgress && overallBar != nil {
414- overallBar .Describe ("✅ Indexing completed" )
419+ overallBar .Describe ("✔️ Indexing completed" )
415420 overallBar .Finish ()
416- }
417421
418- log .Printf ("Multi-directory indexing completed. Total indexed: %d files/directories across %d directories" , totalCount , len (rootPaths ))
422+ log .Printf ("Multi-directory indexing completed. Total indexed: %d files/directories across %d directories" , totalCount , len (rootPaths ))
423+ }
419424 return nil
420425}
421426
@@ -471,7 +476,9 @@ func (fi *FilesystemIndexer) ReindexExistingPaths(showProgress bool) error {
471476 return nil
472477 }
473478
474- log .Printf ("Re-indexing %d tracked root paths to discover new files" , len (fi .rootPaths ))
479+ if showProgress {
480+ log .Printf ("Re-indexing %d tracked root paths to discover new files" , len (fi .rootPaths ))
481+ }
475482
476483 // Filter out root paths that no longer exist
477484 var validRootPaths []string
@@ -502,9 +509,7 @@ func (fi *FilesystemIndexer) RefreshIndex(showProgress bool, showStats bool) err
502509 return fmt .Errorf ("no tracked paths found in index" )
503510 }
504511
505- if showStats {
506- fmt .Printf ("📊 Current index: %s\n " , fi .GetIndexStats ())
507- }
512+ fmt .Printf ("📊 Current index: %s\n " , fi .GetIndexStats ())
508513
509514 if showProgress {
510515 fmt .Printf ("🔄 Re-indexing %d tracked paths to discover new files...\n " , len (rootPaths ))
@@ -521,17 +526,13 @@ func (fi *FilesystemIndexer) RefreshIndex(showProgress bool, showStats bool) err
521526 fmt .Printf ("\n 💾 Saving updated index to disk..." )
522527 }
523528
524- if persistErr := fi .PersistIndex (); persistErr != nil {
529+ if persistErr := fi .PersistIndex (showProgress ); persistErr != nil {
525530 if showProgress {
526531 fmt .Printf (" ❌\n " )
527532 }
528533 return fmt .Errorf ("failed to persist updated index: %v" , persistErr )
529534 }
530535
531- if showProgress {
532- fmt .Printf (" ✅\n " )
533- }
534-
535536 if showStats {
536537 fmt .Printf ("\n 📊 Updated index: %s\n " , fi .GetIndexStats ())
537538 }
@@ -807,25 +808,30 @@ func (fi *FilesystemIndexer) GetIndexPath() string {
807808 return filepath .Join (homeDir , ".recaller_fs_index.bin" )
808809}
809810
810- func (fi * FilesystemIndexer ) LoadOrCreateIndex () error {
811+ func (fi * FilesystemIndexer ) LoadOrCreateIndex (showProgress bool ) error {
811812 indexPath := fi .GetIndexPath ()
812813
813814 if _ , err := os .Stat (indexPath ); os .IsNotExist (err ) {
814815 log .Printf ("No existing filesystem index found, will create new one" )
815816 return nil
816817 }
817818
818- log .Printf ("Loading existing filesystem index from: %s" , indexPath )
819+ if showProgress {
820+ log .Printf ("Loading existing filesystem index from: %s" , indexPath )
821+ }
819822 return fi .LoadFromFile (indexPath )
820823}
821824
822- func (fi * FilesystemIndexer ) PersistIndex () error {
825+ func (fi * FilesystemIndexer ) PersistIndex (showProgress bool ) error {
823826 if ! fi .isDirty {
824827 return nil
825828 }
826829
827830 indexPath := fi .GetIndexPath ()
828- log .Printf ("Persisting filesystem index to: %s" , indexPath )
831+
832+ if showProgress {
833+ log .Printf ("Persisting filesystem index to: %s" , indexPath )
834+ }
829835 return fi .SaveToFile (indexPath )
830836}
831837
@@ -834,12 +840,11 @@ func (fi *FilesystemIndexer) GetIndexStats() string {
834840 sketchSize := CountMinDepth * CountMinWidth * 4 // int32 = 4 bytes
835841 bloomSize := int (fi .bloomFilter .Cap () / 8 ) // Approximate bloom filter size in bytes
836842
837- return fmt .Sprintf ("Index Stats: %d files, Memory: %.2fKB (Records: %.2fKB, Sketch: %.2fKB, Bloom : %.2fKB)" ,
843+ return fmt .Sprintf ("Index Stats: %d files, Memory: %.2fKB (Records: %.2fKB, Metadata : %.2fKB)" ,
838844 len (fi .pathRecords ),
839845 float64 (indexSize + sketchSize + bloomSize )/ 1024 ,
840846 float64 (indexSize )/ 1024 ,
841- float64 (sketchSize )/ 1024 ,
842- float64 (bloomSize )/ 1024 )
847+ (float64 (sketchSize )/ 1024 )+ (float64 (bloomSize )/ 1024 ))
843848}
844849
845850// CleanupOptions defines options for index cleanup
0 commit comments