def add_codes(self, codes, ids=None):
        # If a list of ids is not provided, assume it is the index of the data
        if ids is None:
            ids = count()

        with self.env.begin(db=self.index_db, write=True) as txn:
            for item_id, code in zip(ids, codes):
                key_prefix = self.encode_cell(code[0])
                key_suffix = bytes(item_id)
                key = key_prefix + key_suffix
                val = self.encode_fine_codes(code[1])
                txn.put(key, val)
        self.env.sync()
Add LOPQ codes into the search index.
dataset/ETHPy150Open yahoo/lopq/python/lopq/search.py/LOPQSearcherLMDB.add_codes