Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
c1dd6387
Commit
c1dd6387
authored
Sep 18, 2017
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
[FIX CONFLICT] using Simons' patch.
parents
cd34bf80
aaf6c682
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
gargantext_notebook.py
install/notebook/gargantext_notebook.py
+14
-10
No files found.
install/notebook/gargantext_notebook.py
View file @
c1dd6387
...
...
@@ -16,7 +16,7 @@ django.setup()
from
gargantext.constants
import
QUERY_SIZE_N_MAX
,
get_resource
,
get_resource_by_name
from
gargantext.models
import
Node
,
ProjectNode
,
DocumentNode
from
gargantext.util.db
import
session
,
get_engine
from
gargantext.util.db
import
session
,
get_engine
,
func
from
collections
import
Counter
import
importlib
from
django.http
import
Http404
...
...
@@ -53,21 +53,25 @@ def scan_hal(request):
return
hal
.
scan_results
(
request
)
def
scan_gargantext
(
corpus_id
,
request
):
def
_search_docs
(
corpus_id
,
request
):
return
(
session
.
query
(
DocumentNode
)
.
filter
(
DocumentNode
.
parent_id
==
corpus_id
)
.
filter
(
DocumentNode
.
title_abstract
.
match
(
request
))
.
count
())
.
filter_by
(
parent_id
=
corpus_id
)
.
filter
(
Node
.
title_abstract
.
match
(
request
)))
def
scan_gargantext
(
corpus_id
,
request
):
return
(
_search_docs
(
corpus_id
,
request
)
.
with_entities
(
func
.
count
(
DocumentNode
.
id
.
distinct
()))
.
one
())[
0
]
def
scan_gargantext_and_delete
(
corpus_id
,
request
):
(
session
.
query
(
DocumentNode
)
.
filter
(
DocumentNode
.
parent_id
=
corpus_id
)
.
filter
(
DocumentNode
.
title_abstract
.
match
(
request
))
.
delete
(
synchronize_session
=
'fetch'
)
)
r
=
_search_docs
(
corpus_id
,
request
)
.
delete
(
synchronize_session
=
'fetch'
)
session
.
commit
()
return
r
def
myProject_fromUrl
(
url
):
"""
myProject :: String -> Project
...
...
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