Author: ssmiweve
Date: 2008-02-16 23:04:30 +0100 (Sat, 16 Feb 2008)
New Revision: 6127
Modified:
branches/2.16/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooIdpSearchCommand.java
Log:
SEARCH-4291
Modified:
branches/2.16/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooIdpSearchCommand.java
===================================================================
---
branches/2.16/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooIdpSearchCommand.java
2008-02-16 21:02:00 UTC (rev 6126)
+++
branches/2.16/generic.sesam/search-command-control/default/src/main/java/no/sesat/search/mode/command/YahooIdpSearchCommand.java
2008-02-16 22:04:30 UTC (rev 6127)
@@ -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,19 +257,15 @@
@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) {
+ insertClauseStatePrefix(clause);
appendToQueryRepresentation(PHRASEWORDS +
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