Jelajahi Sumber

fix #650 add index.document.suggest.index

Shinsuke Sugaya 9 tahun lalu
induk
melakukan
824d60f0b2

+ 1 - 1
src/main/java/org/codelibs/fess/helper/SuggestHelper.java

@@ -86,7 +86,7 @@ public class SuggestHelper {
 
 
         fessEsClient.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(fessConfig.getIndexHealthTimeout());
         fessEsClient.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(fessConfig.getIndexHealthTimeout());
 
 
-        suggester = Suggester.builder().build(fessEsClient, fessConfig.getIndexDocumentSearchIndex());
+        suggester = Suggester.builder().build(fessEsClient, fessConfig.getIndexDocumentSuggestIndex());
         suggester.settings().array().delete(SuggestSettings.DefaultKeys.SUPPORTED_FIELDS);
         suggester.settings().array().delete(SuggestSettings.DefaultKeys.SUPPORTED_FIELDS);
         split(fessConfig.getSuggestFieldIndexContents(), ",").of(
         split(fessConfig.getSuggestFieldIndexContents(), ",").of(
                 stream -> stream.filter(StringUtil::isNotBlank).forEach(
                 stream -> stream.filter(StringUtil::isNotBlank).forEach(

+ 14 - 0
src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java

@@ -357,6 +357,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
     /** The key of the configuration. e.g. doc */
     /** The key of the configuration. e.g. doc */
     String INDEX_DOCUMENT_TYPE = "index.document.type";
     String INDEX_DOCUMENT_TYPE = "index.document.type";
 
 
+    /** The key of the configuration. e.g. fess */
+    String INDEX_DOCUMENT_SUGGEST_INDEX = "index.document.suggest.index";
+
     /** The key of the configuration. e.g. lang,role,label,anchor */
     /** The key of the configuration. e.g. lang,role,label,anchor */
     String INDEX_ADMIN_ARRAY_FIELDS = "index.admin.array.fields";
     String INDEX_ADMIN_ARRAY_FIELDS = "index.admin.array.fields";
 
 
@@ -2026,6 +2029,13 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
      */
      */
     String getIndexDocumentType();
     String getIndexDocumentType();
 
 
+    /**
+     * Get the value for the key 'index.document.suggest.index'. <br>
+     * The value is, e.g. fess <br>
+     * @return The value of found property. (NotNull: if not found, exception but basically no way)
+     */
+    String getIndexDocumentSuggestIndex();
+
     /**
     /**
      * Get the value for the key 'index.admin.array.fields'. <br>
      * Get the value for the key 'index.admin.array.fields'. <br>
      * The value is, e.g. lang,role,label,anchor <br>
      * The value is, e.g. lang,role,label,anchor <br>
@@ -4662,6 +4672,10 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
             return get(FessConfig.INDEX_DOCUMENT_TYPE);
             return get(FessConfig.INDEX_DOCUMENT_TYPE);
         }
         }
 
 
+        public String getIndexDocumentSuggestIndex() {
+            return get(FessConfig.INDEX_DOCUMENT_SUGGEST_INDEX);
+        }
+
         public String getIndexAdminArrayFields() {
         public String getIndexAdminArrayFields() {
             return get(FessConfig.INDEX_ADMIN_ARRAY_FIELDS);
             return get(FessConfig.INDEX_ADMIN_ARRAY_FIELDS);
         }
         }

+ 1 - 0
src/main/resources/fess_config.properties

@@ -171,6 +171,7 @@ response.field.site_path=site_path
 index.document.search.index=fess.search
 index.document.search.index=fess.search
 index.document.update.index=fess.update
 index.document.update.index=fess.update
 index.document.type=doc
 index.document.type=doc
+index.document.suggest.index=fess
 
 
 # doc management
 # doc management
 index.admin.array.fields=lang,role,label,anchor
 index.admin.array.fields=lang,role,label,anchor