PM-4514 Adicionar un nuevo metodo para el script de indexación de solr para borrar indice
This commit is contained in:
@@ -28,9 +28,11 @@
|
|||||||
//(count ($argv) == 4) || ((count ($argv) == 5) && ($argv [3] != '-skip'))
|
//(count ($argv) == 4) || ((count ($argv) == 5) && ($argv [3] != '-skip'))
|
||||||
$commandLineSyntaxMsg = "Invalid command line arguments: \n " .
|
$commandLineSyntaxMsg = "Invalid command line arguments: \n " .
|
||||||
"syntax: ".
|
"syntax: ".
|
||||||
"php reindex_solr.php [workspace_name] [reindexall|reindexmissing|optimizeindex|reindexone] [-skip {record_number}] [-reindextrunksize {trunk_size}] [-appuid {APP_UID}]\n" .
|
"php reindex_solr.php [workspace_name] [reindexall|reindexmissing|optimizeindex|reindexone|deleteindexone] [-skip {record_number}] [-reindextrunksize {trunk_size}] [-appuid {APP_UID}]\n" .
|
||||||
" Where \n".
|
" Where \n".
|
||||||
" reindexall : reindex all the database. \n" .
|
" reindexall : reindex all the database. \n" .
|
||||||
|
" reindexone : reindex one case. -appuid parameter is required.\n" .
|
||||||
|
" deleteindexone : delete one case from index. -appuid parameter is required.\n" .
|
||||||
" reindexmissing: reindex only the missing records stored in database. \n".
|
" reindexmissing: reindex only the missing records stored in database. \n".
|
||||||
" (records defined in APP_SOLR_QUEUE table are required)\n" .
|
" (records defined in APP_SOLR_QUEUE table are required)\n" .
|
||||||
" optimizeindex: optimize the changes in the search index. (used to get faster results) \n" .
|
" optimizeindex: optimize the changes in the search index. (used to get faster results) \n" .
|
||||||
@@ -39,7 +41,7 @@ $commandLineSyntaxMsg = "Invalid command line arguments: \n " .
|
|||||||
" -reindextrunksize {trunk_size}: specify the number of records sent to index each time. \n ex: -reindextrunksize 100 //(default = 1000) \n Reduce the trunk if using big documents, and memory is not enough. \n";
|
" -reindextrunksize {trunk_size}: specify the number of records sent to index each time. \n ex: -reindextrunksize 100 //(default = 1000) \n Reduce the trunk if using big documents, and memory is not enough. \n";
|
||||||
|
|
||||||
if ( (count ($argv) < 3) || ((count ($argv) % 2) == 0) ||
|
if ( (count ($argv) < 3) || ((count ($argv) % 2) == 0) ||
|
||||||
($argv [2] != 'reindexall' && $argv [2] != 'reindexmissing' && $argv [2] != 'optimizeindex' && $argv [2] != 'reindexone')) {
|
($argv [2] != 'reindexall' && $argv [2] != 'reindexmissing' && $argv [2] != 'optimizeindex' && $argv [2] != 'reindexone' && $argv [2] != 'deleteindexone')) {
|
||||||
print $commandLineSyntaxMsg;
|
print $commandLineSyntaxMsg;
|
||||||
die ();
|
die ();
|
||||||
}
|
}
|
||||||
@@ -338,6 +340,12 @@ function processWorkspace()
|
|||||||
}
|
}
|
||||||
$oAppSolr->updateApplicationSearchIndex ($appUid, false);
|
$oAppSolr->updateApplicationSearchIndex ($appUid, false);
|
||||||
}
|
}
|
||||||
|
if($ScriptAction == "deleteindexone"){
|
||||||
|
if($appUid == ""){
|
||||||
|
print "Missing -appuid parameter. please complete it with this option.\n";
|
||||||
|
}
|
||||||
|
$oAppSolr->deleteApplicationSearchIndex ($appUid, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
print "Incomplete Solr configuration. See configuration file: " . PATH_DATA_SITE . "env.ini";
|
print "Incomplete Solr configuration. See configuration file: " . PATH_DATA_SITE . "env.ini";
|
||||||
|
|||||||
Reference in New Issue
Block a user