Ignore:
Timestamp:
2011-08-22T14:17:35+12:00 (11 years ago)
Author:
davidb
Message:

Tidy up of code (removing commented out redundant code), plus tweaking of code that starts and stops jetty to cope with situation where the server is already running

Location:
gs3-extensions/solr/trunk/src/perllib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/perllib/solrbuilder.pm

    r24446 r24447  
    320320    # to figure out what the metadata_field_mapping is     
    321321
    322 ##  my $db_level = "section"; #always
    323 
    324322    # set up the document processr
    325323    $self->{'buildproc'}->set_output_handle (undef);
    326324    $self->{'buildproc'}->set_mode ('index_field_mapping');
    327 ##  $self->{'buildproc'}->set_index ($index);
    328 ##  $self->{'buildproc'}->set_indexing_text (0);
    329     #$self->{'buildproc'}->set_indexfieldmap ($self->{'indexfieldmap'});
    330 ##  $self->{'buildproc'}->set_levels ($levels);
    331 ##  $self->{'buildproc'}->set_db_level ($db_level);
    332325    $self->{'buildproc'}->reset();
    333326   
     
    338331    &plugin::end($self->{'pluginfo'});
    339332   
    340 ##  close ($handle) unless $self->{'debug'};
    341 
    342 ##  $self->print_stats();
    343 
    344     # just make "delete" stop  ???
    345333    }
    346334
     
    373361
    374362}
    375 
    376 # Essentially the same as the lucenebuilder.pm version, only using solr_passes
    377 # => refactor and make better use of inheritence
    378 
    379 sub build_indexesXXXX {
    380     my $self = shift (@_);
    381     my ($indexname) = @_;
    382     my $outhandle = $self->{'outhandle'};
    383 
    384     $self->pre_build_indexes($indexname);
    385 
    386     my $indexes = [];
    387     if (defined $indexname && $indexname =~ /\w/) {
    388     push @$indexes, $indexname;
    389     } else {
    390     $indexes = $self->{'collect_cfg'}->{'indexes'};
    391     }
    392 
    393     # have we got para index?
    394     foreach my $level (keys %{$self->{'levels'}}) {
    395     if ($level =~ /paragraph/) {
    396         print $outhandle "Warning: Paragraph level indexing not supported by Solr\n";
    397         last;
    398     }
    399     }
    400     # create the mapping between the index descriptions
    401     # and their directory names (includes subcolls and langs)
    402     $self->{'index_mapping'} = $self->create_index_mapping ($indexes);
    403 
    404     # build each of the indexes
    405     foreach my $index (@$indexes) {
    406     if ($self->want_built($index)) {
    407 
    408         my $idx = $self->{'index_mapping'}->{$index};
    409         foreach my $level (keys %{$self->{'levels'}}) {
    410         next if $level =~ /paragraph/; # we don't do para indexing
    411         my ($pindex) = $level =~ /^(.)/;
    412         # should probably check that new name with level
    413         # is unique ... but currently (with doc sec and para)
    414         # each has unique first letter.
    415         $self->{'index_mapping'}->{$index} = $pindex.$idx;
    416 
    417         my $llevel = $mgppbuilder::level_map{$level};
    418         print $outhandle "\n*** building index $index at level $llevel in subdirectory " .
    419             "$self->{'index_mapping'}->{$index}\n" if ($self->{'verbosity'} >= 1);
    420         print STDERR "<Stage name='Index' source='$index' level=$llevel>\n" if $self->{'gli'};
    421 
    422         $self->build_index($index,$llevel);
    423         }
    424         $self->{'index_mapping'}->{$index} = $idx;
    425 
    426     } else {
    427         print $outhandle "\n*** ignoring index $index\n" if ($self->{'verbosity'} >= 1);
    428     }
    429     }
    430 }
    431 
    432363
    433364# Essentially the same as the lucenebuilder.pm version, only using solr_passes
     
    546477    print $handle "<update>\n";
    547478
    548     open(TOUT,">/tmp/solr.out"); binmode(TOUT,":utf8");
    549     print TOUT "<update>\n";
    550     close(TOUT);
    551 
    552479    &plugin::read ($self->{'pluginfo'}, $self->{'source_dir'},
    553480           "", {}, {}, $self->{'buildproc'}, $self->{'maxdocs'}, 0, $self->{'gli'});
     
    556483    print $handle "</update>\n";
    557484
    558     open(TOUT,">>/tmp/solr.out"); binmode(TOUT,":utf8");
    559     print TOUT "</update>\n";
    560     close(TOUT);
    561 
    562485    close ($handle) unless $self->{'debug'};
    563486
     
    568491
    569492}
    570 
    571493
    572494
  • gs3-extensions/solr/trunk/src/perllib/solrbuildproc.pm

    r24446 r24447  
    556556    $text .= $end_doc if ($sec_tag_name eq "");
    557557
    558 
    559558##    $text .= "<commit/>\n";
    560559
    561560    print $solrhandle $text;
    562561
    563     open(TOUT,">>/tmp/solr.out"); binmode(TOUT,":utf8");
    564     print TOUT $text;
    565     close(TOUT);
    566562}
    567563
Note: See TracChangeset for help on using the changeset viewer.