Index: gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java
===================================================================
--- gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java	(revision 25866)
+++ gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java	(revision 25886)
@@ -24,4 +24,5 @@
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -30,8 +31,12 @@
 import org.apache.log4j.Logger;
 import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
+import org.apache.solr.client.solrj.response.FacetField;
 import org.apache.solr.core.CoreContainer;
 import org.greenstone.LuceneWrapper3.SharedSoleneQueryResult;
+import org.greenstone.gsdl3.util.FacetWrapper;
 import org.greenstone.gsdl3.util.GSFile;
 import org.greenstone.gsdl3.util.GSXML;
+import org.greenstone.gsdl3.util.SolrFacetWrapper;
+import org.greenstone.gsdl3.util.SolrQueryResult;
 import org.greenstone.gsdl3.util.SolrQueryWrapper;
 import org.greenstone.util.GlobalProperties;
@@ -52,4 +57,5 @@
 	public GS2SolrSearch()
 	{
+		does_faceting = true;
 		// Used to store the solr cores that match the required 'level' 
 		// of search (e.g. either document-level=>didx, or 
@@ -102,12 +108,12 @@
 			}
 		}
-		
+
 		Element indexListElem = (Element) GSXML.getChildByTagName(info, GSXML.INDEX_ELEM + GSXML.LIST_MODIFIER);
 		NodeList buildIndexElems = indexListElem.getElementsByTagName(GSXML.INDEX_ELEM);
 
-		for(int j = 0; j < buildIndexElems.getLength(); j++)
+		for (int j = 0; j < buildIndexElems.getLength(); j++)
 		{
 			Element current = (Element) buildIndexElems.item(j);
-			for(int i = 0; i < chosenFacets.size(); i++)
+			for (int i = 0; i < chosenFacets.size(); i++)
 			{
 				if (current.getAttribute(GSXML.NAME_ATT).equals(chosenFacets.get(i)))
@@ -117,5 +123,5 @@
 			}
 		}
-		
+
 		return true;
 	}
@@ -250,5 +256,5 @@
 
 		String core_name = site_name + "-" + coll_name + "-" + index;
-		
+
 		EmbeddedSolrServer solr_core = null;
 
@@ -350,3 +356,27 @@
 	}
 
+	protected ArrayList<FacetWrapper> getFacets(Object query_result)
+	{
+		if (!(query_result instanceof SolrQueryResult))
+		{
+			return null;
+		}
+
+		SolrQueryResult result = (SolrQueryResult) query_result;
+		List<FacetField> facets = result.getFacetResults();
+
+		if (facets == null)
+		{
+			return null;
+		}
+
+		ArrayList<FacetWrapper> newFacetList = new ArrayList<FacetWrapper>();
+
+		for (FacetField facet : facets)
+		{
+			newFacetList.add(new SolrFacetWrapper(facet));
+		}
+
+		return newFacetList;
+	}
 }
Index: gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/util/SolrFacetWrapper.java
===================================================================
--- gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/util/SolrFacetWrapper.java	(revision 25886)
+++ gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/util/SolrFacetWrapper.java	(revision 25886)
@@ -0,0 +1,56 @@
+/**********************************************************************
+ *
+ * FacetWrapper.java 
+ *
+ * Copyright 2004 The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+package org.greenstone.gsdl3.util;
+
+import java.util.HashMap;
+
+import org.apache.solr.client.solrj.response.FacetField;
+
+public class SolrFacetWrapper extends FacetWrapper
+{
+	protected String _name = null;
+	protected HashMap<String, Long> _counts = new HashMap<String, Long>();
+	
+	public SolrFacetWrapper(FacetField facet)
+	{
+		_name = facet.getName();
+		
+		for(FacetField.Count count : facet.getValues())
+		{
+			_counts.put(count.getName(), count.getCount());
+		}
+	}
+	
+	public String getName()
+	{
+		return _name;
+	}
+	
+	public HashMap<String, Long> getCounts()
+	{
+		return _counts;
+	}
+}
