Author: ssthkjer
Date: 2007-01-10 11:48:09 +0100 (Wed, 10 Jan 2007)
New Revision: 4313
Modified:
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/SearchModeFactory.java
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/NewsSearchCommand.java
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/config/FastSearchConfiguration.java
Log:
swedish news as before
Modified:
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/SearchModeFactory.java
===================================================================
---
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/SearchModeFactory.java
2007-01-10 10:03:11 UTC (rev 4312)
+++
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/SearchModeFactory.java
2007-01-10 10:48:09 UTC (rev 4313)
@@ -456,6 +456,7 @@
fillBeanProperty(sc, inherit, "filter", ParseType.String ,
commandE, "");
fillBeanProperty(sc, inherit, "filtertype",
ParseType.String , commandE, "");
+ fillBeanProperty(sc, inherit, "project", ParseType.String
, commandE, "");
fillBeanProperty(sc, inherit, "ignoreNavigation",
ParseType.Boolean , commandE, "false");
fillBeanProperty(sc, inherit, "offensiveScoreLimit",
ParseType.Int , commandE, "-1");
fillBeanProperty(sc, inherit, "qtPipeline",
ParseType.String , commandE, "");
Modified:
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/NewsSearchCommand.java
===================================================================
---
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/NewsSearchCommand.java
2007-01-10 10:03:11 UTC (rev 4312)
+++
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/command/NewsSearchCommand.java
2007-01-10 10:48:09 UTC (rev 4313)
@@ -79,57 +79,78 @@
filterBuilder.append(FAST_SIZE_HACK);
}
- GregorianCalendar calendar = new java.util.GregorianCalendar();
- calendar.add( java.util.Calendar.MONTH, -24 );
- final SimpleDateFormat formatter = new
SimpleDateFormat("yyyy-MM-dd");
- String newsdate = formatter.format(calendar.getTime());
-
- if (!getSearchConfiguration().isIgnoreNavigation()) {
+ if ("se".equals(getSearchConfiguration().getProject())) {
+ if (!getSearchConfiguration().isIgnoreNavigation()) {
- final String contentSource = getParameter("contentsource");
- final String newsCountry = getParameter("newscountry");
- final String newsSource = getParameter("newssource");
+ final String contentSource =
getParameter("contentsource");
+ final String newsCountry = getParameter("newscountry");
- // general rule is to display news fresher than 2 years,
but with exceptions for:
- // "norske papiraviser" -> display for all years
- // certain newssources (as listed below) -> display for
all years
- if (!contentSource.equals("Mediearkivet")) {
-
// AAhhrghh. Need to provide backwards compatibility.
// People are linking us using contentsource="Norske
nyheter"
- if (contentSource != null &&
!contentSource.equals("")) {
+ if (contentSource != null &&
!contentSource.equals("")) {
if (contentSource.equals("Norske nyheter")) {
- filterBuilder.append(" AND newscountry:Norge");
+ filterBuilder.append(" +newscountry:Norge");
} else {
- filterBuilder.append(" AND contentsource:\""+
contentSource + "\"");
+ filterBuilder.append(" +contentsource:"+
contentSource);
}
+ }
+ if (newsCountry != null && !newsCountry.equals("")) {
+ filterBuilder.append(" +newscountry:"+
newsCountry);
+ }
+ }
+ } else {
+ GregorianCalendar calendar = new
java.util.GregorianCalendar();
+ calendar.add( java.util.Calendar.MONTH, -24 );
+ final SimpleDateFormat formatter = new
SimpleDateFormat("yyyy-MM-dd");
+ String newsdate = formatter.format(calendar.getTime());
+
+ if (!getSearchConfiguration().isIgnoreNavigation()) {
+
+ final String contentSource =
getParameter("contentsource");
+ final String newsCountry = getParameter("newscountry");
+ final String newsSource = getParameter("newssource");
+
+ // general rule is to display news fresher than 2
years, but with exceptions for:
+ // "norske papiraviser" -> display for all years
+ // certain newssources (as listed below) -> display
for all years
+ if (!contentSource.equals("Mediearkivet")) {
+
+ // AAhhrghh. Need to provide backwards
compatibility.
+ // People are linking us using
contentsource="Norske nyheter"
+ if (contentSource != null &&
!contentSource.equals("")) {
+ if (contentSource.equals("Norske nyheter")) {
+ filterBuilder.append(" AND
newscountry:Norge");
+ } else {
+ filterBuilder.append(" AND
contentsource:\""+ contentSource + "\"");
+ }
+ } else {
+ if (newsCountry != null &&
!newsCountry.equals(""))
+ filterBuilder.append(" AND
newscountry:\""+ newsCountry + "\"");
+ else // for newscount navigator
+ filterBuilder.append(" AND
newscountry:Norge");
+ }
+ filterBuilder.append(" ANDNOT
meta.collection:mano");
+ filterBuilder.append(" AND ( docdatetime:>" +
newsdate);
+ filterBuilder.append(" OR newssource:Digi.no");
+ filterBuilder.append(" OR newssource:DinSide");
+ filterBuilder.append(" OR newssource:ITavisen");
+ filterBuilder.append(" OR newssource:iMarkedet");
+ filterBuilder.append(" OR newssource:Propaganda
)");
+
+ // PAPERNEWS:
} else {
- if (newsCountry != null && !newsCountry.equals(""))
- filterBuilder.append(" AND newscountry:\""+
newsCountry + "\"");
- else // for newscount navigator
- filterBuilder.append(" AND newscountry:Norge");
+ filterBuilder.append(" AND contentsource:" +
contentSource);
}
- filterBuilder.append(" ANDNOT meta.collection:mano");
- filterBuilder.append(" AND (docdatetime:>" + newsdate);
+ } else {
+ filterBuilder.append(" AND (docdatetime:>" +
newsdate);
filterBuilder.append(" OR newssource:Digi.no");
filterBuilder.append(" OR newssource:DinSide");
filterBuilder.append(" OR newssource:ITavisen");
filterBuilder.append(" OR newssource:iMarkedet");
- filterBuilder.append(" OR newssource:Propaganda )");
-
- // PAPERNEWS:
- } else {
- filterBuilder.append(" AND contentsource:" +
contentSource);
- }
- } else {
- filterBuilder.append(" AND (docdatetime:>" + newsdate);
- filterBuilder.append(" OR newssource:Digi.no");
- filterBuilder.append(" OR newssource:DinSide");
- filterBuilder.append(" OR newssource:ITavisen");
- filterBuilder.append(" OR newssource:iMarkedet");
- filterBuilder.append(" OR newssource:Propaganda ");
- filterBuilder.append(" OR meta.collection:mano )");
- }
+ filterBuilder.append(" OR newssource:Propaganda ");
+ filterBuilder.append(" OR meta.collection:mano )");
+ }
+ }
}
}
return filterBuilder.toString();
Modified:
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/config/FastSearchConfiguration.java
===================================================================
---
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/config/FastSearchConfiguration.java
2007-01-10 10:03:11 UTC (rev 4312)
+++
branches/2.8/core-api/src/main/java/no/schibstedsok/searchportal/mode/config/FastSearchConfiguration.java
2007-01-10 10:48:09 UTC (rev 4313)
@@ -65,6 +65,7 @@
private String filter;
private String filtertype;
+ private String project;
private boolean relevantQueries = false;
@@ -97,6 +98,7 @@
spamScoreLimit = fsc.spamScoreLimit;
filter = fsc.filter;
filtertype = fsc.filtertype;
+ project = fsc.project;
relevantQueries = fsc.relevantQueries;
}
}
@@ -286,7 +288,14 @@
this.filtertype = filtertype;
}
+ public String getProject() {
+ return project;
+ }
+ public void setProject(final String project) {
+ this.project = project;
+ }
+
void setSpamScoreLimit(final int i) {
spamScoreLimit = i;
}
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits