Browse Source

fix #2564 add analyzer for description field

Shinsuke Sugaya 4 years ago
parent
commit
e624a92004

+ 1 - 1
src/main/java/org/codelibs/fess/app/service/DataConfigService.java

@@ -94,7 +94,7 @@ public class DataConfigService extends FessAppService {
             cb.query().setHandlerName_Wildcard(wrapQuery(dataConfigPager.handlerName));
             cb.query().setHandlerName_Wildcard(wrapQuery(dataConfigPager.handlerName));
         }
         }
         if (StringUtil.isNotBlank(dataConfigPager.description)) {
         if (StringUtil.isNotBlank(dataConfigPager.description)) {
-            cb.query().setDescription_Wildcard(wrapQuery(dataConfigPager.description));
+            cb.query().setDescription_MatchPhrase(wrapQuery(dataConfigPager.description));
         }
         }
         // TODO Long, Integer, String supported only.
         // TODO Long, Integer, String supported only.
 
 

+ 1 - 1
src/main/java/org/codelibs/fess/app/service/FileConfigService.java

@@ -103,7 +103,7 @@ public class FileConfigService extends FessAppService {
             cb.query().setPaths_Wildcard(wrapQuery(fileConfigPager.paths));
             cb.query().setPaths_Wildcard(wrapQuery(fileConfigPager.paths));
         }
         }
         if (StringUtil.isNotBlank(fileConfigPager.description)) {
         if (StringUtil.isNotBlank(fileConfigPager.description)) {
-            cb.query().setDescription_Wildcard(wrapQuery(fileConfigPager.description));
+            cb.query().setDescription_MatchPhrase(wrapQuery(fileConfigPager.description));
         }
         }
         // TODO Long, Integer, String supported only.
         // TODO Long, Integer, String supported only.
 
 

+ 1 - 1
src/main/java/org/codelibs/fess/app/service/WebConfigService.java

@@ -111,7 +111,7 @@ public class WebConfigService extends FessAppService {
             cb.query().setUrls_Wildcard(wrapQuery(webConfigPager.urls));
             cb.query().setUrls_Wildcard(wrapQuery(webConfigPager.urls));
         }
         }
         if (StringUtil.isNotBlank(webConfigPager.description)) {
         if (StringUtil.isNotBlank(webConfigPager.description)) {
-            cb.query().setDescription_Wildcard(wrapQuery(webConfigPager.description));
+            cb.query().setDescription_MatchPhrase(wrapQuery(webConfigPager.description));
         }
         }
         // TODO Long, Integer, String supported only.
         // TODO Long, Integer, String supported only.
 
 

+ 15 - 0
src/main/resources/fess_indices/.fess_config.data_config.json

@@ -5,6 +5,21 @@
       "number_of_shards": 1,
       "number_of_shards": 1,
       "number_of_replicas": 0,
       "number_of_replicas": 0,
       "auto_expand_replicas": "0-1"
       "auto_expand_replicas": "0-1"
+    },
+    "analysis": {
+      "analyzer": {
+        "standard_analyzer": {
+          "type": "custom",
+          "tokenizer": "standard",
+          "filter": [
+            "cjk_width",
+            "asciifolding",
+            "lowercase",
+            "stop",
+            "stemmer"
+          ]
+        }
+      }
     }
     }
   }
   }
 }
 }

+ 2 - 1
src/main/resources/fess_indices/.fess_config.data_config/data_config.json

@@ -40,7 +40,8 @@
         "type": "long"
         "type": "long"
       },
       },
       "description" : {
       "description" : {
-        "type": "text"
+        "type": "text",
+        "analyzer": "standard_analyzer"
       }
       }
     }
     }
 }
 }

+ 15 - 0
src/main/resources/fess_indices/.fess_config.file_config.json

@@ -5,6 +5,21 @@
       "number_of_shards": 1,
       "number_of_shards": 1,
       "number_of_replicas": 0,
       "number_of_replicas": 0,
       "auto_expand_replicas": "0-1"
       "auto_expand_replicas": "0-1"
+    },
+    "analysis": {
+      "analyzer": {
+        "standard_analyzer": {
+          "type": "custom",
+          "tokenizer": "standard",
+          "filter": [
+            "cjk_width",
+            "asciifolding",
+            "lowercase",
+            "stop",
+            "stemmer"
+          ]
+        }
+      }
     }
     }
   }
   }
 }
 }

+ 2 - 1
src/main/resources/fess_indices/.fess_config.file_config/file_config.json

@@ -64,7 +64,8 @@
         "type": "long"
         "type": "long"
       },
       },
       "description" : {
       "description" : {
-        "type": "text"
+        "type": "text",
+        "analyzer": "standard_analyzer"
       }
       }
     }
     }
 }
 }

+ 15 - 0
src/main/resources/fess_indices/.fess_config.web_config.json

@@ -5,6 +5,21 @@
       "number_of_shards": 1,
       "number_of_shards": 1,
       "number_of_replicas": 0,
       "number_of_replicas": 0,
       "auto_expand_replicas": "0-1"
       "auto_expand_replicas": "0-1"
+    },
+    "analysis": {
+      "analyzer": {
+        "standard_analyzer": {
+          "type": "custom",
+          "tokenizer": "standard",
+          "filter": [
+            "cjk_width",
+            "asciifolding",
+            "lowercase",
+            "stop",
+            "stemmer"
+          ]
+        }
+      }
     }
     }
   }
   }
 }
 }

+ 2 - 1
src/main/resources/fess_indices/.fess_config.web_config/web_config.json

@@ -67,7 +67,8 @@
         "type": "long"
         "type": "long"
       },
       },
       "description" : {
       "description" : {
-        "type": "text"
+        "type": "text",
+        "analyzer": "standard_analyzer"
       }
       }
     }
     }
 }
 }