Skip to content
Permalink
Browse files

fix(doc sum router): use meta info instead of doc id to do doc sum

  • Loading branch information...
jemmyshin committed Aug 14, 2019
1 parent 2d1eaf3 commit 315bd16af8fd58a7c8ef12d772178fc11a67de6c
Showing with 12 additions and 12 deletions.
  1. +12 −12 tests/test_router.py
@@ -164,16 +164,16 @@ def test_doc_reduce_router(self):
# shard1 only has d1
s = msg.response.search.topk_results.add()
s.score = 0.1
s.doc.meta_info = b'1'
s.doc.doc_id = 1
s.doc.raw_text = 'd1'

s = msg.response.search.topk_results.add()
s.score = 0.2
s.doc.meta_info = b'2'
s.doc.doc_id = 2

s = msg.response.search.topk_results.add()
s.score = 0.3
s.doc.meta_info = b'3'
s.doc.doc_id = 3

msg.envelope.num_part.extend([1, 2])
c1.send_message(msg)
@@ -183,16 +183,16 @@ def test_doc_reduce_router(self):
# shard2 has d2 and d3
s = msg.response.search.topk_results.add()
s.score = 0.1
s.doc.meta_info = b'1'
s.doc.doc_id = 1

s = msg.response.search.topk_results.add()
s.score = 0.2
s.doc.meta_info = b'2'
s.doc.doc_id = 2
s.doc.raw_text = 'd2'

s = msg.response.search.topk_results.add()
s.score = 0.3
s.doc.meta_info = b'3'
s.doc.doc_id = 3
s.doc.raw_text = 'd3'

msg.response.search.top_k = 5
@@ -279,19 +279,19 @@ def test_doc_sum_reduce_router(self):

s = msg.response.search.topk_results.add()
s.score = 0.4
s.doc.doc_id = 1
s.doc.meta_info = b'1'
s.doc.raw_text = 'd3'
s.score_explained = '1-d3\n'

s = msg.response.search.topk_results.add()
s.score = 0.3
s.doc.doc_id = 2
s.doc.meta_info = b'2'
s.doc.raw_text = 'd2'
s.score_explained = '1-d2\n'

s = msg.response.search.topk_results.add()
s.score = 0.2
s.doc.doc_id = 3
s.doc.meta_info = b'3'
s.doc.raw_text = 'd1'
s.score_explained = '1-d3\n'

@@ -302,19 +302,19 @@ def test_doc_sum_reduce_router(self):

s = msg.response.search.topk_results.add()
s.score = 0.5
s.doc.doc_id = 1
s.doc.meta_info = b'1'
s.doc.raw_text = 'd2'
s.score_explained = '2-d2\n'

s = msg.response.search.topk_results.add()
s.score = 0.2
s.doc.doc_id = 2
s.doc.meta_info = b'2'
s.doc.raw_text = 'd1'
s.score_explained = '2-d1\n'

s = msg.response.search.topk_results.add()
s.score = 0.1
s.doc.doc_id = 3
s.doc.meta_info = b'3'
s.doc.raw_text = 'd3'
s.score_explained = '2-d3\n'

0 comments on commit 315bd16

Please sign in to comment.
You can’t perform that action at this time.