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
755900a3
Commit
755900a3
authored
Dec 27, 2018
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
17e344ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
3 deletions
+35
-3
tag.py
search/views/tag.py
+15
-1
tag.json
trans2es/mapping/tag.json
+13
-1
tag_transfer.py
trans2es/utils/tag_transfer.py
+7
-1
No files found.
search/views/tag.py
View file @
755900a3
...
...
@@ -48,7 +48,21 @@ def query_tag(query,offset,size):
"include"
:
[
"id"
,
"name"
]
}
}
q
[
"highlight"
]
=
get_highlight
([
"name"
])
q
[
"highlight"
]
=
get_highlight
([
"name"
])
"""
q = {
"suggest":{
"tips-suggest":{
"prefix":query,
"completion":{
"field":"suggest"
}
}
},
}
"""
ret_list
=
list
()
...
...
trans2es/mapping/tag.json
View file @
755900a3
...
...
@@ -2,7 +2,19 @@
"dynamic"
:
"strict"
,
"properties"
:
{
"id"
:{
"type"
:
"long"
},
"suggest"
:{
"type"
:
"completion"
},
"suggest"
:{
"type"
:
"completion"
,
"contexts"
:[
{
"name"
:
"is_online"
,
"type"
:
"category"
},
{
"name"
:
"is_deleted"
,
"type"
:
"category"
}
]
},
"name"
:{
"type"
:
"text"
,
"analyzer"
:
"gm_default_index"
,
"search_analyzer"
:
"gm_default_index"
},
"tag_type"
:{
"type"
:
"long"
},
"is_online"
:{
"type"
:
"boolean"
},
//上线
...
...
trans2es/utils/tag_transfer.py
View file @
755900a3
...
...
@@ -27,7 +27,13 @@ class TagTransfer(object):
if
name_term
:
tag_name_terms_list
.
append
(
name_term
)
res
[
"suggest"
]
=
tag_name_terms_list
res
[
"suggest"
]
=
{
"input"
:
tag_name_terms_list
,
"contexts"
:{
"is_online"
:
instance
.
is_online
,
"is_deleted"
:
instance
.
is_deleted
}
}
res
[
"name"
]
=
instance
.
name
res
[
"is_online"
]
=
instance
.
is_online
res
[
"is_deleted"
]
=
instance
.
is_deleted
...
...
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