Index: trunk/gsdl/src/recpt/queryaction.cpp
===================================================================
--- trunk/gsdl/src/recpt/queryaction.cpp	(revision 9676)
+++ trunk/gsdl/src/recpt/queryaction.cpp	(revision 9698)
@@ -1316,16 +1316,13 @@
     set_queryfilter_options (request, formattedstring, args);
     collectproto->filter (collection, request, response, err, logout);
-    if (err != noError && err != syntaxError) {
+    if (err != noError) {
       outconvertclass text_t2ascii;
       logout << text_t2ascii
 	     << "queryaction::search_single_collections: call to QueryFilter failed "
 	     << "for " << collection << " collection (" << get_comerror_string (err) << ")\n";
-      return false;
-    }
-
-    bool syntax_error = false;
-    if (err == syntaxError) syntax_error = true;
-
-    if (!args["ifl"].empty()) {
+     
+    }
+    
+    if (err == noError && !args["ifl"].empty()) {
       // Go directly to the first matching document
       ResultDocInfo_tarray::iterator thissection = response.docInfo.begin();
@@ -1359,9 +1356,18 @@
 
     //return false;
-    define_query_macros (args, disp, response.numDocs, response.isApprox);
-    define_single_query_macros(args, disp, response, syntax_error);
-
-    // save the query if appropriate
-    save_search_history(args, response.numDocs, response.isApprox);
+    if (err != noError) {
+      disp.setmacro("resultline", "query", "_textnodocs_");
+      if (err == syntaxError) {
+	disp.setmacro ("freqmsg", "query", "_textinvalidquery_");
+      } else {
+	disp.setmacro ("freqmsg", "query", "");
+      }
+    } else {
+      
+      define_query_macros (args, disp, response.numDocs, response.isApprox);
+      define_single_query_macros(args, disp, response);
+      // save the query if appropriate
+      save_search_history(args, response.numDocs, response.isApprox);
+    }
   }
   define_history_macros (disp, args, protos, logout);
@@ -1369,11 +1375,12 @@
   textout << outconvert << disp << "_query:header_\n"
 	  << "_query:content_";
-
-  // output the results
-  bool use_table = is_table_content (formatlistptr);
-  bptr->output_section_group (response, args, collection, 0, formatlistptr, 
-			      use_table, request.fields, request.getParents, 
-			      collectproto, disp, outconvert, textout, logout);
-  
+  
+  if (err == noError) {
+    // output the results
+    bool use_table = is_table_content (formatlistptr);
+    bptr->output_section_group (response, args, collection, 0, formatlistptr, 
+				use_table, request.fields, request.getParents, 
+				collectproto, disp, outconvert, textout, logout);
+  }
 
   textout << outconvert << disp << "_query:footer_";
@@ -1447,5 +1454,5 @@
 // query had been done. Those macros are 
 // _resultline_, _nextfirst_, _nextlast_, _prevfirst_, _prevlast_,
-// _thisfirst_, and _thislast_
+// _thisfirst_, and _thislast_ and _quotedquery_ 
 // this has been simplified so it can be used with both search_single_coll
 // and search_multiple_coll
@@ -1525,25 +1532,21 @@
 // define_single_query_macros sets the extra macros for search_single_coll 
 // that couldn't be set until the query had been done. Those macros are 
-// _freqmsg_, _quotedquery_
+// _freqmsg_,
 void queryaction::define_single_query_macros (cgiargsclass &args, 
 					      displayclass &disp, 
-					      const FilterResponse_t &response,
-					      bool syntax_error) {
-    // set up _freqmsg_ and _quotedquery_ macros
+					      const FilterResponse_t &response) {
+  // set up _freqmsg_ macros
 
   text_t freqmsg = "";
-  if (syntax_error) {
-    freqmsg = "_textinvalidquery_";
-  } else {
-    freqmsg = "_textfreqmsg1_";
-    TermInfo_tarray::const_iterator this_term = response.termInfo.begin();
-    TermInfo_tarray::const_iterator end_term = response.termInfo.end();
-    while (this_term != end_term) {
-      freqmsg += (*this_term).term + ": " + (*this_term).freq;
-      if ((this_term + 1) != end_term)
-	freqmsg += ", ";
-      ++this_term;
-    }
-  }
+  freqmsg = "_textfreqmsg1_";
+  TermInfo_tarray::const_iterator this_term = response.termInfo.begin();
+  TermInfo_tarray::const_iterator end_term = response.termInfo.end();
+  while (this_term != end_term) {
+    freqmsg += (*this_term).term + ": " + (*this_term).freq;
+    if ((this_term + 1) != end_term)
+      freqmsg += ", ";
+    ++this_term;
+  }
+  
   disp.setmacro ("freqmsg", "query", freqmsg);
 }
Index: trunk/gsdl/src/recpt/queryaction.h
===================================================================
--- trunk/gsdl/src/recpt/queryaction.h	(revision 9676)
+++ trunk/gsdl/src/recpt/queryaction.h	(revision 9698)
@@ -70,6 +70,5 @@
   virtual void define_single_query_macros (cgiargsclass &args, 
 					   displayclass &disp, 
-					   const FilterResponse_t &response,
-					   bool syntax_error); 
+					   const FilterResponse_t &response); 
   virtual void define_query_macros (cgiargsclass &args, displayclass &disp, 
 			    int numDocs, isapprox isApprox); 
