Fixes missing search command instruction to pz2 client
authorNiels Erik G. Nielsen <nielserik@indexdata.com>
Tue, 14 May 2013 16:29:35 +0000 (12:29 -0400)
committerNiels Erik G. Nielsen <nielserik@indexdata.com>
Tue, 14 May 2013 16:29:35 +0000 (12:29 -0400)
src/main/java/com/indexdata/mkjsf/pazpar2/Pz2Bean.java

index 1c0fc07..9c43ddd 100644 (file)
@@ -121,6 +121,7 @@ public class Pz2Bean implements Pz2Interface, StateListener, Configurable, Seria
       pzreq.getRecord().removeParametersInState();        \r
       pzreq.getShow().setParameterInState(new CommandParameter("start","=",0));    \r
       logger.debug(Utils.objectId(this) + " is searching using "+pzreq.getCommand("search").getUrlEncodedParameterValue("query"));\r
+      searchClient.setSearchCommand(pzreq.getCommand("search"));\r
       doCommand("search");\r
     }\r
   }\r
@@ -284,7 +285,7 @@ public class Pz2Bean implements Pz2Interface, StateListener, Configurable, Seria
     \r
   protected void handleQueryStateChanges (String commands) {\r
     if (stateMgr.hasPendingStateChange("search") && hasQuery()) { \r
-      logger.info("Triggered search: Found pending search change, doing search before updating " + commands);      \r
+      logger.info("Triggered search: Found pending search change [" + pzreq.getCommand("search").toString() + "], doing search before updating " + commands);      \r
       doSearch();\r
     } \r
     if (stateMgr.hasPendingStateChange("record") && ! commands.equals("record")) {        \r
@@ -307,7 +308,7 @@ public class Pz2Bean implements Pz2Interface, StateListener, Configurable, Seria
    */\r
   protected ResponseDataObject doCommand(String commandName) {\r
     ResponseDataObject responseObject = null;     \r
-    // logger.debug(pzreq.getCommand(commandName).getEncodedQueryString() + ": Results for "+ pzreq.getCommand("search").getEncodedQueryString());\r
+    logger.info("Request "+commandName + ": "+ pzreq.getCommand("search").toString());\r
     Pazpar2Command command = pzreq.getCommand(commandName);\r
     long start = System.currentTimeMillis();\r
     HttpResponseWrapper commandResponse = searchClient.executeCommand(command);\r