Author: daniele
Date: 2007-04-13 13:50:13 +0200 (Fri, 13 Apr 2007)
New Revision: 4805
Modified:
branches/2.11/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueSearchCommand.java
Log:
return empty query from search command if no search terms in what or where is
specified.
Modified:
branches/2.11/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueSearchCommand.java
===================================================================
---
branches/2.11/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueSearchCommand.java
2007-04-13 09:55:56 UTC (rev 4804)
+++
branches/2.11/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueSearchCommand.java
2007-04-13 11:50:13 UTC (rev 4805)
@@ -176,12 +176,14 @@
if(getKnownGeoString()!=null) tmp = tmp + " " + getKnownGeoString();
- queryGeo = createQuery(tmp);
+ if(tmp!=null && tmp.length()>0){
+ queryGeo = createQuery(tmp);
- GeoVisitor geoVisitor = new GeoVisitor();
- geoVisitor.visit(queryGeo.getQuery().getRootClause());
-
- queryGeoString = geoVisitor.getQueryRepresentation();
+ GeoVisitor geoVisitor = new GeoVisitor();
+ geoVisitor.visit(queryGeo.getQuery().getRootClause());
+ queryGeoString = geoVisitor.getQueryRepresentation();
+ }
+
LOG.info(DEBUG_SEARCHING_3 + queryGeoString);
}
@@ -317,9 +319,9 @@
} else{
// none of what and where, this should not be possible.
- throw new IllegalStateException("Emty query strings, should not be
possible. [Primary="+query+", Geo="+queryGeoString+"]");
+ // throw new IllegalStateException("Emty query strings, should not
be possible. [Primary="+query+", Geo="+queryGeoString+"]");
}
-
+
return query;
}
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits