Index: /trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/CollectionManager.java
===================================================================
--- /trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/CollectionManager.java	(revision 6734)
+++ /trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/CollectionManager.java	(revision 6735)
@@ -108,60 +108,4 @@
   }
    
-  class CollectionIndexer
-  { String level;
-    String type;
-    String name;
-    List fields;
-    String sort;
-
-    public CollectionIndexer(String type, String indexName, Node node)
-    { this.type = type.toLowerCase();
-      this.fields = new ArrayList();
-      this.name = indexName;
-      this.level = IndexerManager.DEFAULT_LEVEL;
-    
-      NodeList children = node.getChildNodes();
-      for (int c = 0; c < children.getLength(); c ++) {
-	Node child = children.item(c);
-	
-	if (child.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) {
-	  String name = child.getNodeName();
-	  
-	  if (name.equals("level")) {
-	    String levelName = DOMUtils.getNodeChildText(children.item(c));
-	    this.level = levelName;
-	  }
-	  else if (name.equals("field")) {
-	    String fieldName = DOMUtils.getNodeChildText(children.item(c));
-	    this.fields.add(fieldName.toString());
-	  }
-	}
-      }
-      if (this.fields.size() == 0) {
-	this.fields.add(IndexerManager.DEFAULT_FIELD);
-      }
-    }
-
-    public void prepareIndexer(Map indexerMap)
-    { IndexerInterface indexer = null;
-
-      System.out.println("Index: " + this.type);
-
-      if (!indexerMap.containsKey(this.type)) {
-	if (this.type.toLowerCase().equals("mg")) {
-	  indexer = new MGIndexer();	  
-	}
-	if (indexer != null) {
-	  indexerMap.put(this.type, indexer);
-	}
-      }
-
-      indexer = (IndexerInterface) indexerMap.get(this.type);
-      if (indexer != null) {
-	indexer.addIndex(this.level, this.fields.get(0).toString());
-      }
-    }
-  }
-
   /**
    *  Create the collection manager for a given collection
@@ -255,6 +199,4 @@
       Document document = builder.parse(collectionConfig);
 
-      Map                  indexerMap = new HashMap();
-
       // TODO: report an error
       if (document == null)
@@ -282,24 +224,28 @@
 	// the name is a plugin element
 	if (name.equals("search")) {
-	  NodeList indexChildren = children.item(c).getChildNodes();
-
-	  for (int i = 0; i < indexChildren.getLength(); i ++) {
-	    String childName = indexChildren.item(i).getNodeName();
-
-	    if (childName.equals("index"))
-	    { NamedNodeMap atts = indexChildren.item(i).getAttributes();
-	      Node attribute = atts.getNamedItem("type");
-	      String type = attribute.getNodeValue();
-
-	      attribute = atts.getNamedItem("name");
-	      String indexName = attribute.getNodeValue();
-	      
-	      // create the local indexer representation
-	      CollectionIndexer indexer = new CollectionIndexer(type, indexName, indexChildren.item(i));
-	     
-	      // prepare it...
-	      indexer.prepareIndexer(indexerMap);
-	    }
-	  }
+	  // pick up attributes from the <search> tag now...
+	  NamedNodeMap searchAttributes = children.item(c).getAttributes();
+	  Node searchAttribute = searchAttributes.getNamedItem("type");
+	  String searchType = searchAttribute.getNodeValue();
+
+	  searchAttribute = searchAttributes.getNamedItem("name");
+	  String searchName = null;
+
+	  if (searchAttribute != null) {
+	    searchName = searchAttribute.getNodeValue();
+	  }
+
+	  // create the pertinent indexer...
+	  IndexerInterface indexer = IndexerFactory.makeIndexer(searchType, searchName);
+
+	  if (indexer == null) {
+	    continue;
+	  }
+
+	  // configure the indexer
+	  indexer.configure(children.item(c));
+
+	  // install it into the build manager
+	  buildManager.addIndexer(indexer);
 	}
 	else if (name.equals("browse"))
@@ -310,12 +256,4 @@
 	{
 	}
-      }
-
-      Iterator indexers = indexerMap.values().iterator();
-      while (indexers.hasNext()) {
-	IndexerInterface indexer = (IndexerInterface) indexers.next();
-
-	// attach the classifier
-	buildManager.addIndexer(indexer);	
       }
     }
