Changeset 33327 for gs3-extensions/solr/trunk/src/perllib/solrbuildproc.pm
- Timestamp:
- 2019-07-18T22:45:22+12:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/solr/trunk/src/perllib/solrbuildproc.pm
r32441 r33327 202 202 203 203 } 204 sub create_shortname { 204 205 # UNUSED now by default. 206 # Georgy overrode the mgppbuildproc::create_shortname() method in commit 32441 to create the method below, to override the inherited 207 # behaviour so that create_shortname() worked appropriately for his use cases involving multiple analyzers. 208 # As a result, create_shortname() for solr no longer did a lookup into the %mgppbuildproc::static_indexfield_map for registered shortnames. 209 # For the rest, this method is a copy mgppbuildproc::create_shortname(). 210 # But we want the original mgppbuildproc::create_shortname() behaviour restored, as it does the lookups into %static_indexfield_map that's necessary for us. 211 # So we've renamed this function to create_shortname_multi_solr_analyzer below so it won't get called as default beahviour any more. 212 # Rename to create_shortname() when requiring Georgy's behaviour. 213 sub create_shortname_multi_solr_analyzer { 205 214 my $self = shift(@_); 206 215 … … 500 509 501 510 if ($section_text ne "") { 502 $new_text .= "$section_text "; 511 512 if ($allfields_index) { 513 $allfields_text .= "$section_text "; 514 } 515 516 # Remove any leading or trailing white space 517 $section_text =~ s/\s+$//; 518 $section_text =~ s/^\s+//; 519 520 if ($self->{'indexing_text'}) { 521 # add the tag 522 $new_text .= "<field name=\"$shortname\" >$section_text</field>\n"; 523 } else { 524 $new_text .= "$section_text "; 525 } 503 526 } 504 527 505 528 foreach my $item (@metadata_list) { 506 529 &ghtml::htmlsafe($item); 507 $new_text .= "$item "; 508 } 509 510 if ($allfields_index) { 511 $allfields_text .= $new_text; 512 } 513 514 # Remove any leading or trailing white space 515 $new_text =~ s/\s+$//; 516 $new_text =~ s/^\s+//; 517 530 531 if ($allfields_index) { 532 $allfields_text .= "$item "; 533 } 534 535 # Remove any leading or trailing white space 536 $item =~ s/\s+$//; 537 $item =~ s/^\s+//; 538 539 if ($self->{'indexing_text'}) { 540 # add the tag 541 $new_text .= "<field name=\"$shortname\" >$item</field>\n"; 542 } else { 543 $new_text .= "$item "; 544 } 545 } # end for loop processing @metadata_list 518 546 519 if ($self->{'indexing_text'}) {520 # add the tag521 $new_text = "<field name=\"$shortname\" >$new_text</field>\n";522 }523 547 # filter the text 524 548 $new_text = $self->filter_text ($field, $new_text); … … 669 693 670 694 foreach my $item (@metadata_list) { 671 &ghtml::htmlsafe($item); 672 673 $item = "<field name=\"$sf_shortname\">$item</field>\n"; 674 # filter the text??? 675 $text .= "$item"; # add it to the main text block 676 #print "#### new_text: $item\n"; 695 &ghtml::htmlsafe($item); 696 if ($item =~ /\S/) { 697 $item = "<field name=\"$sf_shortname\">$item</field>\n"; 698 # filter the text??? 699 $text .= "$item"; # add it to the main text block 700 #print "#### new_text: $item\n"; 701 } 677 702 } 678 703 if(scalar @metadata_list > 0) {
Note:
See TracChangeset
for help on using the changeset viewer.