Author: mickw
Date: 2006-04-27 14:57:03 +0200 (Thu, 27 Apr 2006)
New Revision: 2817
Modified:
trunk/src/java/no/schibstedsok/front/searchportal/command/NewsSearchCommand.java
trunk/src/java/no/schibstedsok/front/searchportal/command/WebSearchCommand.java
Log:
fixes to the previous merge from 2.0 commit.
Modified:
trunk/src/java/no/schibstedsok/front/searchportal/command/NewsSearchCommand.java
===================================================================
---
trunk/src/java/no/schibstedsok/front/searchportal/command/NewsSearchCommand.java
2006-04-27 12:37:48 UTC (rev 2816)
+++
trunk/src/java/no/schibstedsok/front/searchportal/command/NewsSearchCommand.java
2006-04-27 12:57:03 UTC (rev 2817)
@@ -93,62 +93,4 @@
||
firstLeaf.getPossiblePredicates().contains(TokenPredicate.NEWS_MAGIC));
}
-
- /**
- *
- * Visitor to create the FAST filter string. Handles the nyhetskilde:
syntax.
- *
- * @todo add correct handling of NotClause and AndNotClause. This also
needs
- * to be added to the query builder visitor above.
- *
- */
- private final class FilterVisitor extends AbstractReflectionVisitor {
-
- protected void visitImpl(final NotClause clause) {
- clause.getFirstClause().accept(this);
- }
-
- protected void visitImpl(final AndNotClause clause) {
- clause.getFirstClause().accept(this);
- }
-
- protected void visitImpl(final LeafClause clause) {
- if (hasSourceField(clause)) {
- appendSiteFilter(clause);
- }
- }
-
- protected void visitImpl(final PhraseClause clause) {
- if (hasSourceField(clause)) {
- appendSiteFilter(clause);
- }
- }
-
- protected void visitImpl(final DefaultOperatorClause clause) {
- clause.getFirstClause().accept(this);
- clause.getSecondClause().accept(this);
- }
-
- protected void visitImpl(final OrClause clause) {
- clause.getFirstClause().accept(this);
- clause.getSecondClause().accept(this);
- }
-
- protected void visitImpl(final AndClause clause) {
- clause.getFirstClause().accept(this);
- clause.getSecondClause().accept(this);
- }
-
- protected void visitImpl(final XorClause clause) {
- clause.getFirstClause().accept(this);
- }
-
- private final void appendSiteFilter(final LeafClause clause) {
- filterBuilder.append("+");
- filterBuilder.append(FAST_SOURCE_FILTER_FIELD);
- filterBuilder.append(':');
- filterBuilder.append(clause.getTerm().replaceAll("\"", ""));
- }
- }
-
}
\ No newline at end of file
Modified:
trunk/src/java/no/schibstedsok/front/searchportal/command/WebSearchCommand.java
===================================================================
---
trunk/src/java/no/schibstedsok/front/searchportal/command/WebSearchCommand.java
2006-04-27 12:37:48 UTC (rev 2816)
+++
trunk/src/java/no/schibstedsok/front/searchportal/command/WebSearchCommand.java
2006-04-27 12:57:03 UTC (rev 2817)
@@ -76,76 +76,4 @@
}
}
- protected String getAdditionalFilter() {
- synchronized (this) {
- if (filterBuilder == null) {
- filterBuilder = new StringBuffer();
- new FilterVisitor().visit(context.getQuery().getRootClause());
- }
- return filterBuilder.toString();
- }
- }
-
- private final boolean hasSiteField(final LeafClause clause) {
- return clause.getField() != null
- && clause.getField().equals(SESAM_SITE_PREFIX);
- }
-
- /**
- *
- * Visitor to create the FAST filter string. Handles the site: syntax.
- *
- * @todo add correct handling of NotClause and AndNotClause. This also
needs
- * to be added to the query builder visitor above.
- *
- */
- private final class FilterVisitor extends AbstractReflectionVisitor {
-
- protected void visitImpl(final LeafClause clause) {
- if (hasSiteField(clause)) {
- appendSiteFilter(clause);
- }
- }
-
- protected void visitImpl(final NotClause clause) {
- clause.getFirstClause().accept(this);
- }
-
- protected void visitImpl(final AndNotClause clause) {
- clause.getFirstClause().accept(this);
- }
-
- protected void visitImpl(final PhraseClause clause) {
- if (hasSiteField(clause)) {
- appendSiteFilter(clause);
- }
- }
-
- protected void visitImpl(final DefaultOperatorClause clause) {
- clause.getFirstClause().accept(this);
- clause.getSecondClause().accept(this);
- }
-
- protected void visitImpl(final OrClause clause) {
- clause.getFirstClause().accept(this);
- clause.getSecondClause().accept(this);
- }
-
- protected void visitImpl(final AndClause clause) {
- clause.getFirstClause().accept(this);
- clause.getSecondClause().accept(this);
- }
-
- protected void visitImpl(final XorClause clause) {
- clause.getFirstClause().accept(this);
- }
-
- private final void appendSiteFilter(final LeafClause clause) {
- filterBuilder.append("+");
- filterBuilder.append(FAST_SITE_FILTER_PREFIX);
- filterBuilder.append(':');
- filterBuilder.append(clause.getTerm().replaceAll("\"", ""));
- }
- }
-
}
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits