Shinsuke Sugaya 7 rokov pred
rodič
commit
33e2c6927d

+ 1 - 0
src/main/java/org/codelibs/fess/es/client/FessEsClient.java

@@ -396,6 +396,7 @@ public class FessEsClient implements Client {
                 dictionaryPath = dictionaryPath + "/";
                 dictionaryPath = dictionaryPath + "/";
             }
             }
             source = source.replaceAll(Pattern.quote("${fess.dictionary.path}"), dictionaryPath);
             source = source.replaceAll(Pattern.quote("${fess.dictionary.path}"), dictionaryPath);
+            source = source.replaceAll(Pattern.quote("${fess.index.codec}"), fessConfig.getIndexCodec());
             final CreateIndexResponse indexResponse =
             final CreateIndexResponse indexResponse =
                     client.admin().indices().prepareCreate(indexName).setSource(source, XContentType.JSON).execute()
                     client.admin().indices().prepareCreate(indexName).setSource(source, XContentType.JSON).execute()
                             .actionGet(fessConfig.getIndexIndicesTimeout());
                             .actionGet(fessConfig.getIndexIndicesTimeout());

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

@@ -321,6 +321,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
     /** The key of the configuration. e.g. 10485760 */
     /** The key of the configuration. e.g. 10485760 */
     String INDEXER_DATA_MAX_DOCUMENT_REQUEST_SIZE = "indexer.data.max.document.request.size";
     String INDEXER_DATA_MAX_DOCUMENT_REQUEST_SIZE = "indexer.data.max.document.request.size";
 
 
+    /** The key of the configuration. e.g. default */
+    String INDEX_CODEC = "index.codec";
+
     /** The key of the configuration. e.g. favorite_count */
     /** The key of the configuration. e.g. favorite_count */
     String INDEX_FIELD_favorite_count = "index.field.favorite_count";
     String INDEX_FIELD_favorite_count = "index.field.favorite_count";
 
 
@@ -2305,6 +2308,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
      */
      */
     Integer getIndexerDataMaxDocumentRequestSizeAsInteger();
     Integer getIndexerDataMaxDocumentRequestSizeAsInteger();
 
 
+    /**
+     * Get the value for the key 'index.codec'. <br>
+     * The value is, e.g. default <br>
+     * comment: index setting
+     * @return The value of found property. (NotNull: if not found, exception but basically no way)
+     */
+    String getIndexCodec();
+
     /**
     /**
      * Get the value for the key 'index.field.favorite_count'. <br>
      * Get the value for the key 'index.field.favorite_count'. <br>
      * The value is, e.g. favorite_count <br>
      * The value is, e.g. favorite_count <br>
@@ -6001,6 +6012,10 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
             return getAsInteger(FessConfig.INDEXER_DATA_MAX_DOCUMENT_REQUEST_SIZE);
             return getAsInteger(FessConfig.INDEXER_DATA_MAX_DOCUMENT_REQUEST_SIZE);
         }
         }
 
 
+        public String getIndexCodec() {
+            return get(FessConfig.INDEX_CODEC);
+        }
+
         public String getIndexFieldFavoriteCount() {
         public String getIndexFieldFavoriteCount() {
             return get(FessConfig.INDEX_FIELD_favorite_count);
             return get(FessConfig.INDEX_FIELD_favorite_count);
         }
         }
@@ -7801,6 +7816,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
             defaultMap.put(FessConfig.INDEXER_WEBFS_MAX_DOCUMENT_REQUEST_SIZE, "10485760");
             defaultMap.put(FessConfig.INDEXER_WEBFS_MAX_DOCUMENT_REQUEST_SIZE, "10485760");
             defaultMap.put(FessConfig.INDEXER_DATA_MAX_DOCUMENT_CACHE_SIZE, "5");
             defaultMap.put(FessConfig.INDEXER_DATA_MAX_DOCUMENT_CACHE_SIZE, "5");
             defaultMap.put(FessConfig.INDEXER_DATA_MAX_DOCUMENT_REQUEST_SIZE, "10485760");
             defaultMap.put(FessConfig.INDEXER_DATA_MAX_DOCUMENT_REQUEST_SIZE, "10485760");
+            defaultMap.put(FessConfig.INDEX_CODEC, "default");
             defaultMap.put(FessConfig.INDEX_FIELD_favorite_count, "favorite_count");
             defaultMap.put(FessConfig.INDEX_FIELD_favorite_count, "favorite_count");
             defaultMap.put(FessConfig.INDEX_FIELD_click_count, "click_count");
             defaultMap.put(FessConfig.INDEX_FIELD_click_count, "click_count");
             defaultMap.put(FessConfig.INDEX_FIELD_config_id, "config_id");
             defaultMap.put(FessConfig.INDEX_FIELD_config_id, "config_id");

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

@@ -173,6 +173,9 @@ indexer.webfs.max.document.request.size=10485760
 indexer.data.max.document.cache.size=5
 indexer.data.max.document.cache.size=5
 indexer.data.max.document.request.size=10485760
 indexer.data.max.document.request.size=10485760
 
 
+# index setting
+index.codec=default
+
 # field names
 # field names
 index.field.favorite_count=favorite_count
 index.field.favorite_count=favorite_count
 index.field.click_count=click_count
 index.field.click_count=click_count

+ 1 - 0
src/main/resources/fess_indices/fess.json

@@ -1,6 +1,7 @@
 {
 {
   "settings": {
   "settings": {
     "index": {
     "index": {
+      "codec": "${fess.index.codec}",
       "refresh_interval": "1s",
       "refresh_interval": "1s",
       "number_of_shards": 5,
       "number_of_shards": 5,
       "number_of_replicas": 0
       "number_of_replicas": 0