Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
S
scripts
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kospan Ulan
scripts
Commits
e8871bc3
Commit
e8871bc3
authored
Oct 13, 2020
by
Kospan Ulan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
script for Darkhan
parent
8afacb30
Pipeline
#3055
canceled with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
app.py
app.py
+24
-0
No files found.
app.py
0 → 100644
View file @
e8871bc3
import
csv
import
pysolr
solr
=
pysolr
.
Solr
(
'http://10.30.10.204:8984/solr/client2020_3/'
,
timeout
=
10
)
r
=
solr
.
search
(
"*:*"
,
**
{
'fq'
:
[
"topic_id:6abbdb3f-a383-45c1-8000-2fe2c4beded5"
,
"-media_type:social"
,
"status:active"
,
"-verification_status:(nonrelevant OR duplicate OR old OR deleted)"
,
"date: [2020-05-01T00:00:00Z TO 2020-06-01T00:00:00Z]"
],
'facet'
:
"on"
,
'facet.field'
:
"domain"
,
'facet.limit'
:
-
1
})
domains
=
sorted
(
filter
(
lambda
x
:
x
[
1
]
!=
0
,
zip
(
r
.
facets
[
'facet_fields'
][
'domain'
][::
2
],
r
.
facets
[
'facet_fields'
][
'domain'
][
1
::
2
])),
key
=
lambda
x
:
-
x
[
1
])
f
=
open
(
'/home/user/PycharmProjects/reports-by-analyst-request/out5.csv'
,
'w'
)
wtr
=
csv
.
writer
(
f
,
delimiter
=
','
,
lineterminator
=
'
\n
'
)
wtr
.
writerows
(
domains
)
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