Commit fd3d5bbc authored by sim's avatar sim

Notebook: scan_gargantext(..., documents=True) to get docs themselves

parent 7b63d279
......@@ -69,10 +69,13 @@ def _search_docs(corpus_id, request, fast=False):
q.filter(H('title', request) | H('abstract', request))
def scan_gargantext(corpus_id, request, fast=False):
return (_search_docs(corpus_id, request, fast)
.with_entities(func.count(DocumentNode.id.distinct()))
.one())[0]
def scan_gargantext(corpus_id, request, fast=False, documents=False):
query = _search_docs(corpus_id, request, fast)
if documents:
return query.all()
return query.with_entities(func.count(DocumentNode.id.distinct())).one()[0]
def scan_gargantext_and_delete(corpus_id, request, fast=False):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment