Commit 09bace70 authored by lixiaofang's avatar lixiaofang

update contrast_similar

parent 696aa7e2
......@@ -13,6 +13,7 @@
<element value="search.views.group"/>
<element value="search.views.user"/>
<element value="search.views.tag"/>
<element value="search.views.contrast_similar"/>
<element value="injection.data_sync.tasks"/>
</config>
</gm_rpcd_config>
......@@ -23,7 +23,7 @@ MAX_LOAD = 100
GROUP_SIZE = 10
@bind('doris/search/query_contrast_similar')
@bind('physical/search/query_contrast_similar')
def contrast_similar(user_id, offset=0, size=10):
try:
if isinstance(user_id, int):
......@@ -59,19 +59,23 @@ def get_all_topic_id_list(user_id, offset, size):
"term": {
"is_deleted": False
}
},
{
"terms":{
"content_level":[3,4,5]
}
}],
"minimum_should_match": 1,
"should": {
"match": {
"participant_user_id": read_topic_id_list
"terms": {
"user_id": read_topic_id_list
}
},
"minimum_should_match": 1
}
}
}
}
}
}
......@@ -82,9 +86,9 @@ def get_all_topic_id_list(user_id, offset, size):
offset=offset, size=size)
contrast_topic_ids = []
if result_dict['hits']["total"] > 0:
if len(result_dict['hits']) > 0:
res_hit = result_dict['hits']["hits"]
res_hit = result_dict['hits']
for item in res_hit:
topic_id = item['_source']['id']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment