add a batch of documents to the index
(self, row, col, data, n_docs=-1)
| 58 | self.index_doc_value = defaultdict(lambda: array.array("f")) |
| 59 | |
| 60 | def add_batch_document(self, row, col, data, n_docs=-1): |
| 61 | """add a batch of documents to the index |
| 62 | """ |
| 63 | if n_docs < 0: |
| 64 | self.n += len(set(row)) |
| 65 | else: |
| 66 | self.n += n_docs |
| 67 | for doc_id, dim_id, value in zip(row, col, data): |
| 68 | self.index_doc_id[dim_id].append(doc_id) |
| 69 | self.index_doc_value[dim_id].append(value) |
| 70 | |
| 71 | def __len__(self): |
| 72 | return len(self.index_doc_id) |
nothing calls this directly
no outgoing calls
no test coverage detected