@@ -229,9 +229,12 @@ class IndexConfig(object):
229229 :type log_reduce: bool
230230 :param log_reduce: if to enable logreduce
231231
232+ :type scan_index: bool
233+ :param scan_index: if to enable scan index
234+
232235 """
233236
234- def __init__ (self , ttl = 1 , line_config = None , key_config_list = None , all_keys_config = None , log_reduce = None ):
237+ def __init__ (self , ttl = 1 , line_config = None , key_config_list = None , all_keys_config = None , log_reduce = None , scan_index = None ):
235238 if key_config_list is None :
236239 key_config_list = {}
237240 self .ttl = ttl
@@ -243,7 +246,7 @@ def __init__(self, ttl=1, line_config=None, key_config_list=None, all_keys_confi
243246 self .log_reduce_black_list = None
244247 self .log_reduce_white_list = None
245248 self .docvalue_max_text_len = 0
246-
249+ self . scan_index = scan_index
247250 '''
248251 :type max_len : int
249252 :param max_len : the max len of the docvalue
@@ -268,6 +271,9 @@ def set_log_reduce_black_list(self, black_list):
268271 def set_log_reduce_white_list (self , white_list ):
269272 self .log_reduce_white_list = white_list
270273
274+ def set_scan_index (self , scan_index ):
275+ self .scan_index = scan_index
276+
271277 def to_json (self ):
272278 json_value = {}
273279 if self .line_config is not None :
@@ -289,6 +295,9 @@ def to_json(self):
289295
290296 elif self .log_reduce_black_list != None :
291297 json_value ["log_reduce_black_list" ] = self .log_reduce_black_list
298+
299+ if self .scan_index is not None :
300+ json_value ["scan_index" ] = self .scan_index
292301
293302 return json_value
294303
@@ -314,3 +323,6 @@ def from_json(self, json_value):
314323 self .docvalue_max_text_len = json_value .get ('max_text_len' , 0 )
315324
316325 self .modify_time = json_value .get ("lastModifyTime" , int (time .time ()))
326+
327+ if 'scan_index' in json_value :
328+ self .scan_index = json_value ['scan_index' ]
0 commit comments