Author: daniele
Date: 2007-05-29 16:58:22 +0200 (Tue, 29 May 2007)
New Revision: 5225
Modified:
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueAdsSearchCommand.java
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueSearchCommand.java
Log:
GULD-477: some debug statements to output the known predicates for clauses.
GULD-571: sponsor links is workign again.
Modified:
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueAdsSearchCommand.java
===================================================================
---
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueAdsSearchCommand.java
2007-05-29 13:16:27 UTC (rev 5224)
+++
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueAdsSearchCommand.java
2007-05-29 14:58:22 UTC (rev 5225)
@@ -102,6 +102,11 @@
originalQuery = super.getTransformedQuery().replaceAll("\\W",
"").toLowerCase();
}
+ LOG.info("CatalogueAdsSearch Debug output");
+ LOG.info("Who: "+originalQuery);
+ LOG.info("Where: "+queryGeoString);
+ LOG.info("Q: "+getQuery().getQueryString());
+
}
/**
@@ -157,8 +162,6 @@
whichQueryToRun = QueryType.GEO;
firstQueryResult = (ResultList<ResultItem>) super.execute();
- LOG.info("Found "+firstQueryResult.getHitCount()+" sponsed links");
-
if (firstQueryResult.getHitCount() < 5) {
// Build the search result to return from this method
@@ -168,7 +171,7 @@
for (ResultItem item : firstQueryResult.getResults()) {
Pattern p =
Pattern.compile("(^|;)"+originalQuery+queryGeoString+"(;|$)");
-
+
int i = 0;
boolean found = false;
for(; i < 5 ; i++){
@@ -228,7 +231,6 @@
} // end for
firstQueryResult.removeResults();
- LOG.info("Cleared original result.");
for(int i= searchResults.length-1; 0 <= i; --i){
final ResultItem item = searchResults[i];
@@ -239,7 +241,7 @@
}
firstQueryResult.setHitCount(firstQueryResult.getResults().size());
-
+ LOG.info("Resulting in "+firstQueryResult.getHitCount()+" sponsor
links");
}
return firstQueryResult;
@@ -259,12 +261,12 @@
String completeQuery = null;
if (whichQueryToRun == QueryType.GEO) {
- query = super.getTransformedQuery().replaceAll(" ",
"").replace("\"","")
- + queryGeoString.replaceAll(" ", "");
+ query = originalQuery
+ + queryGeoString.replaceAll("\\W", "");
} else {
- query = super.getTransformedQuery().replaceAll(" ",
"").replace("\"","")
+ query = originalQuery
+ DOMESTIC_SEARCH;
}
Modified:
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueSearchCommand.java
===================================================================
---
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueSearchCommand.java
2007-05-29 13:16:27 UTC (rev 5224)
+++
trunk/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/CatalogueSearchCommand.java
2007-05-29 14:58:22 UTC (rev 5225)
@@ -412,6 +412,9 @@
protected String getSortBy() {
String sortBy = super.getSortBy();
+ LOG.info("foundKeywordInQuery: "+foundKeywordInQuery);
+ LOG.info("foundCompanyNameInQuery: "+foundCompanyNameInQuery);
+
sortBy =
foundKeywordInQuery?SORTBY_KEYWORD:foundCompanyNameInQuery?SORTBY_COMPANYNAME:sortBy;
if ("name".equalsIgnoreCase(userSortBy)) {
@@ -475,6 +478,9 @@
foundCompanyNameInQuery=true;
}
+
+
+ LOG.info("Known predicates: "+clause.getKnownPredicates());
if(hasNotWordCharacters){
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits