Commit 42159f63 authored by 段英荣's avatar 段英荣

modify search

parent b6825d93
...@@ -335,54 +335,70 @@ class TopicUtils(object): ...@@ -335,54 +335,70 @@ class TopicUtils(object):
{ {
"weight": 400, "weight": 400,
"filter":{ "filter":{
"term": {"user_nick_name_pre": query.lower()} "constant_score":{
"filter":{
"term": {"user_nick_name_pre": query.lower()}
}
}
} }
}, },
{ {
"weight": 300, "weight": 300,
"filter": { "filter": {
"bool": { "constant_score":{
"must": { "filter":{
"term": {"content_level": 6}, "bool": {
}, "must": {
"minimum_should_match": 1, "term": {"content_level": 6},
"should": [ },
{'multi_match': multi_match}, "minimum_should_match": 1,
{"term": {"tag_list": tag_id}}, "should": [
{"term": {"user_nick_name_pre": query.lower()}} {'multi_match': multi_match},
] {"term": {"tag_list": tag_id}},
{"term": {"user_nick_name_pre": query.lower()}}
]
}
}
} }
} }
}, },
{ {
"weight": 200, "weight": 200,
"filter": { "filter": {
"bool": { "constant_score":{
"must": { "filter":{
"term": {"content_level": 5}, "bool": {
}, "must": {
"minimum_should_match": 1, "term": {"content_level": 5},
"should": [ },
{'multi_match': multi_match}, "minimum_should_match": 1,
{"term": {"tag_list": tag_id}}, "should": [
{"term": {"user_nick_name_pre": query.lower()}} {'multi_match': multi_match},
] {"term": {"tag_list": tag_id}},
{"term": {"user_nick_name_pre": query.lower()}}
]
}
}
} }
} }
}, },
{ {
"weight": 100, "weight": 100,
"filter": { "filter": {
"bool": { "constant_score":{
"must": { "filter":{
"term": {"content_level": 4}, "bool": {
}, "must": {
"minimum_should_match": 1, "term": {"content_level": 4},
"should": [ },
{'multi_match': multi_match}, "minimum_should_match": 1,
{"term": {"tag_list": tag_id}}, "should": [
{"term": {"user_nick_name_pre": query.lower()}} {'multi_match': multi_match},
] {"term": {"tag_list": tag_id}},
{"term": {"user_nick_name_pre": query.lower()}}
]
}
}
} }
} }
} }
......
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