Author: daniele
Date: 2007-04-17 13:21:21 +0200 (Tue, 17 Apr 2007)
New Revision: 4821
Modified:
branches/2.11/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueSearchCommand.java
Log:
Fixed one error in sort by for catalogue command.
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-17 08:59:59 UTC (rev 4820)
+++
branches/2.11/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueSearchCommand.java
2007-04-17 11:21:21 UTC (rev 4821)
@@ -163,7 +163,7 @@
* original untransformed query.
*
* Populate the knownGeo and knownGeoString which is used by the visitXxx
- * methods to known which terms to ignore when constructing the
+ * methods to know which terms to ignore when constructing the
* query for this searchcommand.
*/
private WhoWhereSplit initialiseWhoWhere() {
@@ -338,9 +338,11 @@
} 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+"]");
+ // none of what and where,
+ // if q is '*' and where is empty, then we would end here.
+ // Should be handled in a nice way, right now the query is
+ // blank, which would return every company in the index.
+
}
return query.toString();
@@ -359,7 +361,7 @@
*/
@Override
protected String getSortBy() {
- String sortBy = SORTBY_KEYWORD;
+ String sortBy = super.getSortBy();
if ("name".equalsIgnoreCase(userSortBy)) {
sortBy = SORTBY_COMPANYNAME;
}
@@ -373,13 +375,12 @@
*/
private String createPhraseQuerySyntax(final String term) {
- final StringBuilder sb = new StringBuilder();
- sb.append("(");
- sb.append("iypcfnavn:" + term + " ANY ");
- sb.append("lemiypcfkeywords:" + term + " ANY ");
- sb.append("lemiypcfkeywordslow:" + term);
- sb.append(")");
- return sb.toString();
+ return '('
+ + "iypcfnavn:" + term + " ANY "
+ + "lemiypcfkeywords:" + term + " ANY "
+ + "lemiypcfkeywordslow:" + term
+ + ')';
+
}
/**
@@ -468,7 +469,7 @@
* If the query is defined to split known geographic locations from
* the keywords, ignore the term.
*
- * If the term is '*', also ignore it.
+ * If the term is '', also ignore it.
* @param clause the clause to process.
*/
protected void visitImpl(final PhraseClause clause) {
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits