EvanLjp commented on a change in pull request #6249:
URL: https://github.com/apache/skywalking/pull/6249#discussion_r563310504



##########
File path: 
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java
##########
@@ -113,14 +115,32 @@ protected void createTable(Model model) throws 
StorageException {
         setting.put("index.refresh_interval", model.isRecord()
             ? TimeValue.timeValueSeconds(10).toString()
             : 
TimeValue.timeValueSeconds(config.getFlushInterval()).toString());
-        setting.put("analysis.analyzer.oap_analyzer.type", "stop");
+        setting.put("analysis", getAnalyzerSetting(model.getAnalyzer()));

Review comment:
       Analyzer is for columns, so it should be for column configuration, and 
setting needs to define the configuration of multiple columns in combination at 
the same time, so I think the current structure is clear. 
   
   this is a test example: 
   ```json
   {
     "log" : {
       "order" : 0,
       "index_patterns" : [
         "log-*"
       ],
       "settings" : {
         "index" : {
           "refresh_interval" : "10s",
           "analysis" : {
             "filter" : {
               "cjk_log_stop_filter" : {
                 "type" : "stop",
                 "stopwords" : "_none_"
               },
               "cjk_log_bigram_filter" : {
                 "output_unigrams" : "true",
                 "type" : "cjk_bigram"
               },
               "cjk_log_word_delimiter" : {
                 "type" : "word_delimiter",
                 "preserve_original" : "true",
                 "split_on_numerics" : "false"
               }
             },
             "analyzer" : {
               "oap_log_analyzer" : {
                 "filter" : [
                   "cjk_width",
                   "lowercase",
                   "cjk_log_bigram_filter",
                   "cjk_log_word_delimiter",
                   "cjk_log_stop_filter"
                 ],
                 "type" : "custom",
                 "tokenizer" : "standard"
               },
               "oap_analyzer" : {
                 "type" : "stop"
               }
             }
           },
           "number_of_shards" : "5",
           "number_of_replicas" : "0"
         }
       },
       "mappings" : {
         "properties" : {
           "trace_id" : {
             "type" : "keyword"
           },
           "unique_id" : {
             "type" : "keyword"
           },
           "content_match" : {
             "analyzer" : "oap_log_analyzer",
             "type" : "text"
           },
           "span_id" : {
             "type" : "integer"
           },
           "endpoint_name" : {
             "copy_to" : "endpoint_name_match",
             "type" : "keyword"
           },
           "endpoint_id" : {
             "type" : "keyword"
           },
           "service_instance_id" : {
             "type" : "keyword"
           },
           "content" : {
             "copy_to" : "content_match",
             "type" : "keyword"
           },
           "endpoint_name_match" : {
             "analyzer" : "oap_analyzer",
             "type" : "text"
           },
           "tags" : {
             "type" : "keyword"
           },
           "trace_segment_id" : {
             "type" : "keyword"
           },
           "content_type" : {
             "index" : false,
             "type" : "integer"
           },
           "tags_raw_data" : {
             "index" : false,
             "type" : "binary"
           },
           "service_id" : {
             "type" : "keyword"
           },
           "time_bucket" : {
             "type" : "long"
           },
           "is_error" : {
             "type" : "integer"
           },
           "timestamp" : {
             "type" : "long"
           }
         }
       },
       "aliases" : {
         "log" : { }
       }
     }
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to