Changeset 25888 for gs3-extensions/solr/trunk/src/perllib
- Timestamp:
- 2012-06-28T18:54:11+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/solr/trunk/src/perllib/solrserver.pm
r24643 r25888 204 204 } 205 205 206 206 # Some of the Solr CoreAdmin API calls available. 207 # See http://wiki.apache.org/solr/CoreAdmin 207 208 sub admin_reload_core 208 209 { … … 215 216 } 216 217 218 sub admin_rename_core 219 { 220 my $self = shift @_; 221 my ($oldcore, $newcore) = @_; 222 223 my $cgi_get_args = "action=RENAME&core=$oldcore&other=$newcore"; 224 225 $self->_admin_service($cgi_get_args); 226 } 227 228 sub admin_swap_core 229 { 230 my $self = shift @_; 231 my ($oldcore, $newcore) = @_; 232 233 my $cgi_get_args = "action=SWAP&core=$oldcore&other=$newcore"; 234 235 $self->_admin_service($cgi_get_args); 236 } 237 238 # The ALIAS action is not supported in our version of solr (despite it 239 # being marked as experimental in the documentation for Core Admin) 240 sub admin_alias_core 241 { 242 my $self = shift @_; 243 my ($oldcore, $newcore) = @_; 244 245 my $cgi_get_args = "action=ALIAS&core=$oldcore&other=$newcore"; 246 247 $self->_admin_service($cgi_get_args); 248 } 217 249 218 250 sub admin_create_core 219 251 { 220 252 my $self = shift @_; 221 my ($core, $removeold) = @_;253 my ($core, $data_parent_dir) = @_; # data_parent_dir is optional, can be index_dir. Defaults to builddir if not provided 222 254 223 255 my ($ds_idx) = ($core =~ m/^.*-(.*?)$/); … … 227 259 my $collect_home = $ENV{'GSDLCOLLECTDIR'}; 228 260 my $etc_dirname = &util::filename_cat($collect_home,"etc"); 229 230 my $build_dir = $self->{'build_dir'}; 231 my $idx_dirname = &util::filename_cat($build_dir,$ds_idx); 261 262 if(!defined $data_parent_dir) { 263 $data_parent_dir = $self->{'build_dir'}; 264 } 265 266 my $idx_dirname = &util::filename_cat($data_parent_dir,$ds_idx); # "dataDir" 232 267 233 268 $cgi_get_args .= "&instanceDir=$etc_dirname"; … … 237 272 } 238 273 239 274 # removes (unloads) core from th eext/solr/sorl.xml config file 275 sub admin_unload_core 276 { 277 my $self = shift @_; 278 my ($core) = @_; 279 280 my $cgi_get_args = "action=UNLOAD&core=$core"; # &deleteIndex=true from Solr3.3 281 282 $self->_admin_service($cgi_get_args); 283 } 284 285 sub copy_solrxml_to_web 286 { 287 my $self = shift @_; 288 289 my $ext_solrxml = &util::filename_cat($ENV{'GEXT_SOLR'}, "solr.xml"); 290 my $web_solrxml = &util::filename_cat($ENV{'GSDL3HOME'}, "ext", "solr", "solr.xml"); 291 292 #print STDERR "@@@@ Copying $ext_solrxml to $web_solrxml...\n"; 293 294 &util::cp($ext_solrxml, $web_solrxml); 295 } 240 296 241 297 sub start
Note:
See TracChangeset
for help on using the changeset viewer.