Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mancheng
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mancheng
Commits
9164fdf3
Commit
9164fdf3
authored
Apr 06, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230406
parent
eefdd4e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletions
+46
-1
apps/view_360company/view.py
+46
-1
No files found.
apps/view_360company/view.py
View file @
9164fdf3
...
...
@@ -256,8 +256,11 @@ def search():
# 公司类型
if
entypeid
:
args_term
[
'entypeid'
]
=
entypeid
if
args_query
[
"company_name"
]
==
"公司"
:
body
=
create_body
(
page
,
per_page
,
args_query
,
args_term
)
else
:
body
=
create_body1
(
page
,
per_page
,
args_query
,
args_term
)
body
=
create_body
(
page
,
per_page
,
args_query
,
args_term
)
if
not
company
:
del
body
[
"query"
][
"bool"
][
"must"
][
0
]
...
...
@@ -374,6 +377,48 @@ def create_body(page, page_size, args_query, args_term):
# print(body)
return
body
def
create_body1
(
page
,
page_size
,
args_query
,
args_term
):
body
=
{
"query"
:
{
"bool"
:
{
"must"
:
[
{
"match"
:
{
"company_name"
:
"{}"
.
format
(
args_query
[
"company_name"
]),
}
},
]
}
},
"from"
:
page
,
"size"
:
page_size
,
# "sort": [{"host": {"order": "desc"}}],
# "sort": [],
"aggs"
:
{},
"_source"
:
[
"mysql_id"
,
'province'
,
'company_name'
,
'city'
,
'district'
,
'build_date'
,
'legal'
,
'capital'
,
'entype'
,
'address'
,
'telephone'
,
"high_new"
,
"tbe"
,
"fianacing"
,
"quoted_company"
,
"foreign_investment"
,
"patent"
,
"dengl"
,
"unicorn"
,
"isfive"
],
"highlight"
:
{
"fields"
:
{
"company_name"
:
{},
"entype"
:
{},
},
"pre_tags"
:
"<font color='red'>"
,
"post_tags"
:
"</font>"
,
"fragment_size"
:
10
}
}
for
k
,
v
in
args_term
.
items
():
body
[
"query"
][
"bool"
][
"must"
]
.
append
({
"match"
:
{
"{}"
.
format
(
k
):
"{}"
.
format
(
v
)}})
# print(body)
return
body
# 原始
# def create_body(page, page_size, args_query, args_term):
# body = {
...
...
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