Commit 764d20b6 authored by lixiaofang's avatar lixiaofang

add

parent 471fd27b
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="51c70d7e-a00b-4e4e-8cbb-f80f5801da99" name="Default Changelist" comment=""> <list default="true" id="51c70d7e-a00b-4e4e-8cbb-f80f5801da99" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/search/views/group.py" beforeDir="false" afterPath="$PROJECT_DIR$/search/views/group.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/trans2es/mapping/topic-v1.json" beforeDir="false" afterPath="$PROJECT_DIR$/trans2es/mapping/topic-v1.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/trans2es/models/topic.py" beforeDir="false" afterPath="$PROJECT_DIR$/trans2es/models/topic.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -16,11 +14,23 @@ ...@@ -16,11 +14,23 @@
<usages-collector id="statistics.file.extensions.edit"> <usages-collector id="statistics.file.extensions.edit">
<counts> <counts>
<entry key="json" value="4" /> <entry key="json" value="4" />
<entry key="py" value="96" />
</counts> </counts>
</usages-collector> </usages-collector>
<usages-collector id="statistics.file.types.edit"> <usages-collector id="statistics.file.types.edit">
<counts> <counts>
<entry key="JSON" value="4" /> <entry key="JSON" value="4" />
<entry key="Python" value="96" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="py" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="Python" value="1" />
</counts> </counts>
</usages-collector> </usages-collector>
</session> </session>
...@@ -39,8 +49,8 @@ ...@@ -39,8 +49,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/trans2es/type_info.py"> <entry file="file://$PROJECT_DIR$/trans2es/type_info.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="167"> <state relative-caret-position="243">
<caret line="301" column="45" selection-start-line="301" selection-start-column="45" selection-end-line="301" selection-end-column="45" /> <caret line="311" column="44" selection-start-line="311" selection-start-column="44" selection-end-line="311" selection-end-column="44" />
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -54,10 +64,10 @@ ...@@ -54,10 +64,10 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/trans2es/models/topic.py"> <entry file="file://$PROJECT_DIR$/trans2es/models/topic.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-990"> <state relative-caret-position="-3476">
<caret line="2" selection-start-line="2" selection-end-line="2" /> <caret line="2" selection-start-line="2" selection-end-line="2" />
<folding> <folding>
<element signature="e#46#118#0" expanded="true" /> <element signature="e#46#118#0" expanded="true" />
...@@ -81,8 +91,21 @@ ...@@ -81,8 +91,21 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/search/views/topic.py"> <entry file="file://$PROJECT_DIR$/search/views/topic.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="224"> <state relative-caret-position="-110">
<caret line="336" column="40" selection-start-line="336" selection-start-column="40" selection-end-line="336" selection-end-column="40" /> <caret line="331" column="30" lean-forward="true" selection-start-line="331" selection-start-column="30" selection-end-line="331" selection-end-column="30" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/search/views/group.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="430">
<caret line="224" column="22" selection-start-line="224" selection-start-column="22" selection-end-line="224" selection-end-column="22" />
<folding>
<element signature="e#1055#3127#0" />
<element signature="e#3228#6813#0" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -102,7 +125,7 @@ ...@@ -102,7 +125,7 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/trans2es/utils/topic_transfer.py"> <entry file="file://$PROJECT_DIR$/trans2es/utils/topic_transfer.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1150"> <state relative-caret-position="105">
<caret line="15" column="8" selection-start-line="15" selection-start-column="8" selection-end-line="15" selection-end-column="8" /> <caret line="15" column="8" selection-start-line="15" selection-start-column="8" selection-end-line="15" selection-end-column="8" />
</state> </state>
</provider> </provider>
...@@ -127,6 +150,7 @@ ...@@ -127,6 +150,7 @@
<list> <list>
<option value="$PROJECT_DIR$/trans2es/mapping/topic-v1.json" /> <option value="$PROJECT_DIR$/trans2es/mapping/topic-v1.json" />
<option value="$PROJECT_DIR$/trans2es/models/topic.py" /> <option value="$PROJECT_DIR$/trans2es/models/topic.py" />
<option value="$PROJECT_DIR$/search/views/group.py" />
</list> </list>
</option> </option>
</component> </component>
...@@ -148,6 +172,17 @@ ...@@ -148,6 +172,17 @@
<item name="physical" type="b2602c69:ProjectViewProjectNode" /> <item name="physical" type="b2602c69:ProjectViewProjectNode" />
<item name="physical" type="462c0819:PsiDirectoryNode" /> <item name="physical" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path>
<item name="physical" type="b2602c69:ProjectViewProjectNode" />
<item name="physical" type="462c0819:PsiDirectoryNode" />
<item name="search" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="physical" type="b2602c69:ProjectViewProjectNode" />
<item name="physical" type="462c0819:PsiDirectoryNode" />
<item name="search" type="462c0819:PsiDirectoryNode" />
<item name="views" type="462c0819:PsiDirectoryNode" />
</path>
<path> <path>
<item name="physical" type="b2602c69:ProjectViewProjectNode" /> <item name="physical" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" /> <item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
...@@ -196,8 +231,9 @@ ...@@ -196,8 +231,9 @@
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="0" y="23" width="1280" height="724" extended-state="0" /> <frame x="0" y="23" width="1280" height="724" extended-state="0" />
<editor active="true" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2494043" /> <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2494043" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" /> <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="DB Browser" order="2" /> <window_info id="DB Browser" order="2" />
<window_info id="Favorites" order="3" side_tool="true" /> <window_info id="Favorites" order="3" side_tool="true" />
...@@ -210,7 +246,7 @@ ...@@ -210,7 +246,7 @@
<window_info anchor="bottom" id="TODO" order="6" /> <window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" /> <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="DB Execution Console" order="8" /> <window_info anchor="bottom" id="DB Execution Console" order="8" />
<window_info active="true" anchor="bottom" id="Terminal" order="9" sideWeight="0.49960285" visible="true" weight="0.54351395" /> <window_info anchor="bottom" id="Terminal" order="9" sideWeight="0.49960285" visible="true" weight="0.0" />
<window_info anchor="bottom" id="Python Console" order="10" /> <window_info anchor="bottom" id="Python Console" order="10" />
<window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.50039715" side_tool="true" weight="0.03284072" /> <window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.50039715" side_tool="true" weight="0.03284072" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" /> <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
...@@ -251,67 +287,78 @@ ...@@ -251,67 +287,78 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/trans2es/models/user.py"> <entry file="file://$PROJECT_DIR$/search/utils/topic.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="142"> <state relative-caret-position="83">
<caret line="140" column="1" lean-forward="true" selection-start-line="140" selection-start-column="1" selection-end-line="140" selection-end-column="1" /> <caret line="761" lean-forward="true" selection-start-line="761" selection-end-line="761" />
<folding> <folding>
<element signature="e#47#79#0" expanded="true" /> <element signature="e#47#61#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/search/views/topic.py"> <entry file="file://$PROJECT_DIR$/trans2es/mapping/topic.json">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="224"> <state relative-caret-position="765">
<caret line="336" column="40" selection-start-line="336" selection-start-column="40" selection-end-line="336" selection-end-column="40" /> <caret line="51" column="5" lean-forward="true" selection-start-line="51" selection-start-column="5" selection-end-line="51" selection-end-column="5" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/search/utils/topic.py"> <entry file="file://$PROJECT_DIR$/trans2es/mapping/topic-v1.json">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="83"> <state relative-caret-position="427">
<caret line="761" lean-forward="true" selection-start-line="761" selection-end-line="761" /> <caret line="52" lean-forward="true" selection-start-line="52" selection-end-line="52" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/trans2es/models/topic.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-3476">
<caret line="2" selection-start-line="2" selection-end-line="2" />
<folding> <folding>
<element signature="e#47#61#0" expanded="true" /> <element signature="e#46#118#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/trans2es/type_info.py"> <entry file="file://$PROJECT_DIR$/trans2es/type_info.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="167"> <state relative-caret-position="243">
<caret line="301" column="45" selection-start-line="301" selection-start-column="45" selection-end-line="301" selection-end-column="45" /> <caret line="311" column="44" selection-start-line="311" selection-start-column="44" selection-end-line="311" selection-end-column="44" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/trans2es/utils/topic_transfer.py"> <entry file="file://$PROJECT_DIR$/trans2es/utils/topic_transfer.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1150"> <state relative-caret-position="105">
<caret line="15" column="8" selection-start-line="15" selection-start-column="8" selection-end-line="15" selection-end-column="8" /> <caret line="15" column="8" selection-start-line="15" selection-start-column="8" selection-end-line="15" selection-end-column="8" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/trans2es/mapping/topic.json"> <entry file="file://$PROJECT_DIR$/trans2es/models/user.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="765"> <state relative-caret-position="142">
<caret line="51" column="5" lean-forward="true" selection-start-line="51" selection-start-column="5" selection-end-line="51" selection-end-column="5" /> <caret line="140" column="1" lean-forward="true" selection-start-line="140" selection-start-column="1" selection-end-line="140" selection-end-column="1" />
<folding>
<element signature="e#47#79#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/trans2es/mapping/topic-v1.json"> <entry file="file://$PROJECT_DIR$/search/views/topic.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="427"> <state relative-caret-position="-110">
<caret line="52" lean-forward="true" selection-start-line="52" selection-end-line="52" /> <caret line="331" column="30" lean-forward="true" selection-start-line="331" selection-start-column="30" selection-end-line="331" selection-end-column="30" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/trans2es/models/topic.py"> <entry file="file://$PROJECT_DIR$/search/views/group.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-990"> <state relative-caret-position="430">
<caret line="2" selection-start-line="2" selection-end-line="2" /> <caret line="224" column="22" selection-start-line="224" selection-start-column="22" selection-end-line="224" selection-end-column="22" />
<folding> <folding>
<element signature="e#46#118#0" expanded="true" /> <element signature="e#1055#3127#0" />
<element signature="e#3228#6813#0" />
</folding> </folding>
</state> </state>
</provider> </provider>
......
...@@ -165,7 +165,7 @@ def pictorial_topic(topic_id=-1, offset=0, size=10): ...@@ -165,7 +165,7 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
"term": { "term": {
"is_online": True "is_online": True
} }
},{ }, {
"term": { "term": {
"is_deleted": False "is_deleted": False
} }
...@@ -200,3 +200,44 @@ def pictorial_topic(topic_id=-1, offset=0, size=10): ...@@ -200,3 +200,44 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
except: except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc()) logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return {"pictorial_ids_list": []} return {"pictorial_ids_list": []}
@bind("physical/search/pictorial_topic_sort")
def pictorial_topic_sort(pictorial_id=-1, offset=0, size=10):
"""
:remark 小组排序,缺少:前1天发评论人数*x
:param user_id:
:param sort_type:
:param offset:
:param size:
:return:
"""
try:
if not isinstance(pictorial_id, int):
user_id = -1
q = {
"query":{
"term":{
"pictorial_id": pictorial_id}
},
"sort":{
"vote_num":{"order":"desc"}
}
}
pict_pictorial_ids_list =[]
# 获取es链接对象
es_cli_obj = ESPerform.get_cli()
result_dict = ESPerform.get_search_results(es_cli_obj, "topic", q, offset, size)
logging.info("get pictorial_topic_sort res:%s"%result_dict)
for item in result_dict["hits"]:
topic_id = item["_source"]["id"]
pict_pictorial_ids_list.append(topic_id)
return {"pict_pictorial_ids_list":pict_pictorial_ids_list}
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return {"pict_pictorial_ids_list": []}
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