Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
physical
Commits
a3f06082
Commit
a3f06082
authored
Jan 21, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add contrast_similar
parent
c6f2ca06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
type_info.py
trans2es/type_info.py
+5
-5
No files found.
trans2es/type_info.py
View file @
a3f06082
...
...
@@ -12,7 +12,7 @@ import elasticsearch
import
elasticsearch.helpers
import
sys
from
trans2es.models
import
topic
,
user
,
pick_celebrity
,
group
,
celebrity
,
tag
,
contrast_similar
from
trans2es.models
import
topic
,
user
,
pick_celebrity
,
group
,
celebrity
,
tag
,
contrast_similar
from
trans2es.utils.user_transfer
import
UserTransfer
from
trans2es.utils.pick_celebrity_transfer
import
PickCelebrityTransfer
from
trans2es.utils.group_transfer
import
GroupTransfer
...
...
@@ -161,7 +161,7 @@ class TypeInfo(object):
# traceback.print_exc()
# es_result = 'error'
return
ESPerform
.
es_helpers_bulk
(
es
,
data_list
,
sub_index_name
,
True
)
return
ESPerform
.
es_helpers_bulk
(
es
,
data_list
,
sub_index_name
,
True
)
def
elasticsearch_bulk_insert
(
self
,
sub_index_name
,
instance_iterable
,
es
=
None
):
data_list
=
self
.
bulk_get_data
(
instance_iterable
)
...
...
@@ -245,11 +245,11 @@ def get_type_info_map():
round_insert_period
=
2
,
),
TypeInfo
(
name
=
"user"
,
#
用户
name
=
"user"
,
#
用户
type
=
"user"
,
model
=
user
.
User
,
#query_deferred=lambda:user.User.objects.all().query,
#query_deferred=lambda: user.User.objects.prefetch_related('myuserfollow').query,
#
query_deferred=lambda:user.User.objects.all().query,
#
query_deferred=lambda: user.User.objects.prefetch_related('myuserfollow').query,
query_deferred
=
lambda
:
user
.
User
.
objects
.
all
()
.
query
,
get_data_func
=
UserTransfer
.
get_user_data
,
bulk_insert_chunk_size
=
100
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment