Author: ssmiweve
Date: 2008-01-30 12:03:23 +0100 (Wed, 30 Jan 2008)
New Revision: 6065
Modified:
branches/2.16/core-api/src/main/java/no/sesat/search/run/RunningQueryImpl.java
Log:
log no-hits stuff before setting running query off again
Modified:
branches/2.16/core-api/src/main/java/no/sesat/search/run/RunningQueryImpl.java
===================================================================
---
branches/2.16/core-api/src/main/java/no/sesat/search/run/RunningQueryImpl.java
2008-01-30 09:01:40 UTC (rev 6064)
+++
branches/2.16/core-api/src/main/java/no/sesat/search/run/RunningQueryImpl.java
2008-01-30 11:03:23 UTC (rev 6065)
@@ -635,6 +635,20 @@
// there were no hits for any of the search tabs!
noHitsOutput.append("<absolute/>");
+ if( noHitsOutput.length() >0 &&
datamodel.getQuery().getString().length() >0
+ && !"NOCOUNT".equals(parameters.get("IGNORE"))){
+
+ final String output = null != parameters.get("output")
+ ? parameters.get("output").getString()
+ : null;
+
+ noHitsOutput.insert(0, "<no-hits mode=\"" +
context.getSearchTab().getKey()
+ + (null != output ? "\" output=\"" + output : "") + "\">"
+ + "<query>" + datamodel.getQuery().getXmlEscaped() +
"</query>");
+ noHitsOutput.append("</no-hits>");
+ PRODUCT_LOG.info(noHitsOutput.toString());
+ }
+
// maybe we can modify the query to broaden the search
// replace all DefaultClause with an OrClause
// [simply done with wrapping the query string inside ()'s ]
@@ -655,22 +669,10 @@
// create and run a new RunningQueryImpl
new RunningQueryImpl(context, '(' + queryStr + ')').run();
+
+ // TODO put in some sort of feedback to user that query has been
changed.
}
-
- if( noHitsOutput.length() >0 &&
datamodel.getQuery().getString().length() >0
- && !"NOCOUNT".equals(parameters.get("IGNORE"))){
-
- final String output = null != parameters.get("output")
- ? parameters.get("output").getString()
- : null;
-
- noHitsOutput.insert(0, "<no-hits mode=\"" +
context.getSearchTab().getKey()
- + (null != output ? "\" output=\"" + output : "") + "\">"
- + "<query>" + datamodel.getQuery().getXmlEscaped() +
"</query>");
- noHitsOutput.append("</no-hits>");
- PRODUCT_LOG.info(noHitsOutput.toString());
- }
}
// Inner classes -------------------------------------------------
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits