Commit 755900a3 authored by 段英荣's avatar 段英荣

modify

parent 17e344ac
......@@ -48,7 +48,21 @@ def query_tag(query,offset,size):
"include": ["id", "name"]
}
}
q["highlight"] = get_highlight(["name"])
q["highlight"] = get_highlight(["name"])
"""
q = {
"suggest":{
"tips-suggest":{
"prefix":query,
"completion":{
"field":"suggest"
}
}
},
}
"""
ret_list = list()
......
......@@ -2,7 +2,19 @@
"dynamic":"strict",
"properties": {
"id":{"type":"long"},
"suggest":{"type":"completion"},
"suggest":{
"type":"completion",
"contexts":[
{
"name":"is_online",
"type": "category"
},
{
"name":"is_deleted",
"type": "category"
}
]
},
"name":{"type":"text","analyzer":"gm_default_index","search_analyzer":"gm_default_index"},
"tag_type":{"type":"long"},
"is_online":{"type":"boolean"},//上线
......
......@@ -27,7 +27,13 @@ class TagTransfer(object):
if name_term:
tag_name_terms_list.append(name_term)
res["suggest"] = tag_name_terms_list
res["suggest"] = {
"input":tag_name_terms_list,
"contexts":{
"is_online": instance.is_online,
"is_deleted": instance.is_deleted
}
}
res["name"] = instance.name
res["is_online"] = instance.is_online
res["is_deleted"] = instance.is_deleted
......
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