@@ -38,6 +38,8 @@ final class IndexUpdateCommand extends AbstractCommand
3838
3939 private const OPTION_UPDATE_ASSET_INDEX = 'update-asset-index ' ;
4040
41+ private const OPTION_UPDATE_DOCUMENT_INDEX = 'update-document-index ' ;
42+
4143 private const OPTION_RECREATE_INDEX = 'recreate_index ' ;
4244
4345 private const UPDATE_GLOBAL_ALIASES_ONLY = 'update-global-aliases-only ' ;
@@ -84,6 +86,13 @@ protected function configure(): void
8486 'Update mapping and data for asset index ' ,
8587 null
8688 )
89+ ->addOption (
90+ self ::OPTION_UPDATE_DOCUMENT_INDEX ,
91+ 'd ' ,
92+ InputOption::VALUE_NONE ,
93+ 'Update mapping and data for document index ' ,
94+ null
95+ )
8796 ->addOption (
8897 self ::OPTION_RECREATE_INDEX ,
8998 'r ' ,
@@ -173,10 +182,27 @@ protected function execute(InputInterface $input, OutputInterface $output): int
173182 }
174183 }
175184
185+ if ($ input ->getOption (self ::OPTION_UPDATE_DOCUMENT_INDEX )) {
186+ $ updateAll = false ;
187+
188+ try {
189+ $ output ->writeln (
190+ '<info>Update document index</info> ' ,
191+ OutputInterface::VERBOSITY_NORMAL
192+ );
193+
194+ $ this
195+ ->indexUpdateService
196+ ->updateDocuments ();
197+ } catch (Exception $ e ) {
198+ $ this ->output ->writeln ($ e ->getMessage ());
199+ }
200+ }
201+
176202 if ($ updateAll ) {
177203 try {
178204 $ this ->output ->writeln (
179- '<info>Update all mappings and indices for objects/assets</info> ' ,
205+ '<info>Update all mappings and indices for objects/assets/documents </info> ' ,
180206 OutputInterface::VERBOSITY_NORMAL
181207 );
182208
0 commit comments