Index: /gsdl/trunk/perllib/basebuilder.pm
===================================================================
--- /gsdl/trunk/perllib/basebuilder.pm	(revision 19217)
+++ /gsdl/trunk/perllib/basebuilder.pm	(revision 19218)
@@ -148,32 +148,33 @@
     
     $self->generate_index_list();
- 
-    # sort out subcollection indexes
-    if (defined $self->{'collect_cfg'}->{'indexsubcollections'}) {
-	my $indexes = $self->{'collect_cfg'}->{'indexes'};
-	$self->{'collect_cfg'}->{'indexes'} = [];
-	foreach my $subcollection (@{$self->{'collect_cfg'}->{'indexsubcollections'}}) {
-	    foreach my $index (@$indexes) {
-		push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index:$subcollection");
-	    }
-	}
-    }
-
-    # sort out language subindexes
-    if (defined $self->{'collect_cfg'}->{'languages'}) {
-	my $indexes = $self->{'collect_cfg'}->{'indexes'};
-	$self->{'collect_cfg'}->{'indexes'} = [];
-	foreach my $language (@{$self->{'collect_cfg'}->{'languages'}}) {
-	    foreach my $index (@$indexes) {
-		if (defined ($self->{'collect_cfg'}->{'indexsubcollections'})) {
-		    push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index:$language");
-		}
-		else { # add in an empty subcollection field
-		    push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index\:\:$language");
+    my $indexes = $self->{'collect_cfg'}->{'indexes'};
+    if (defined $indexes) {
+	# sort out subcollection indexes
+	if (defined $self->{'collect_cfg'}->{'indexsubcollections'}) {
+	    $self->{'collect_cfg'}->{'indexes'} = [];
+	    foreach my $subcollection (@{$self->{'collect_cfg'}->{'indexsubcollections'}}) {
+		foreach my $index (@$indexes) {
+		    push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index:$subcollection");
 		}
 	    }
 	}
-    }
-
+	
+	# sort out language subindexes
+	if (defined $self->{'collect_cfg'}->{'languages'}) {
+	    $indexes = $self->{'collect_cfg'}->{'indexes'};
+	    $self->{'collect_cfg'}->{'indexes'} = [];
+	    foreach my $language (@{$self->{'collect_cfg'}->{'languages'}}) {
+		foreach my $index (@$indexes) {
+		    if (defined ($self->{'collect_cfg'}->{'indexsubcollections'})) {
+			push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index:$language");
+		    }
+		    else { # add in an empty subcollection field
+			push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index\:\:$language");
+		    }
+		}
+	    }
+	}
+    }
+    
     if (defined($self->{'collect_cfg'}->{'indexes'})) {
 	# make sure that the same index isn't specified more than once
Index: /gsdl/trunk/perllib/mgppbuilder.pm
===================================================================
--- /gsdl/trunk/perllib/mgppbuilder.pm	(revision 19217)
+++ /gsdl/trunk/perllib/mgppbuilder.pm	(revision 19218)
@@ -99,6 +99,8 @@
     #indexes are specified with spaces, but we put them into one index
     my $indexes = $self->{'collect_cfg'}->{'indexes'};
-    $self->{'collect_cfg'}->{'indexes'} = [];
-    push (@{$self->{'collect_cfg'}->{'indexes'}}, join(';', @$indexes).";");
+    if (defined $indexes) {
+	$self->{'collect_cfg'}->{'indexes'} = [];
+	push (@{$self->{'collect_cfg'}->{'indexes'}}, join(';', @$indexes).";");
+    }
 }
 
@@ -282,4 +284,6 @@
     my %mapping = ();
 
+    return \%mapping if !(scalar @$indexes);
+
     $mapping{'indexmaporder'} = [];
     $mapping{'subcollectionmaporder'} = [];
@@ -615,22 +619,24 @@
     # these now come from collection meta. if that is not defined, uses the metadata name
     my $collmeta = "";
-    foreach my $longfield (@{$self->{'build_cfg'}->{'indexfields'}}){
-	my $shortfield = $self->{'buildproc'}->{'indexfieldmap'}->{$longfield};
-	next if $shortfield eq 1;
-	
-	# we need to check if some coll meta has been defined - don't output 
-	# any that have
-	$collmeta = ".$longfield";
-	if (!$collmetadefined || !defined $self->{'collect_cfg'}->{'collectionmeta'}->{$collmeta}) {
-	    if ($longfield eq "allfields") {
-		$collection_infodb->{$shortfield} = [ "_query:textallfields_" ];
-	    } elsif ($longfield eq "text") {
-		$collection_infodb->{$shortfield} = [ "_query:texttextonly_" ];
-	    } else {
-		$collection_infodb->{$shortfield} = [ $longfield ];
-	    }
-	}
-    }
-    
+    if (defined $self->{'build_cfg'}->{'indexfields'}) {
+	foreach my $longfield (@{$self->{'build_cfg'}->{'indexfields'}}){
+	    my $shortfield = $self->{'buildproc'}->{'indexfieldmap'}->{$longfield};
+	    next if $shortfield eq 1;
+	    
+	    # we need to check if some coll meta has been defined - don't output 
+	    # any that have
+	    $collmeta = ".$longfield";
+	    if (!$collmetadefined || !defined $self->{'collect_cfg'}->{'collectionmeta'}->{$collmeta}) {
+		if ($longfield eq "allfields") {
+		    $collection_infodb->{$shortfield} = [ "_query:textallfields_" ];
+		} elsif ($longfield eq "text") {
+		    $collection_infodb->{$shortfield} = [ "_query:texttextonly_" ];
+		} else {
+		    $collection_infodb->{$shortfield} = [ $longfield ];
+		}
+	    }
+	}
+    }
+
     # now add the level names
     my $level_entry = "";
@@ -747,7 +753,10 @@
     }
 
-    $self->{'build_cfg'}->{'indexfieldmap'} = \@indexfieldmap;
-    $self->{'build_cfg'}->{'indexfields'} = \@indexfields;
-    
+    if (scalar @indexfieldmap) {
+	$self->{'build_cfg'}->{'indexfieldmap'} = \@indexfieldmap;
+    }
+    if (scalar @indexfields) {
+	$self->{'build_cfg'}->{'indexfields'} = \@indexfields;
+    }
 }
 
