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 32105)
+++ gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/service/GS2SolrSearch.java	(revision 32110)
@@ -330,4 +330,5 @@
 			else if (name.equals("facetQueries") && value.length() > 0)
 			{
+			    //logger.info("@@@ SOLR FACET VALUE FOUND: " + value);
 				this.solr_src.addFacetQuery(value);
 			}
@@ -410,4 +411,5 @@
 				hldocOID = null;
 			}
+			//logger.info("@@@@ Query is now: " + query);
 			SharedSoleneQueryResult sqr = this.solr_src.runQuery(query);
 
Index: gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/util/SolrQueryWrapper.java
===================================================================
--- gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/util/SolrQueryWrapper.java	(revision 32105)
+++ gs3-extensions/solr/trunk/src/src/java/org/greenstone/gsdl3/util/SolrQueryWrapper.java	(revision 32110)
@@ -297,4 +297,6 @@
 				for (String currentQueryElement : queryElems)
 				{
+				    //logger.info("@@@@ currentQueryElement " + currentQueryElement);
+				    
 					String decodedQueryElement = null;
 					try
@@ -400,8 +402,23 @@
 			{
 			  // add this field as a facet
-			  solrQuery.addFacetField(_facets.get(i)); // solrParams.add("facet.field", _facets.get(i));
-			}
-		}
-
+			    solrQuery.addFacetField(_facets.get(i)); // solrParams.add("facet.field", _facets.get(i));
+			}
+			//for(int i = 0; i < _facetQueries.size(); i++) {
+			//    logger.info("@@@@ facet query i: " + _facetQueries.get(i));
+			//}
+		}
+				
+
+		// Some debugging		
+		logger.info("@@@@ solrQuery: " + solrQuery);		
+		try {
+		    // https://stackoverflow.com/questions/2632175/decoding-uri-query-string-in-java
+		    String displayQueryString = URLDecoder.decode(solrQuery.toString().replace("+", " "), "UTF-8");
+		    logger.info("@@@@ solrQuery URL decoded: " + displayQueryString);
+		} catch(Exception uee) { // UnsupportedEncodingException
+		    logger.info("Got debug exception " + uee.getMessage());
+		}
+
+		
 		// the solrserver will now
 		// get the individual terms that make up the query, then request solr to return the totaltermfreq for each term
Index: gs3-extensions/solr/trunk/src/src/java/org/greenstone/solrserver/Greenstone3SearchHandler.java
===================================================================
--- gs3-extensions/solr/trunk/src/src/java/org/greenstone/solrserver/Greenstone3SearchHandler.java	(revision 32105)
+++ gs3-extensions/solr/trunk/src/src/java/org/greenstone/solrserver/Greenstone3SearchHandler.java	(revision 32110)
@@ -77,6 +77,8 @@
 public class Greenstone3SearchHandler extends SearchHandler
 {
-    // IMPORTANT NOTE: Logging doesn't work in this class either with log4j or slf4j, 
+    // IMPORTANT NOTES: 1. Logging doesn't work in this class either with log4j or slf4j, 
     // but System.err goes to catalina.out.
+    // 2. To compile this class, "ant compile" in ext/solr is insufficient. The class file produced
+    // isn't copied into tomcat. Need to do "ant compile-gs3-solrserver".
 
     //protected static Logger log = LoggerFactory.getLogger(Greenstone3SearchHandler.class);
@@ -157,5 +159,6 @@
 
 	if(query_string == null || query_string.equals("")) {
-	    log.error("@@@@@@@@@ " + this.getClass() + " - QUERY STRING EMPTY");
+	    //log.error("@@@@@@@@@ " + this.getClass() + " - QUERY STRING EMPTY"); // logging won't work
+	    System.err.println("@@@@@@@@@ " + this.getClass() + " - QUERY STRING EMPTY");
 	}
 	else {
@@ -234,7 +237,15 @@
 
 		// totaltermfreq(TI, 'farming') 
-		// termfreq(TI, 'farming')		
+		// termfreq(TI, 'farming')
+		//System.err.println("@@@@ SOLR FACET queryTerm: " + queryTerm);
 		solrParams.addField("totaltermfreq(" + field + ",'" + queryTerm + "')");
 		solrParams.addField("termfreq(" + field + ",'" + queryTerm + "')");
+
+		// handle the special case of apostrophes in facet query terms
+		// (facet_scripts.js does the other half of handling them)
+		query_string = query_string.replace("%27", "'");
+		solrParams.set("q", query_string);
+		
+		System.err.println("@@@@ SOLR FACET query_string: " + query_string);
 	    }
 	}
