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
295ba4fe
Commit
295ba4fe
authored
Jan 31, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
3431759e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
auto_tips.py
search/utils/auto_tips.py
+7
-1
suggest.json
trans2es/mapping/suggest.json
+7
-1
type_info.py
trans2es/type_info.py
+4
-1
No files found.
search/utils/auto_tips.py
View file @
295ba4fe
...
...
@@ -22,7 +22,13 @@ def get_suggest_tips(query,lat,lng,offset=0,size=50):
"prefix"
:
query
,
"completion"
:
{
"field"
:
"suggest"
,
"size"
:
size
"size"
:
size
,
"contexts"
:{
"is_online"
:[
True
]
},
"fuzzy"
:{
"fuzziness"
:
0
}
}
}
},
...
...
trans2es/mapping/suggest.json
View file @
295ba4fe
...
...
@@ -3,7 +3,13 @@
"properties"
:
{
"id"
:{
"type"
:
"text"
},
"suggest"
:{
"type"
:
"completion"
"type"
:
"completion"
,
"contexts"
:[
{
"name"
:
"is_online"
,
"type"
:
"category"
}
]
},
"suggest_type"
:{
"type"
:
"long"
},
//
0
-汉字
,
1
-汉字全拼
,
2
-拼音
,
3
-拼音全拼
,
4
-拼音简写
,
5
-拼音简写全拼
"tips_name_type"
:{
"type"
:
"long"
},
//tips数据所属类型
,
0
-tag
,
1
-hospital
,
2
-doctor
,
3
-wiki
...
...
trans2es/type_info.py
View file @
295ba4fe
...
...
@@ -145,7 +145,10 @@ class TypeInfo(object):
suggest_dict
[
"id"
]
=
str
(
suggest_dict
[
"id"
])
+
"_"
+
str
(
suggest_item
[
"cur_index"
])
suggest_dict
[
"suggest"
]
=
{
"input"
:
suggest_item
[
"input"
],
"weight"
:
int
(
suggest_dict
[
"offline_score"
])
"weight"
:
int
(
suggest_dict
[
"offline_score"
]),
"contexts"
:{
"is_online"
:
suggest_dict
[
"is_online"
]
}
}
data_list
.
append
(
suggest_dict
)
for
resemble_item
in
resemble_list
:
...
...
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