Changeset 25846


Ignore:
Timestamp:
2012-06-28T11:11:31+12:00 (9 years ago)
Author:
sjm84
Message:

Some fixes and additions to the Solr perl code

Location:
gs3-extensions/solr/trunk/src
Files:
1 added
3 edited

Legend:

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

    r24643 r25846  
    229229    foreach my $ifm (@{$self->{'build_cfg'}->{'indexfieldmap'}}) {
    230230
    231     my ($field) = ($ifm =~ m/^.*->(.*)$/);
    232 
    233     # Need special case for Long/Lat
    234     # ... but for now treat everything as of type string
    235 
    236     $schema_insert_xml .= "    "; # indent
    237     $schema_insert_xml .= "<field name=\"$field\" ";
    238     $schema_insert_xml .=   "type=\"text_en_splitting\" indexed=\"true\" ";
    239     $schema_insert_xml .=   "stored=\"false\" multiValued=\"true\" />\n";
     231        my ($field) = ($ifm =~ m/^.*->(.*)$/);
     232
     233        $schema_insert_xml .= "    "; # indent
     234        $schema_insert_xml .= "<field name=\"$field\" ";
     235
     236        if($field eq "LA" || $field eq "LO")
     237        {
     238            $schema_insert_xml .=   "type=\"location\" ";
     239        }
     240        elsif ($field ne "ZZ" && $field ne "TX")
     241        {
     242            $schema_insert_xml .=   "type=\"string\" ";
     243        }
     244        else
     245        {
     246            $schema_insert_xml .= "type=\"text_en_splitting\" ";
     247        }
     248        $schema_insert_xml .=  "indexed=\"true\" stored=\"false\" multiValued=\"true\" />\n";
    240249    }
    241250
     
    544553    &plugin::read ($self->{'pluginfo'}, $self->{'source_dir'},
    545554           "", {}, {}, $self->{'buildproc'}, $self->{'maxdocs'}, 0, $self->{'gli'});
    546 
    547 
     555   
    548556    print $handle "</update>\n";
    549557
  • gs3-extensions/solr/trunk/src/perllib/solrbuildproc.pm

    r24447 r25846  
    266266    my $gs2_docOID = $doc_obj->get_OID();
    267267
    268 
    269268    my $start_doc;
    270269    my $end_doc;
     
    296295
    297296    # only output if working with doc level
    298     my $text = $start_doc if ($sec_tag_name eq "");
    299 
     297    # my $text = undef;
     298   
     299    my $text = ($sec_tag_name eq "") ? $start_doc : "";
     300
     301#     my $text = $start_doc if ($sec_tag_name eq "");
     302     
    300303    # get the text for this document
    301304    my $section = $doc_obj->get_top_section();
     
    318321        $start_sec .= "    <doc>\n";
    319322        $start_sec .= "      <field name=\"docOID\">$sec_gs2_docOID</field>\n";
    320 
     323   
    321324        $end_sec    = "    </doc>\n";
    322325        $end_sec   .= "  </add>\n";
     
    441444        }
    442445
     446        # Remove any leading or trailing white space
     447        $new_text =~ s/\s+$//;
     448        $new_text =~ s/^\s+//;
     449   
     450       
    443451        if ($self->{'indexing_text'}) {
    444452            # add the tag
  • gs3-extensions/solr/trunk/src/perllib/solrutil.pm

    r24501 r25846  
    7979    $post_props .= " -Dcommit=yes";
    8080   
    81     my $post_java_cmd = "java $post_props -jar \"$full_post_jar\"";
     81    my $post_java_cmd = "java -Xmx256M $post_props -jar \"$full_post_jar\"";
    8282   
    83 ##  print STDERR "**** post cmd = $post_java_cmd\n";
     83    ##print STDERR "**** post cmd = $post_java_cmd\n";
    8484   
    8585    open (PIPEOUT, "| $post_java_cmd")
Note: See TracChangeset for help on using the changeset viewer.