Ignore:
Timestamp:
2011-08-26T23:32:25+12:00 (13 years ago)
Author:
davidb
Message:

Relocation of files to make solr.solr.home more natural. Plus, more carefully control the order in which the build_dir/index_dir folder is deleted in. For solr we need to do this earlier than lucene

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/bin/script/solr_passes.pl

    r24483 r24501  
    5858sub open_java_solr
    5959{
    60   my ($collect, $ds_idx,$full_builddir,$indexdir,$removeold) = @_;
    61 
    62   # if removeold set, then delete the curring $full_builddir
    63   if ($removeold) {
    64       my $full_indexdir = &util::filename_cat($full_builddir,$indexdir);
    65       &util::rm_r($full_indexdir);
    66   }
     60  my ($core,$full_builddir,$indexdir) = @_;
    6761
    6862  # If the Solr/Jetty server is not already running, the following starts
    6963  # it up, and only returns when the server is "reading and listening"
    7064 
    71   my $solr_server = new solrserver();
     65  my $solr_server = new solrserver($full_builddir);
    7266  $solr_server->start();
    7367  $self->{'solr_server'} = $solr_server;
    7468
    7569  # Now start up the solr-post command
    76   &solrutil::open_post_pipe($collect,$ds_idx);
     70  &solrutil::open_post_pipe($core);
    7771}
    7872
     
    187181  my $argc = scalar(@argv);
    188182
    189   my $removeold = 0;
    190183  my @filtered_argv = ();
    191184
     
    196189      my $option = $1;
    197190
    198       # -removeold causes the existing index to be overwritten
    199       if ($option eq "removeold") {
    200         print STDERR "\n-removeold set (new index will be created)\n";
    201         $removeold = 1;
    202       }
    203191      # -verbosity <num>
    204       elsif ($option eq "verbosity") {
     192      if ($option eq "verbosity") {
    205193        $i++;
    206194        if ($i<$argc)
     
    223211  my $filtered_argc = scalar(@filtered_argv);
    224212
    225   if ($filtered_argc < 5) {
    226     print STDERR "Usage: solr_passes.pl [-removeold|-verbosity num] collect \"text\"|\"index\" {d|s}idx build-dir index-name\n";
     213  if ($filtered_argc < 4) {
     214    print STDERR "Usage: solr_passes.pl [-verbosity num] core \"text\"|\"index\" build-dir index-name\n";
    227215    exit 1;
    228216  }
    229217
    230   my $collect       = $filtered_argv[0];
     218  my $core          = $filtered_argv[0];
    231219  my $mode          = $filtered_argv[1];
    232   my $ds_idx        = $filtered_argv[2];
    233   my $full_builddir = $filtered_argv[3];
    234   my $indexdir      = $filtered_argv[4];
     220  my $full_builddir = $filtered_argv[2];
     221  my $indexdir      = $filtered_argv[3];
    235222
    236223  # We only need the Solr handle opened if we are indexing the
    237224  # documents, not if we are just storing the text
    238225  if ($mode eq "index") {
    239     open_java_solr($collect, $ds_idx, $full_builddir, $indexdir, $removeold);
     226    open_java_solr($core, $full_builddir, $indexdir);
    240227  }
    241228
Note: See TracChangeset for help on using the changeset viewer.