Changeset 29176 for gs3-extensions/solr


Ignore:
Timestamp:
2014-08-08T16:57:34+12:00 (10 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.

File:
1 edited

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,
Note: See TracChangeset for help on using the changeset viewer.