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
888092c4
Commit
888092c4
authored
Dec 24, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
高亮
parent
b79f2e6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
auto_tips.py
search/utils/auto_tips.py
+8
-2
No files found.
search/utils/auto_tips.py
View file @
888092c4
...
@@ -203,16 +203,22 @@ def get_suggest_tips(query, lat, lng, offset=0, size=50):
...
@@ -203,16 +203,22 @@ def get_suggest_tips(query, lat, lng, offset=0, size=50):
ret_list
.
extend
(
wordresemble_ret_list
)
ret_list
.
extend
(
wordresemble_ret_list
)
###高亮调整
###高亮调整
query_ret_list
.
extend
(
wordresemble_ret_list
)
query_ret_list
.
extend
(
wordresemble_ret_list
)
high_query
=
None
for
ret
in
query_ret_list
:
for
ret
in
query_ret_list
:
query2
=
ret
[
"ori_name"
]
query2
=
ret
[
"ori_name"
]
for
item
in
range
(
0
,
len
(
query
)):
for
item
in
range
(
0
,
len
(
query
)):
is_find
=
query2
.
find
(
query
[
item
])
is_find
=
query2
.
find
(
query
[
item
])
high_query
=
None
if
is_find
>=
0
:
if
is_find
>=
0
:
highlight_marks
=
u'<ems>
%
s</ems>'
%
query
[
item
]
highlight_marks
=
u'<ems>
%
s</ems>'
%
query
[
item
]
high_query
=
query2
.
replace
(
query
[
item
],
highlight_marks
)
high_query
=
query2
.
replace
(
query
[
item
],
highlight_marks
)
query2
=
high_query
query2
=
high_query
ret
[
"highlight_name"
]
=
high_query
if
high_query
==
None
:
ret
[
"highlight_name"
]
=
query2
else
:
ret
[
"highlight_name"
]
=
high_query
###繁体字删掉,把搜索结果加到简体字上边
###繁体字删掉,把搜索结果加到简体字上边
fanti_query
=
[{
'痩脸针'
:
"瘦脸针"
}]
fanti_query
=
[{
'痩脸针'
:
"瘦脸针"
}]
...
...
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