Commit aee8159a authored by Kai's avatar Kai

add logging

parent fb2d2cb6
...@@ -24,29 +24,5 @@ ...@@ -24,29 +24,5 @@
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" /> <option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings> </formatting-settings>
</DBN-SQL> </DBN-SQL>
<DBN-PSQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
</code_scheme> </code_scheme>
</component> </component>
\ No newline at end of file
...@@ -456,22 +456,22 @@ class TopicUtils(object): ...@@ -456,22 +456,22 @@ class TopicUtils(object):
} }
} }
] ]
# if len(topic_tag_list) > 0: if len(topic_tag_list) > 0:
# functions_list.append( functions_list.append(
# { {
# "filter": {"bool": { "filter": {"bool": {
# "should": {"terms": {"tag_list": topic_tag_list}}}}, "should": {"terms": {"tag_list": topic_tag_list}}}},
# "weight": 5000 "weight": 5000
# } }
# ) )
# if topic_user_id != -1: if topic_user_id != -1:
# functions_list.append( functions_list.append(
# { {
# "filter": {"bool": { "filter": {"bool": {
# "should": {"term": {"user_id": topic_user_id}}}}, "should": {"term": {"user_id": topic_user_id}}}},
# "weight": 5000 "weight": 5000
# } }
# ) )
if len(topic_tag_list) != 0 or topic_user_id!= -1: if len(topic_tag_list) != 0 or topic_user_id!= -1:
query_function_score = { query_function_score = {
"query": { "query": {
...@@ -513,18 +513,18 @@ class TopicUtils(object): ...@@ -513,18 +513,18 @@ class TopicUtils(object):
"functions": functions_list "functions": functions_list
} }
if len(topic_tag_list) > 0: # if len(topic_tag_list) > 0:
query_function_score["query"]["bool"]["should"] = { # query_function_score["query"]["bool"]["should"] = {
"terms": { # "terms": {
"tag_list": topic_tag_list # "tag_list": topic_tag_list
} # }
} # }
if topic_user_id != -1: # if topic_user_id != -1:
query_function_score["query"]["bool"]["should"] = { # query_function_score["query"]["bool"]["should"] = {
"term": { # "term": {
"user_id": topic_user_id # "user_id": topic_user_id
} # }
} # }
q["query"]["function_score"] = query_function_score q["query"]["function_score"] = query_function_score
q["collapse"] = { q["collapse"] = {
"field": "user_id" "field": "user_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