Shinsuke Sugaya 11 年 前
コミット
2d4ff7e3dc

+ 16 - 14
src/main/java/jp/sf/fess/helper/QueryHelper.java

@@ -85,6 +85,8 @@ public class QueryHelper implements Serializable {
 
 
     private static final String _AND_ = " AND ";
     private static final String _AND_ = " AND ";
 
 
+    private static final String _DEFAULT_ = " ";
+
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
     @Binding(bindingType = BindingType.MAY)
     @Binding(bindingType = BindingType.MAY)
@@ -174,7 +176,7 @@ public class QueryHelper implements Serializable {
 
 
     /*
     /*
      * (non-Javadoc)
      * (non-Javadoc)
-     * 
+     *
      * @see jp.sf.fess.helper.QueryHelper#build(java.lang.String)
      * @see jp.sf.fess.helper.QueryHelper#build(java.lang.String)
      */
      */
     public SearchQuery build(final String query, final boolean envCondition) {
     public SearchQuery build(final String query, final boolean envCondition) {
@@ -321,7 +323,7 @@ public class QueryHelper implements Serializable {
 
 
         final StringBuilder queryBuf = new StringBuilder(255);
         final StringBuilder queryBuf = new StringBuilder(255);
         final List<String> notOperatorList = new ArrayList<String>();
         final List<String> notOperatorList = new ArrayList<String>();
-        String operator = _AND_;
+        String operator = _DEFAULT_;
         boolean notOperatorFlag = false;
         boolean notOperatorFlag = false;
         int queryOperandCount = 0;
         int queryOperandCount = 0;
         int contentOperandCount = 0;
         int contentOperandCount = 0;
@@ -377,7 +379,7 @@ public class QueryHelper implements Serializable {
                         fieldLogWord = targetWord;
                         fieldLogWord = targetWord;
                     }
                     }
                     nonPrefix = true;
                     nonPrefix = true;
-                    operator = _AND_;
+                    operator = _DEFAULT_;
                     if (highlightFieldSet.contains(field)) {
                     if (highlightFieldSet.contains(field)) {
                         highLightQueryList.add(targetWord);
                         highLightQueryList.add(targetWord);
                     }
                     }
@@ -421,7 +423,7 @@ public class QueryHelper implements Serializable {
                     buildContentQueryWithLang(buf, value, queryLanguage);
                     buildContentQueryWithLang(buf, value, queryLanguage);
                     notOperatorList.add(buf.toString());
                     notOperatorList.add(buf.toString());
 
 
-                    operator = _AND_;
+                    operator = _DEFAULT_;
                     notOperatorFlag = false;
                     notOperatorFlag = false;
                     highLightQueryList.add(value);
                     highLightQueryList.add(value);
 
 
@@ -437,7 +439,7 @@ public class QueryHelper implements Serializable {
                     buildContentQueryWithLang(queryBuf, value, queryLanguage);
                     buildContentQueryWithLang(queryBuf, value, queryLanguage);
                     contentOperandCount++;
                     contentOperandCount++;
 
 
-                    operator = _AND_;
+                    operator = _DEFAULT_;
                     highLightQueryList.add(value);
                     highLightQueryList.add(value);
 
 
                     if (fieldLogMap != null) {
                     if (fieldLogMap != null) {
@@ -450,7 +452,7 @@ public class QueryHelper implements Serializable {
         StringBuilder searchQueryBuf = new StringBuilder(255);
         StringBuilder searchQueryBuf = new StringBuilder(255);
         if (queryBuf.length() > 0) {
         if (queryBuf.length() > 0) {
             searchQueryBuf.append(queryBuf.toString());
             searchQueryBuf.append(queryBuf.toString());
-            operator = _AND_;
+            operator = _DEFAULT_;
         } else {
         } else {
             operator = StringUtil.EMPTY;
             operator = StringUtil.EMPTY;
         }
         }
@@ -469,7 +471,7 @@ public class QueryHelper implements Serializable {
                 searchQueryBuf.append(operator);
                 searchQueryBuf.append(operator);
                 searchQueryBuf.append(NOT_);
                 searchQueryBuf.append(NOT_);
                 searchQueryBuf.append(notOperator);
                 searchQueryBuf.append(notOperator);
-                operator = _AND_;
+                operator = _DEFAULT_;
             }
             }
         }
         }
 
 
@@ -792,7 +794,7 @@ public class QueryHelper implements Serializable {
 
 
         final StringBuilder queryBuf = new StringBuilder(255);
         final StringBuilder queryBuf = new StringBuilder(255);
         final List<String> notOperatorList = new ArrayList<String>();
         final List<String> notOperatorList = new ArrayList<String>();
-        String operator = _AND_;
+        String operator = _DEFAULT_;
         boolean notOperatorFlag = false;
         boolean notOperatorFlag = false;
         int queryOperandCount = 0;
         int queryOperandCount = 0;
         int contentOperandCount = 0;
         int contentOperandCount = 0;
@@ -828,7 +830,7 @@ public class QueryHelper implements Serializable {
                         queryOperandCount++;
                         queryOperandCount++;
                     }
                     }
                     nonPrefix = true;
                     nonPrefix = true;
-                    operator = _AND_;
+                    operator = _DEFAULT_;
                     break;
                     break;
                 }
                 }
             }
             }
@@ -853,7 +855,7 @@ public class QueryHelper implements Serializable {
                     buildContentQueryWithLang(buf, value, queryLanguage);
                     buildContentQueryWithLang(buf, value, queryLanguage);
                     notOperatorList.add(buf.toString());
                     notOperatorList.add(buf.toString());
 
 
-                    operator = _AND_;
+                    operator = _DEFAULT_;
                     notOperatorFlag = false;
                     notOperatorFlag = false;
                 } else {
                 } else {
                     // content
                     // content
@@ -863,7 +865,7 @@ public class QueryHelper implements Serializable {
                     buildContentQueryWithLang(queryBuf, value, queryLanguage);
                     buildContentQueryWithLang(queryBuf, value, queryLanguage);
                     contentOperandCount++;
                     contentOperandCount++;
 
 
-                    operator = _AND_;
+                    operator = _DEFAULT_;
                 }
                 }
             }
             }
         }
         }
