Index: /main/trunk/greenstone2/perllib/basebuilder.pm
===================================================================
--- /main/trunk/greenstone2/perllib/basebuilder.pm	(revision 24459)
+++ /main/trunk/greenstone2/perllib/basebuilder.pm	(revision 24460)
@@ -329,4 +329,6 @@
     my $outhandle = $self->{'outhandle'};
 
+    $self->pre_build_indexes();
+
     my $indexes = [];
     if (defined $indexname && $indexname =~ /\w/) {
@@ -352,13 +354,19 @@
     }
 
-    $self->build_indexes_extra();
-
+    $self->post_build_indexes();
+
+}
+
+# implement this in subclass if want to do extra stuff at before building
+# all the indexes
+sub pre_build_indexes {
+    my $self = shift(@_);
+    my ($indexname) = @_; # optional parameter
 }
 
 # implement this in subclass if want to do extra stuff at the end of building
 # all the indexes
-sub build_indexes_extra {
-    my $self = shift(@_);
-    
+sub post_build_indexes {
+    my $self = shift(@_);   
 }
 
Index: /main/trunk/greenstone2/perllib/lucenebuilder.pm
===================================================================
--- /main/trunk/greenstone2/perllib/lucenebuilder.pm	(revision 24459)
+++ /main/trunk/greenstone2/perllib/lucenebuilder.pm	(revision 24460)
@@ -26,5 +26,5 @@
 ###########################################################################
 # /*
-#  *  @version 1.0 ?
+#  *  @version 1.0 Automated incremental building
 #  *  @version 2.0 Incremental building assistance added, including
 #  *               remove_document_from_database which implements the granddad's
@@ -33,4 +33,5 @@
 #  *               perl script is. John Rowe
 #  *
+#  *  @authro Waikato Digital Library Research Group
 #  *  @author John Rowe, DL Consulting Ltd.
 #  */
@@ -117,5 +118,4 @@
 	}
     }	    
-    
 }
 
@@ -227,4 +227,6 @@
     my $outhandle = $self->{'outhandle'};
 
+    $self->pre_build_indexes($indexname);
+
     my $indexes = [];
     if (defined $indexname && $indexname =~ /\w/) {
@@ -233,12 +235,14 @@
 	$indexes = $self->{'collect_cfg'}->{'indexes'};
     }
-    # have we got para index?
+
+    # Have we got para index?
     foreach my $level (keys %{$self->{'levels'}}) {
 	if ($level =~ /paragraph/) {
-	    print $outhandle "Warning: Paragraph level indexing not supported by Lucene\n";
+	    print $outhandle "Warning: Paragraph level indexing not supported by Lucene/Solr\n";
 	    last;
 	}
     }
-    # create the mapping between the index descriptions
+
+    # Create the mapping between the index descriptions
     # and their directory names (includes subcolls and langs)
     $self->{'index_mapping'} = $self->create_index_mapping ($indexes);
@@ -246,4 +250,5 @@
     # build each of the indexes
     foreach my $index (@$indexes) {
+
 	if ($self->want_built($index)) {
 
@@ -271,6 +276,5 @@
     }
 
-    #define the final field lists
-    $self->make_final_field_list();
+    $self->post_build_indexes();
 }
 
Index: /main/trunk/greenstone2/perllib/lucenebuildproc.pm
===================================================================
--- /main/trunk/greenstone2/perllib/lucenebuildproc.pm	(revision 24459)
+++ /main/trunk/greenstone2/perllib/lucenebuildproc.pm	(revision 24460)
@@ -239,4 +239,5 @@
 	    } # for each field in this one index
 	    
+
 	    # now we add the text and/or metadata into new_text
 	    if ($section_text ne "" || scalar(@metadata_list)) {
@@ -283,5 +284,4 @@
 	    
 	} # foreach field
-
 
    	if ($all_metadata_specified) {
Index: /main/trunk/greenstone2/perllib/mgppbuilder.pm
===================================================================
--- /main/trunk/greenstone2/perllib/mgppbuilder.pm	(revision 24459)
+++ /main/trunk/greenstone2/perllib/mgppbuilder.pm	(revision 24460)
@@ -282,6 +282,7 @@
 
 
-sub build_indexes_extra {
+sub post_build_indexes {
     my $self = shift(@_);
+
     #define the final field lists
     $self->make_final_field_list();
@@ -617,5 +618,6 @@
     my $collection_infodb = shift(@_);
 
-    # define the indexed field mapping if not already done so (ie if infodb called separately from build_index)
+    # define the indexed field mapping if not already done so 
+    # (i.e. if infodb called separately from build_index)
     if (!defined $self->{'build_cfg'}) {
 	$self->read_final_field_list();
@@ -703,6 +705,6 @@
 # at the end of building, we have an indexfieldmap with all the mappings,
 # plus some extras, and indexmap with any indexes in it that weren't
-# specified in the index definition.  we want to make an ordered list of
-# fields that are indexed, and a list of mappings that are used. this will
+# specified in the index definition.  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 we
 # store these in a build.cfg bit
@@ -763,6 +765,4 @@
 		push (@indexfields, "$field");
 	    }
-
-	    
 	}
     }
@@ -771,4 +771,5 @@
 	$self->{'build_cfg'}->{'indexfieldmap'} = \@indexfieldmap;
     }
+
     if (scalar @indexfields) {
 	$self->{'build_cfg'}->{'indexfields'} = \@indexfields;
