Changeset 10158
- Timestamp:
- 2005-06-23T11:23:42+12:00 (19 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/lucenebuilder.pm
r9910 r10158 58 58 59 59 eval("\$self->{'buildproc'} = new $buildproctype(\$collection, " . 60 "\$source_dir, \$build_dir, \$ verbosity, \$outhandle)");60 "\$source_dir, \$build_dir, \$keepold, \$verbosity, \$outhandle)"); 61 61 die "$@" if $@; 62 62 … … 217 217 my $lucene_passes_sections = $llevel; 218 218 219 my $opt_create_index = ($self->{'keepold'}) ? "" : "-create"; 220 219 221 my $osextra = ""; 220 222 if ($ENV{'GSDLOS'} =~ /^windows$/i) { 221 223 $build_dir =~ s@/@\\@g; 222 224 } else { 223 $osextra = " -d /";224 225 if ($outhandle ne "STDERR") { 225 226 # so lucene_passes doesn't print to stderr if we redirect output … … 275 276 } else { 276 277 if (!-e "$lucene_passes_exe" || 277 !open (PIPEOUT, "| $full_lucene_passes_exe index $lucene_passes_sections \"$build_dir\" \"$indexdir\" $osextra")) {278 !open (PIPEOUT, "| $full_lucene_passes_exe $opt_create_index index $lucene_passes_sections \"$build_dir\" \"$indexdir\" $osextra")) { 278 279 print STDERR "<FatalError name='NoRunLucenePasses'/>\n</Stage>\n" if $self->{'gli'}; 279 280 die "lucenebuilder::build_index - couldn't run $lucene_passes_exe\n"; -
trunk/gsdl/perllib/mgbuilder.pm
r9938 r10158 196 196 197 197 eval("\$self->{'buildproc'} = new $buildproctype(\$collection, " . 198 "\$source_dir, \$build_dir, \$ verbosity, \$outhandle)");198 "\$source_dir, \$build_dir, \$keepold, \$verbosity, \$outhandle)"); 199 199 die "$@" if $@; 200 200 … … 922 922 sub deinit { 923 923 my $self = shift (@_); 924 925 &plugin::deinit($self->{'pluginfo'},$self->{'buildproc'}); 924 926 } 925 927 -
trunk/gsdl/perllib/mgppbuilder.pm
r9938 r10158 264 264 265 265 eval("\$self->{'buildproc'} = new $buildproctype(\$collection, " . 266 "\$source_dir, \$build_dir, \$ verbosity, \$outhandle)");266 "\$source_dir, \$build_dir, \$keepold, \$verbosity, \$outhandle)"); 267 267 die "$@" if $@; 268 268 … … 864 864 #$self->{'buildproc'}->set_indexfieldmap ($self->{'indexfieldmap'}); 865 865 866 $self->{'buildproc'}->reset(); 866 # make_infodatabase does not support incremental build 867 # => full reset needed 868 $self->{'buildproc'}->zero_reset(); 867 869 868 870 # do the collection info … … 938 940 } 939 941 print $handle $subcoll_entry; 940 # now add language meta 942 943 # now add language meta 941 944 my $lang_entry = ""; 942 945 foreach my $lang (@{$self->{'index_mapping'}->{'languagemaporder'}}) { … … 950 953 } 951 954 print $handle $lang_entry; 952 #end the collection entry 953 print $handle "\n" . ('-' x 70) . "\n"; 954 955 955 # end the collection entry 956 print $handle "\n" . ('-' x 70) . "\n"; 956 957 957 958 &plugin::read ($self->{'pluginfo'}, $self->{'source_dir'}, … … 1023 1024 } 1024 1025 1025 # at the end of building, we have an indexfieldmap with all teh mappings, plus 1026 # some extras, and indexmap with any indexes in it that weren't specified in the index definition. 1027 # we want to make an ordered list of fields that are indexed, and a list of mappings that are used. this will be used for the build.cfg file, and for collection meta definition 1028 # we store these in a build.cfg bit 1026 # at the end of building, we have an indexfieldmap with all the mappings, 1027 # plus some extras, and indexmap with any indexes in it that weren't 1028 # specified in the index definition. we want to make an ordered list of 1029 # fields that are indexed, and a list of mappings that are used. this will 1030 # be used for the build.cfg file, and for collection meta definition we 1031 # store these in a build.cfg bit 1029 1032 sub make_final_field_list { 1030 1033 my $self = shift (@_); 1031 1034 1032 1035 $self->{'build_cfg'} = {}; 1033 1036 1034 1037 # store the indexfieldmap information 1035 1038 my @indexfieldmap = (); … … 1037 1040 my $specifiedfields = {}; 1038 1041 my @specifiedfieldorder = (); 1039 # go through the index definition and add each thing to a map, so we can easily check if it is already specified - when doing the metadata, we print out all the individual fields, but some may already be specified in the index definition, so we dont want to add those again. 1042 1043 # go through the index definition and add each thing to a map, so we 1044 # can easily check if it is already specified - when doing the 1045 # metadata, we print out all the individual fields, but some may 1046 # already be specified in the index definition, so we dont want to add 1047 # those again. 1048 1040 1049 foreach my $field (@{$self->{'collect_cfg'}->{'indexes'}}) { 1041 1050 # remove subcoll stuff … … 1073 1082 } 1074 1083 } 1084 1075 1085 $self->{'build_cfg'}->{'indexfieldmap'} = \@indexfieldmap; 1076 1086 $self->{'build_cfg'}->{'indexfields'} = \@indexfields; 1077 1078 1079 } 1080 1081 1082 # recreate the field list from the build.cfg file, look first in building, then in index to find it. if there is no build.cfg, we cant do the fieldlist (there is unlikely to be any index anyway.)1087 } 1088 1089 1090 # recreate the field list from the build.cfg file, look first in building, 1091 # then in index to find it. if there is no build.cfg, we can't do the field 1092 # list (there is unlikely to be any index anyway.) 1083 1093 sub read_final_field_list { 1084 1094 my $self = shift (@_); … … 1102 1112 } 1103 1113 } 1114 1104 1115 my $buildcfg = &colcfg::read_build_cfg( $buildconfigfile); 1116 1105 1117 if (defined $buildcfg->{'indexfields'}) { 1106 1118 foreach my $field (@{$buildcfg->{'indexfields'}}) { … … 1108 1120 } 1109 1121 } 1122 1110 1123 if (defined $buildcfg->{'indexfieldmap'}) { 1111 1124 foreach my $field (@{$buildcfg->{'indexfieldmap'}}) { … … 1115 1128 } 1116 1129 } 1117 1130 1118 1131 $self->{'build_cfg'}->{'indexfieldmap'} = \@indexfieldmap; 1119 1132 $self->{'build_cfg'}->{'indexfields'} = \@indexfields; 1120 1121 } 1133 } 1134 1122 1135 sub make_auxiliary_files { 1123 1136 my $self = shift (@_); … … 1129 1142 $build_cfg = $self->{'build_cfg'}; 1130 1143 } 1131 #my %build_cfg = ();1132 1144 1133 1145 my $outhandle = $self->{'outhandle'}; … … 1159 1171 # store the number of documents and number of bytes 1160 1172 $build_cfg->{'numdocs'} = $self->{'buildproc'}->get_num_docs(); 1173 $build_cfg->{'numsections'} = $self->{'buildproc'}->get_num_sections(); 1161 1174 $build_cfg->{'numbytes'} = $self->{'buildproc'}->get_num_bytes(); 1162 1175 … … 1184 1197 $build_cfg->{'languagemap'} = \@languagemap if scalar (@languagemap); 1185 1198 1186 #$build_cfg->{'notbuilt'} = $self->{'notbuilt'};1187 1199 my @notbuilt = (); 1188 1200 foreach my $nb (keys %{$self->{'notbuilt'}}) { … … 1193 1205 # write out the build information 1194 1206 &cfgread::write_cfg_file("$self->{'build_dir'}/build.cfg", $build_cfg, 1195 '^(builddate|buildtype|numdocs|num bytes|textlevel|indexstem)$',1207 '^(builddate|buildtype|numdocs|numsections|numbytes|textlevel|indexstem)$', 1196 1208 '^(indexmap|subcollectionmap|languagemap|indexfieldmap|notbuilt|indexfields|indexlevels|levelmap)$'); 1197 1209 … … 1201 1213 sub deinit { 1202 1214 my $self = shift (@_); 1215 1216 &plugin::deinit($self->{'pluginfo'},$self->{'buildproc'}); 1203 1217 } 1204 1218 … … 1221 1235 1222 1236 if ($num_processed_bytes < 50 && ($indexing_text || !$self->{'no_text'})) { 1223 print $outhandle "***************\n"; 1224 if ($indexing_text) { 1225 print $outhandle "WARNING: There is very little or no text to process for $index\n"; 1226 } elsif (!$self->{'no_text'}) { 1227 print $outhandle "WARNING: There is very little or no text to compress\n"; 1228 } 1229 print $outhandle " Was this your intention?\n"; 1230 print $outhandle "***************\n"; 1237 1238 if ($self->{'keepold'}) { 1239 if ($num_processed_bytes == 0) { 1240 if ($indexing_text) { 1241 print $outhandle "No additional text was added to $index\n"; 1242 } elsif (!$self->{'no_text'}) { 1243 print $outhandle "No additional text was compressed\n"; 1244 } 1245 } 1246 } 1247 else { 1248 print $outhandle "***************\n"; 1249 if ($indexing_text) { 1250 print $outhandle "WARNING: There is very little or no text to process for $index\n"; 1251 } elsif (!$self->{'no_text'}) { 1252 print $outhandle "WARNING: There is very little or no text to compress\n"; 1253 } 1254 print $outhandle " Was this your intention?\n"; 1255 print $outhandle "***************\n"; 1256 } 1257 1231 1258 } 1232 1259
Note:
See TracChangeset
for help on using the changeset viewer.