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
4e7b2961
Commit
4e7b2961
authored
Dec 07, 2018
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
9f1ee29c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
14 deletions
+10
-14
es.py
libs/es.py
+3
-7
settings.py
physical/settings.py
+1
-1
user.py
search/views/user.py
+1
-1
user.json
trans2es/mapping/user.json
+1
-1
celebrity.py
trans2es/models/celebrity.py
+1
-1
tag.py
trans2es/models/tag.py
+1
-1
user.py
trans2es/models/user.py
+2
-2
No files found.
libs/es.py
View file @
4e7b2961
...
...
@@ -9,17 +9,13 @@ import re
import
json
from
elasticsearch
import
Elasticsearch
import
elasticsearch.helpers
from
django.conf
import
settings
class
ESPerform
(
object
):
cli_obj
=
None
cli_info_list
=
[
{
"host"
:
"10.29.130.141"
,
"port"
:
9200
}
]
index_prefix
=
"gm-dbmw"
cli_info_list
=
settings
.
ES_INFO_LIST
index_prefix
=
settings
.
ES_INDEX_PREFIX
@classmethod
...
...
physical/settings.py
View file @
4e7b2961
...
...
@@ -30,7 +30,7 @@ ALLOWED_HOSTS = []
# Application definition
BROKER_URL
=
"redis://127.0.0.1:6379/
0
"
BROKER_URL
=
"redis://127.0.0.1:6379/
2
"
CELERY_TIMEZONE
=
'Asia/Shanghai'
CELERY_ROUTES
=
[
'physical.celery_task_router.CeleryTaskRouter'
]
...
...
search/views/user.py
View file @
4e7b2961
...
...
@@ -29,7 +29,7 @@ def recommend_user(self_user_id,interesting_user_id,offset=0,size=10):
#去除自身及感兴趣的用户ID
self_attention_user_id_list
.
append
(
self_user_id
)
self_attention_user_id_list
.
append
(
interesting_user_id
)
recommend_user_list
=
UserUtils
.
get_recommend_user_list
(
self_attention_user_id_list
,
recursion_attention_user_id_list
,
offset
,
size
)
return
recommend_user_list
...
...
trans2es/mapping/user.json
View file @
4e7b2961
...
...
@@ -8,7 +8,7 @@
"gender"
:{
"type"
:
"integer"
},
"is_online"
:{
"type"
:
"boolean"
},
//是否上线
"tag_list"
:{
"type"
:
"long"
},
//标签属性
"city_id"
:{
"type"
:
"
long
"
},
"city_id"
:{
"type"
:
"
text
"
},
"country_id"
:{
"type"
:
"long"
},
"is_recommend"
:{
"type"
:
"boolean"
},
//是否运营推荐用户
"is_shadow"
:{
"type"
:
"boolean"
},
//是否马甲用户
...
...
trans2es/models/celebrity.py
View file @
4e7b2961
...
...
@@ -20,7 +20,7 @@ class Celebrity(models.Model):
name
=
models
.
CharField
(
verbose_name
=
u'名称'
,
max_length
=
300
,
default
=
''
)
portrait
=
models
.
CharField
(
verbose_name
=
u'肖像'
,
max_length
=
100
,
default
=
''
)
gender
=
models
.
SmallIntegerField
(
verbose_name
=
u'性别'
)
city_id
=
models
.
Intege
rField
(
verbose_name
=
u'城市id'
)
city_id
=
models
.
Cha
rField
(
verbose_name
=
u'城市id'
)
desc
=
models
.
IntegerField
(
verbose_name
=
''
)
is_online
=
models
.
BooleanField
(
verbose_name
=
"是否上线"
)
create_time
=
models
.
DateTimeField
(
verbose_name
=
u'创建时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
...
...
trans2es/models/tag.py
View file @
4e7b2961
...
...
@@ -29,7 +29,7 @@ class AccountUserTag(models.Model):
id
=
models
.
IntegerField
(
primary_key
=
True
,
verbose_name
=
u"主键ID"
)
tag_id
=
models
.
IntegerField
(
verbose_name
=
u"标签ID"
)
user
_id
=
models
.
IntegerField
(
verbose_name
=
u"用户ID"
)
user
=
models
.
IntegerField
(
verbose_name
=
u"用户ID"
)
is_deleted
=
models
.
BooleanField
(
verbose_name
=
u"是否删除"
)
create_time
=
models
.
DateTimeField
(
verbose_name
=
u'创建时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
update_time
=
models
.
DateTimeField
(
verbose_name
=
u'更新时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
...
...
trans2es/models/user.py
View file @
4e7b2961
...
...
@@ -27,7 +27,7 @@ class User(models.Model):
nick_name
=
models
.
CharField
(
verbose_name
=
u'昵称'
,
max_length
=
255
,
default
=
''
)
profile_pic
=
models
.
CharField
(
verbose_name
=
u'头像'
,
max_length
=
300
)
gender
=
models
.
SmallIntegerField
(
verbose_name
=
u'性别'
)
city_id
=
models
.
Intege
rField
(
verbose_name
=
u'城市id'
)
city_id
=
models
.
Cha
rField
(
verbose_name
=
u'城市id'
)
country_id
=
models
.
IntegerField
(
verbose_name
=
'国家id'
)
is_online
=
models
.
BooleanField
(
verbose_name
=
"是否上线"
)
create_time
=
models
.
DateTimeField
(
verbose_name
=
u'创建时间'
,
default
=
datetime
.
datetime
.
fromtimestamp
(
0
))
...
...
@@ -140,7 +140,7 @@ class User(models.Model):
try
:
user_tag_id_list
=
list
()
query_results
=
AccountUserTag
.
objects
.
filter
(
user
_id
=
self
.
user_id
)
query_results
=
AccountUserTag
.
objects
.
filter
(
user
=
self
.
user_id
)
for
item
in
query_results
:
user_tag_id_list
.
append
(
item
.
tag_id
)
...
...
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