Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
search_tips
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
rank
search_tips
Commits
aaf451d9
Commit
aaf451d9
authored
Jun 28, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改返回类型
parent
c2f1481a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
words_utils.py
associate/commons/words_utils.py
+2
-1
auto_tips.py
associate/search/utils/auto_tips.py
+5
-5
agile_tag_transfer.py
associate/utils/agile_tag_transfer.py
+1
-1
No files found.
associate/commons/words_utils.py
View file @
aaf451d9
...
...
@@ -99,8 +99,9 @@ class QueryWordAttr(object):
try
:
key
=
cls
.
tips_num_redis_key_prefix
+
str
(
id
)
results_num
=
redis_client
.
get
(
key
)
# results_num = json.loads(str(redis_data, encoding="utf-8")) if redis_data else {}
logging
.
info
(
"get results_num:
%
s"
%
results_num
)
if
results_num
==
None
:
return
0
return
int
(
results_num
)
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
associate/search/utils/auto_tips.py
View file @
aaf451d9
...
...
@@ -37,7 +37,7 @@ def get_suggest_tips(query, agile_tag_type):
agile_type_id
=
set
()
logging
.
info
(
"get agile_tag_type:
%
s"
%
agile_tag_type
)
if
agile_tag_type
>
0
:
if
int
(
agile_tag_type
)
>
0
:
q
=
{
"query"
:
{
"term"
:
{
...
...
@@ -70,8 +70,8 @@ def get_suggest_tips(query, agile_tag_type):
highlight_name
=
hit_item
[
"_source"
][
"highlight_name"
]
ret_list
.
append
(
[
{
"agile_tag_id"
:
agile_tag_id
,
"ori_name"
:
ori_name
,
"results_num"
:
results_num
,
"highlight"
:
highlight_name
}]
)
{
"agile_tag_id"
:
agile_tag_id
,
"ori_name"
:
ori_name
,
"results_num"
:
results_num
,
"highlight"
:
highlight_name
}
)
else
:
for
tips_item
in
result_dict
[
"suggest"
][
"tips-suggest"
]:
...
...
@@ -87,8 +87,8 @@ def get_suggest_tips(query, agile_tag_type):
highlight_name
=
hit_item
[
"_source"
][
"highlight_name"
]
ret_list
.
append
(
[
{
"agile_tag_id"
:
agile_tag_id
,
"ori_name"
:
ori_name
,
"results_num"
:
results_num
,
"highlight"
:
highlight_name
}]
)
{
"agile_tag_id"
:
agile_tag_id
,
"ori_name"
:
ori_name
,
"results_num"
:
results_num
,
"highlight"
:
highlight_name
}
)
return
ret_list
except
:
...
...
associate/utils/agile_tag_transfer.py
View file @
aaf451d9
...
...
@@ -98,7 +98,7 @@ class TagTransfer(object):
name
=
agile_tag
.
AgileTag
.
objects
.
filter
(
id
=
instance
.
agile_tag_id
)
.
values_list
(
"name"
,
flat
=
True
)
.
first
()
tractate_results
=
TagTransfer
.
get_tractate_data_name_mapping_results_to_redis
(
name
)
if
tractate_results
==
None
:
tractate_results
=
0
tractate_results
=
0
logging
.
info
(
"get tractate_results:
%
s"
%
tractate_results
)
key
=
query_key
+
str
(
instance
.
agile_tag_id
)
redis_client
.
set
(
key
,
tractate_results
)
...
...
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