Author: ssmiweve
Date: 2008-02-20 17:56:18 +0100 (Wed, 20 Feb 2008)
New Revision: 6156

Modified:
   
branches/2.16.0/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooIdpSearchCommand.java
Log:
redo r6127 & r6131 as they were patched into production.


Modified: 
branches/2.16.0/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooIdpSearchCommand.java
===================================================================
--- 
branches/2.16.0/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooIdpSearchCommand.java
  2008-02-20 16:47:26 UTC (rev 6155)
+++ 
branches/2.16.0/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooIdpSearchCommand.java
  2008-02-20 16:56:18 UTC (rev 6156)
@@ -30,6 +30,7 @@
 import no.sesat.search.mode.config.YahooIdpCommandConfig;
 import no.sesat.search.query.AndClause;
 import no.sesat.search.query.AndNotClause;
+import no.sesat.search.query.Clause;
 import no.sesat.search.query.DefaultOperatorClause;
 import no.sesat.search.query.LeafClause;
 import no.sesat.search.query.NotClause;
@@ -256,20 +257,16 @@
     @Override
     protected void visitImpl(final LeafClause clause) {
 
-        if(!isEmptyLeaf(clause)){
-            if(Boolean.TRUE == clauseState){
-                appendToQueryRepresentation('+');
-            }else if(Boolean.FALSE == clauseState){
-                appendToQueryRepresentation('-');
-            }
-        }
+        insertClauseStatePrefix(clause);
         super.visitImpl(clause);
     }
 
     /** TODO comment me. **/
     protected void visitImpl(final PhraseClause clause) {
+
         if (clause.getField() == null) {
-            appendToQueryRepresentation(PHRASEWORDS + 
getTransformedTerm(clause) + ')');
+            insertClauseStatePrefix(clause);
+            appendToQueryRepresentation(getTransformedTerm(clause));
         }
     }
 
@@ -325,4 +322,15 @@
             clause.getFirstClause().accept(this);
         }
     }
+
+    private void insertClauseStatePrefix(final Clause clause){
+
+        if(!isEmptyLeaf(clause)){
+            if(Boolean.TRUE == clauseState){
+                appendToQueryRepresentation('+');
+            }else if(Boolean.FALSE == clauseState){
+                appendToQueryRepresentation('-');
+            }
+        }
+    }
 }

_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits

Reply via email to