Browse Source

:fire: updateIndex

visuddhinanda 1 day ago
parent
commit
73b51296f7
1 changed files with 2 additions and 16 deletions
  1. 2 16
      api-v12/app/Console/Commands/CreateOpenSearchIndex.php

+ 2 - 16
api-v12/app/Console/Commands/CreateOpenSearchIndex.php

@@ -64,26 +64,12 @@ class CreateOpenSearchIndex extends Command
         } catch (\Exception $e) {
         } catch (\Exception $e) {
             if (str_contains($e->getMessage(), 'exists')) {
             if (str_contains($e->getMessage(), 'exists')) {
                 $this->warn('Index already exists, attempting to update...');
                 $this->warn('Index already exists, attempting to update...');
-                try {
-                    $update = $openSearch->updateIndex();
-                    if (!empty($update['settings']) && $update['settings']['acknowledged']) {
-                        $this->info('Index settings updated successfully');
-                    }
-                    if (!empty($update['mappings']) && $update['mappings']['acknowledged']) {
-                        $this->info('Index mappings updated successfully');
-                    }
-                    if (empty($update['settings']) && empty($update['mappings'])) {
-                        $this->warn('No settings or mappings provided for update');
-                    }
-                } catch (\Exception $updateException) {
-                    $this->error('Failed to update index: ' . $updateException->getMessage());
-                    return 1;
-                }
             } else {
             } else {
                 $this->error('Failed to create index: ' . $e->getMessage());
                 $this->error('Failed to create index: ' . $e->getMessage());
-                return 1;
             }
             }
+            return 1;
         }
         }
+
         return 0;
         return 0;
     }
     }
 }
 }