From 5743e2582f36236d20188afee9ed2972de46be28 Mon Sep 17 00:00:00 2001 From: Larry Yan Date: Fri, 26 Jul 2019 14:31:33 +0800 Subject: [PATCH] fix(indexer): fix bug in indexer service --- gnes/service/indexer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnes/service/indexer.py b/gnes/service/indexer.py index 9dcee602..bdf5f428 100644 --- a/gnes/service/indexer.py +++ b/gnes/service/indexer.py @@ -39,11 +39,11 @@ def _handler_index(self, msg: 'gnes_pb2.Message'): if d.chunks: all_vecs.append(blob2array(d.chunk_embeddings)) doc_ids += [d.doc_id] * len(d.chunks) - if msg.request.index.docs.doc_type == 'TEXT': + if d.doc_type == 'TEXT': offsets += [c.offset_1d for c in d.chunks] - elif msg.request.index.docs.doc_type == 'IMAGE': + elif d.doc_type == 'IMAGE': offsets += [c.offset_nd for c in d.chunks] - elif msg.request.index.docs.doc_type == 'VIDEO': + elif d.doc_type == 'VIDEO': offsets += [c.offset_1d for c in d.chunks] weights += [c.weight for c in d.chunks]