- Timestamp:
- 2011-08-24T15:52:02+12:00 (13 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/basebuilder.pm
r24342 r24460 329 329 my $outhandle = $self->{'outhandle'}; 330 330 331 $self->pre_build_indexes(); 332 331 333 my $indexes = []; 332 334 if (defined $indexname && $indexname =~ /\w/) { … … 352 354 } 353 355 354 $self->build_indexes_extra(); 355 356 $self->post_build_indexes(); 357 358 } 359 360 # implement this in subclass if want to do extra stuff at before building 361 # all the indexes 362 sub pre_build_indexes { 363 my $self = shift(@_); 364 my ($indexname) = @_; # optional parameter 356 365 } 357 366 358 367 # implement this in subclass if want to do extra stuff at the end of building 359 368 # all the indexes 360 sub build_indexes_extra { 361 my $self = shift(@_); 362 369 sub post_build_indexes { 370 my $self = shift(@_); 363 371 } 364 372 -
main/trunk/greenstone2/perllib/lucenebuilder.pm
r24362 r24460 26 26 ########################################################################### 27 27 # /* 28 # * @version 1.0 ?28 # * @version 1.0 Automated incremental building 29 29 # * @version 2.0 Incremental building assistance added, including 30 30 # * remove_document_from_database which implements the granddad's … … 33 33 # * perl script is. John Rowe 34 34 # * 35 # * @authro Waikato Digital Library Research Group 35 36 # * @author John Rowe, DL Consulting Ltd. 36 37 # */ … … 117 118 } 118 119 } 119 120 120 } 121 121 … … 227 227 my $outhandle = $self->{'outhandle'}; 228 228 229 $self->pre_build_indexes($indexname); 230 229 231 my $indexes = []; 230 232 if (defined $indexname && $indexname =~ /\w/) { … … 233 235 $indexes = $self->{'collect_cfg'}->{'indexes'}; 234 236 } 235 # have we got para index? 237 238 # Have we got para index? 236 239 foreach my $level (keys %{$self->{'levels'}}) { 237 240 if ($level =~ /paragraph/) { 238 print $outhandle "Warning: Paragraph level indexing not supported by Lucene \n";241 print $outhandle "Warning: Paragraph level indexing not supported by Lucene/Solr\n"; 239 242 last; 240 243 } 241 244 } 242 # create the mapping between the index descriptions 245 246 # Create the mapping between the index descriptions 243 247 # and their directory names (includes subcolls and langs) 244 248 $self->{'index_mapping'} = $self->create_index_mapping ($indexes); … … 246 250 # build each of the indexes 247 251 foreach my $index (@$indexes) { 252 248 253 if ($self->want_built($index)) { 249 254 … … 271 276 } 272 277 273 #define the final field lists 274 $self->make_final_field_list(); 278 $self->post_build_indexes(); 275 279 } 276 280 -
main/trunk/greenstone2/perllib/lucenebuildproc.pm
r24404 r24460 239 239 } # for each field in this one index 240 240 241 241 242 # now we add the text and/or metadata into new_text 242 243 if ($section_text ne "" || scalar(@metadata_list)) { … … 283 284 284 285 } # foreach field 285 286 286 287 287 if ($all_metadata_specified) { -
main/trunk/greenstone2/perllib/mgppbuilder.pm
r24404 r24460 282 282 283 283 284 sub build_indexes_extra{284 sub post_build_indexes { 285 285 my $self = shift(@_); 286 286 287 #define the final field lists 287 288 $self->make_final_field_list(); … … 617 618 my $collection_infodb = shift(@_); 618 619 619 # define the indexed field mapping if not already done so (ie if infodb called separately from build_index) 620 # define the indexed field mapping if not already done so 621 # (i.e. if infodb called separately from build_index) 620 622 if (!defined $self->{'build_cfg'}) { 621 623 $self->read_final_field_list(); … … 703 705 # at the end of building, we have an indexfieldmap with all the mappings, 704 706 # plus some extras, and indexmap with any indexes in it that weren't 705 # specified in the index definition. we want to make an ordered list of706 # fields that are indexed, and a list of mappings that are used. this will707 # specified in the index definition. We want to make an ordered list of 708 # fields that are indexed, and a list of mappings that are used. This will 707 709 # be used for the build.cfg file, and for collection meta definition we 708 710 # store these in a build.cfg bit … … 763 765 push (@indexfields, "$field"); 764 766 } 765 766 767 767 } 768 768 } … … 771 771 $self->{'build_cfg'}->{'indexfieldmap'} = \@indexfieldmap; 772 772 } 773 773 774 if (scalar @indexfields) { 774 775 $self->{'build_cfg'}->{'indexfields'} = \@indexfields;
Note:
See TracChangeset
for help on using the changeset viewer.