@@ -106,7 +106,7 @@ class IndexKeyConfig(object):
106
106
"""
107
107
108
108
def __init__ (self , token_list = None , case_sensitive = False , index_type = 'text' , doc_value = False , alias = None ,
109
- json_key_config = None , chinese = None ):
109
+ json_key_config = None , chinese = None , embedding = None , vector_index = None ):
110
110
if token_list is None :
111
111
token_list = []
112
112
self .token_list = token_list
@@ -116,6 +116,8 @@ def __init__(self, token_list=None, case_sensitive=False, index_type='text', doc
116
116
self .alias = alias
117
117
self .json_key_config = json_key_config
118
118
self .chn = chinese
119
+ self .embedding = embedding
120
+ self .vector_index = vector_index
119
121
120
122
def set_json_key_config (self , json_key_config ):
121
123
self .json_key_config = json_key_config
@@ -133,6 +135,10 @@ def to_json(self):
133
135
if self .alias is not None :
134
136
json_value ['alias' ] = self .alias
135
137
json_value ["doc_value" ] = bool (self .doc_value )
138
+ if self .embedding is not None :
139
+ json_value ["embedding" ] = bool (self .embedding )
140
+ if self .vector_index is not None :
141
+ json_value ["vector_index" ] = bool (self .vector_index )
136
142
137
143
if self .chn is not None :
138
144
json_value ['chn' ] = self .chn
@@ -159,6 +165,10 @@ def from_json(self, json_value):
159
165
if self .index_type == 'json' :
160
166
self .json_key_config = IndexJsonKeyConfig ()
161
167
self .json_key_config .from_json (json_value )
168
+ if 'embedding' in json_value :
169
+ self .embedding = json_value ['embedding' ]
170
+ if 'vector_index' in json_value :
171
+ self .vector_index = json_value ['vector_index' ]
162
172
163
173
164
174
class IndexLineConfig (object ):
0 commit comments