Пример #1
0
 def __init__(self, connector=None):
     self.es = connector.es
     self.ic = connector.ic
     self.index = connector.index
     self.dbname = 'users'
     self.mapping = {
         self.dbname: {
             "properties": self.PROPERTIES,
         }
     }
     if not self.ic.exists_type(index=self.index,
                                doc_type=self.dbname):
         kwargs = add_params(self.es)
         self.ic.put_mapping(index=self.index, doc_type=self.dbname,
                             body=self.mapping, **kwargs)
Пример #2
0
 def __init__(self, connector=None):
     self.es = connector.es
     self.ic = connector.ic
     self.index = connector.index
     self.dbname = 'commits'
     self.mapping = {
         self.dbname: {
             "properties": PROPERTIES,
             "dynamic_templates": DYNAMIC_TEMPLATES,
         }
     }
     if not self.ic.exists_type(index=self.index, doc_type=self.dbname):
         kwargs = add_params(self.es)
         self.ic.put_mapping(index=self.index,
                             doc_type=self.dbname,
                             body=self.mapping,
                             **kwargs)