Commit 61a68235 authored by lixiaofang's avatar lixiaofang

add

parent 47b82037
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="7b835479-ee84-40d6-9b97-0e9285d92119" name="Default Changelist" comment="" /> <list default="true" id="7b835479-ee84-40d6-9b97-0e9285d92119" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/index_contrast/tag.py" beforeDir="false" afterPath="$PROJECT_DIR$/index_contrast/tag.py" afterDir="false" />
</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" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
...@@ -25,13 +27,13 @@ ...@@ -25,13 +27,13 @@
<usages-collector id="statistics.file.extensions.edit"> <usages-collector id="statistics.file.extensions.edit">
<counts> <counts>
<entry key="dummy" value="1" /> <entry key="dummy" value="1" />
<entry key="py" value="1367" /> <entry key="py" value="1401" />
</counts> </counts>
</usages-collector> </usages-collector>
<usages-collector id="statistics.file.types.edit"> <usages-collector id="statistics.file.types.edit">
<counts> <counts>
<entry key="PLAIN_TEXT" value="1" /> <entry key="PLAIN_TEXT" value="1" />
<entry key="Python" value="1367" /> <entry key="Python" value="1401" />
</counts> </counts>
</usages-collector> </usages-collector>
<usages-collector id="statistics.lifecycle.project"> <usages-collector id="statistics.lifecycle.project">
...@@ -46,8 +48,11 @@ ...@@ -46,8 +48,11 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/auto_request.py"> <entry file="file://$PROJECT_DIR$/auto_request.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345"> <state relative-caret-position="6315">
<caret line="421" lean-forward="true" selection-start-line="421" selection-end-line="421" /> <caret line="421" lean-forward="true" selection-start-line="421" selection-end-line="421" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -55,7 +60,17 @@ ...@@ -55,7 +60,17 @@
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/index_contrast/tag.py"> <entry file="file://$PROJECT_DIR$/index_contrast/tag.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-105" /> <state relative-caret-position="456">
<caret line="179" column="44" selection-start-line="179" selection-start-column="44" selection-end-line="179" selection-end-column="44" />
<folding>
<element signature="e#46#55#0" expanded="true" />
<element signature="e#6883#8757#0" />
<element signature="e#8854#9452#0" />
<element signature="e#9522#10831#0" />
<element signature="e#10934#13999#0" />
<element signature="e#14107#17208#0" />
</folding>
</state>
</provider> </provider>
</entry> </entry>
</file> </file>
...@@ -77,11 +92,8 @@ ...@@ -77,11 +92,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/reply_comment1.py"> <entry file="file://$PROJECT_DIR$/reply_comment1.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345"> <state relative-caret-position="39">
<caret line="26" lean-forward="true" selection-start-line="26" selection-end-line="26" /> <caret line="5" selection-start-line="5" selection-end-line="5" selection-end-column="26" />
<folding>
<element signature="e#0#16#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -140,6 +152,7 @@ ...@@ -140,6 +152,7 @@
<option value="$PROJECT_DIR$/reply_comment3.py" /> <option value="$PROJECT_DIR$/reply_comment3.py" />
<option value="$PROJECT_DIR$/reply_comment1.py" /> <option value="$PROJECT_DIR$/reply_comment1.py" />
<option value="$PROJECT_DIR$/answer_reply1.py" /> <option value="$PROJECT_DIR$/answer_reply1.py" />
<option value="$PROJECT_DIR$/index_contrast/tag.py" />
</list> </list>
</option> </option>
</component> </component>
...@@ -228,10 +241,11 @@ ...@@ -228,10 +241,11 @@
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="0" y="23" width="1280" height="720" extended-state="6" /> <frame x="0" y="23" width="1280" height="720" extended-state="6" />
<editor active="true" />
<layout> <layout>
<window_info id="Structure" order="0" sideWeight="0.21188119" side_tool="true" weight="0.19112115" /> <window_info id="Structure" order="0" sideWeight="0.21188119" side_tool="true" weight="0.19112115" />
<window_info id="Favorites" order="1" side_tool="true" /> <window_info id="Favorites" order="1" side_tool="true" />
<window_info content_ui="combo" id="Project" order="2" sideWeight="0.7872763" visible="true" weight="0.2605242" /> <window_info content_ui="combo" id="Project" order="2" sideWeight="0.7872763" visible="true" weight="0.1437649" />
<window_info id="DB Browser" order="3" /> <window_info id="DB Browser" order="3" />
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.3284974" /> <window_info anchor="bottom" id="Find" order="1" weight="0.3284974" />
...@@ -296,6 +310,16 @@ ...@@ -296,6 +310,16 @@
<url>file://$PROJECT_DIR$/auto_click_instant.py</url> <url>file://$PROJECT_DIR$/auto_click_instant.py</url>
<option name="timeStamp" value="9" /> <option name="timeStamp" value="9" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/index_contrast/tag.py</url>
<line>170</line>
<option name="timeStamp" value="10" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/index_contrast/tag.py</url>
<line>22</line>
<option name="timeStamp" value="12" />
</line-breakpoint>
</breakpoints> </breakpoints>
<breakpoints-dialog> <breakpoints-dialog>
<breakpoints-dialog /> <breakpoints-dialog />
...@@ -436,13 +460,6 @@ ...@@ -436,13 +460,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/auto_request.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="421" lean-forward="true" selection-start-line="421" selection-end-line="421" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/answer_reply2.py"> <entry file="file://$PROJECT_DIR$/answer_reply2.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="247"> <state relative-caret-position="247">
...@@ -462,16 +479,6 @@ ...@@ -462,16 +479,6 @@
<entry file="file://$PROJECT_DIR$/index_contrast/topic.py"> <entry file="file://$PROJECT_DIR$/index_contrast/topic.py">
<provider selected="true" editor-type-id="text-editor" /> <provider selected="true" editor-type-id="text-editor" />
</entry> </entry>
<entry file="file://$PROJECT_DIR$/reply_comment1.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="26" lean-forward="true" selection-start-line="26" selection-end-line="26" />
<folding>
<element signature="e#0#16#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/reply_comment2.py"> <entry file="file://$PROJECT_DIR$/reply_comment2.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="315"> <state relative-caret-position="315">
...@@ -492,9 +499,36 @@ ...@@ -492,9 +499,36 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/auto_request.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="6315">
<caret line="421" lean-forward="true" selection-start-line="421" selection-end-line="421" />
<folding>
<element signature="e#0#15#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/reply_comment1.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="39">
<caret line="5" selection-start-line="5" selection-end-line="5" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/index_contrast/tag.py"> <entry file="file://$PROJECT_DIR$/index_contrast/tag.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-105" /> <state relative-caret-position="456">
<caret line="179" column="44" selection-start-line="179" selection-start-column="44" selection-end-line="179" selection-end-column="44" />
<folding>
<element signature="e#46#55#0" expanded="true" />
<element signature="e#6883#8757#0" />
<element signature="e#8854#9452#0" />
<element signature="e#9522#10831#0" />
<element signature="e#10934#13999#0" />
<element signature="e#14107#17208#0" />
</folding>
</state>
</provider> </provider>
</entry> </entry>
</component> </component>
......
...@@ -152,10 +152,12 @@ class ESPerform(object): ...@@ -152,10 +152,12 @@ class ESPerform(object):
assert (es_cli is not None) assert (es_cli is not None)
if sub_index_name != "mv-alpha-tag-test-190711901": if sub_index_name != "mv-alpha-tag-test-190711901":
official_index_name = cls.get_official_index_name(sub_index_name, "write") official_index_name = cls.get_official_index_name(sub_index_name, "write")
index_exists = es_cli.indices.exists(official_index_name) index_exists = es_cli.indices.exists(official_index_name)
logging.info("get index_exists:%s" % index_exists)
if not index_exists: if not index_exists:
if not auto_create_index: if not auto_create_index:
logging.error("index:%s is not existing,bulk data error!" % official_index_name) logging.error("index:%s is not existing,bulk data error!" % official_index_name)
...@@ -166,29 +168,15 @@ class ESPerform(object): ...@@ -166,29 +168,15 @@ class ESPerform(object):
bulk_actions = [] bulk_actions = []
if sub_index_name == "topic" or \ for data in data_list:
sub_index_name == "topic-star-routing" or \ if data:
sub_index_name == "topic-high-star": bulk_actions.append({
for data in data_list: '_op_type': 'index',
if data: '_index': official_index_name,
bulk_actions.append({ '_type': doc_type,
'_op_type': 'index', '_id': data['id'],
'_index': official_index_name, '_source': data,
'_type': doc_type, })
'_id': data['id'],
'_source': data,
'routing': data["content_level"]
})
else:
for data in data_list:
if data:
bulk_actions.append({
'_op_type': 'index',
'_index': official_index_name,
'_type': doc_type,
'_id': data['id'],
'_source': data,
})
elasticsearch.helpers.bulk(es_cli, bulk_actions) elasticsearch.helpers.bulk(es_cli, bulk_actions)
return True return True
......
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