Changeset 25889
- Timestamp:
- 2012-06-28T21:25:18+12:00 (11 years ago)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/solr/trunk/src/perllib/solrbuilder.pm
r25846 r25889 116 116 my $core_prefix = (defined $site) ? "$site-$collect" : $collect; 117 117 my $core = $core_prefix; # unused in this call to solr_passes 118 119 $core = "building-".$core unless $self->{'incremental'}; # core points to building only for force_removeold 118 120 119 121 print STDERR "Executable: $solr_passes_exe\n"; … … 397 399 if ($force_removeold) { 398 400 print $outhandle "\n-removeold set (new index will be created)\n"; 401 402 # create cores under temporary core names, corresponding to building directory 403 $core = "building-".$core; 399 404 400 405 my $full_index_dir = &util::filename_cat($build_dir,$index_dir); … … 516 521 my $core = "$core_prefix-$ds_idx"; 517 522 523 $core = "building-".$core unless $self->{'incremental'}; # core points to building only for force_removeold 524 518 525 print STDERR "Cmd: $solr_passes_exe $core index \"$build_dir\" \"$indexdir\" $osextra\n"; 519 526 if (!open($handle, "| $solr_passes_exe $core index \"$build_dir\" \"$indexdir\" $osextra")) { -
gs3-extensions/solr/trunk/src/perllib/solrserver.pm
r25888 r25889 276 276 { 277 277 my $self = shift @_; 278 my ($core ) = @_;278 my ($core, $delete) = @_; 279 279 280 280 my $cgi_get_args = "action=UNLOAD&core=$core"; # &deleteIndex=true from Solr3.3 281 if(defined $delete && $delete == 1) { 282 $cgi_get_args = $cgi_get_args."&deleteIndex=true"; 283 } 281 284 282 285 $self->_admin_service($cgi_get_args); -
main/trunk/greenstone2/bin/script/activate.pl
r25888 r25889 601 601 602 602 if($removeold) { 603 604 if ($buildtype eq "solr") {605 # if solr, remove any cores using the index_dir before deleting this dir606 foreach my $corename (@corenames) {607 $solr_server->admin_unload_core($corename);608 }609 }610 603 611 604 if(&util::dir_exists($index_dir)) { 612 605 &print_task_msg("Removing \"index\""); 606 607 if ($buildtype eq "solr") { 608 # if solr, remove any cores that are using the index_dir before deleting this dir 609 foreach my $corename (@corenames) { 610 $solr_server->admin_unload_core($corename); 611 } 612 } 613 613 614 &util::rm_r($index_dir); 614 615 … … 624 625 # the collection at this point since activate.pl lives on the server side 625 626 627 if ($buildtype eq "solr") { 628 # if solr, remove any cores that are using the building_dir before moving this dir onto index 629 foreach my $corename (@corenames) { 630 $solr_server->admin_unload_core("building-$corename"); 631 } 632 } 633 626 634 # Move the building directory to become the new index directory 627 635 &print_task_msg("Moving \"building\" -> \"index\""); … … 632 640 } 633 641 elsif ($keepold) { 634 if ($buildtype eq "solr") { 635 # if solr, remove any cores using the index_dir before deleting this dir642 if ($buildtype eq "solr") { ### no building- prefix for keepold incremental case? 643 # if solr, remove any cores that may be using the building_dir before moving this dir onto index 636 644 foreach my $corename (@corenames) { 637 $solr_server->admin_unload_core( $corename);645 $solr_server->admin_unload_core("building-$corename") if $solr_server->admin_ping_core("building-$corename"); 638 646 } 639 647 } … … 646 654 647 655 if ($buildtype eq "solr") { 648 # Call CREATE action to get the old cores pointing to the index folder 656 # Call CREATE action to get all cores pointing to the index folder, since building is now index 657 ### Should already be using the index_dir directory for $keepold (incremental) case? Then call RELOAD CORE 649 658 foreach my $corename (@corenames) { 650 $solr_server->admin_create_core($corename, $index_dir); 659 if($removeold) { 660 $solr_server->admin_create_core($corename, $index_dir); 661 } elsif ($keepold) { 662 $solr_server->admin_reload_core($corename); 663 } 651 664 } 652 665
Note:
See TracChangeset
for help on using the changeset viewer.