Changeset 29176 for gs3-extensions/solr

Show
Ignore:
Timestamp:
08.08.2014 16:57:34 (5 years ago)
Author:
ak19
Message:

For Solr: 1. collConfig.pm now reads any option sub-elements for index elements defined in collectionConfig.xml. 2. The solrfieldtype option sub-element to an index element can now be set by hand in collectionConfig.xml and its value will be used in the solr collection/etc/conf/schema.xml file for that index in that collection, instead of the old default of text_en_splitting for all fields.

Files:
1 modified

Legend:

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

    r29170 r29176  
    282282    foreach my $ifm (@{$self->{'build_cfg'}->{'indexfieldmap'}}) { 
    283283 
    284         my ($field) = ($ifm =~ m/^.*->(.*)$/); 
     284        my ($fullfieldname, $field) = ($ifm =~ m/^(.*)->(.*)$/); 
    285285 
    286286        $schema_insert_xml .= "    "; # indent 
     
    297297        else 
    298298        { 
    299             $schema_insert_xml .= "type=\"text_en_splitting\" "; 
     299            #$schema_insert_xml .= "type=\"text_en_splitting\" "; 
     300 
     301            # original default solr field type for all fields is text_en_splitting 
     302            my $solrfieldtype = "text_en_splitting"; 
     303            if(defined $self->{'collect_cfg'}->{'indexfieldoptions'}->{$fullfieldname}->{'solrfieldtype'}) {     
     304            $solrfieldtype = $self->{'collect_cfg'}->{'indexfieldoptions'}->{$fullfieldname}->{'solrfieldtype'}; 
     305            #print STDERR "@@@@#### found TYPE: $solrfieldtype\n"; 
     306            } 
     307            $schema_insert_xml .= "type=\"$solrfieldtype\" "; 
     308             
    300309        } 
    301310        # set termVectors=\"true\" when term vectors info is required,