@@ -871,7 +873,7 @@ public class QueryHelper implements Serializable {
         StringBuilder searchQueryBuf = new StringBuilder(255);
         StringBuilder searchQueryBuf = new StringBuilder(255);
         if (queryBuf.length() > 0) {
         if (queryBuf.length() > 0) {
             searchQueryBuf.append(queryBuf.toString());
             searchQueryBuf.append(queryBuf.toString());
-            operator = _AND_;
+            operator = _DEFAULT_;
         } else {
         } else {
             operator = StringUtil.EMPTY;
             operator = StringUtil.EMPTY;
         }
         }
@@ -890,7 +892,7 @@ public class QueryHelper implements Serializable {
                 searchQueryBuf.append(operator);
                 searchQueryBuf.append(operator);
                 searchQueryBuf.append(NOT_);
                 searchQueryBuf.append(NOT_);
                 searchQueryBuf.append(notOperator);
                 searchQueryBuf.append(notOperator);
-                operator = _AND_;
+                operator = _DEFAULT_;
             }
             }
         }
         }
 
 
@@ -1478,7 +1480,7 @@ public class QueryHelper implements Serializable {
 
 
         /*
         /*
          * (non-Javadoc)
          * (non-Javadoc)
-         * 
+         *
          * @see java.lang.Object#toString()
          * @see java.lang.Object#toString()
          */
          */
         @Override
         @Override

ファイルの差分が大きいため隠しています
+ 220 - 241
src/test/java/jp/sf/fess/helper/QueryHelperTest.java


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません