Browse Source

fix OR query problem

Shinsuke Sugaya 10 years ago
parent
commit
776f88b705
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/main/java/jp/sf/fess/action/IndexAction.java

+ 3 - 3
src/main/java/jp/sf/fess/action/IndexAction.java

@@ -936,6 +936,9 @@ public class IndexAction {
         if (StringUtil.isNotBlank(indexForm.op)) {
         if (StringUtil.isNotBlank(indexForm.op)) {
             request.setAttribute(Constants.DEFAULT_OPERATOR, indexForm.op);
             request.setAttribute(Constants.DEFAULT_OPERATOR, indexForm.op);
         }
         }
+        if (queryBuf.indexOf(" OR ") >= 0) {
+            queryBuf.insert(0, '(').append(')');
+        }
         if (indexForm.additional != null) {
         if (indexForm.additional != null) {
             final Set<String> fieldSet = new HashSet<String>();
             final Set<String> fieldSet = new HashSet<String>();
             for (final String additional : indexForm.additional) {
             for (final String additional : indexForm.additional) {
@@ -946,9 +949,6 @@ public class IndexAction {
                 }
                 }
             }
             }
         }
         }
-        if (queryBuf.indexOf(" OR ") >= 0) {
-            queryBuf.insert(0, '(').append(')');
-        }
         if (!indexForm.fields.isEmpty()) {
         if (!indexForm.fields.isEmpty()) {
             for (final Map.Entry<String, String[]> entry : indexForm.fields
             for (final Map.Entry<String, String[]> entry : indexForm.fields
                     .entrySet()) {
                     .entrySet()) {