Skip to content
This repository was archived by the owner on Jan 7, 2021. It is now read-only.

Commit 21bd7a4

Browse files
committed
First stab at documention for new keyword arguments for #109 and #107
1 parent 127f9d3 commit 21bd7a4

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

docs/documents.rst

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Retrieval
1616
<Document: Final OIR Report>
1717

1818

19-
.. function:: client.documents.search(keyword)
19+
.. function:: client.documents.search(keyword, page=None, per_page=1000, mentions=3, data=False)
2020

2121
Return a list of documents that match the provided keyword. ::
2222

@@ -26,6 +26,28 @@ Retrieval
2626
>>> obj_list[0]
2727
<Document: Final OIR Report>
2828

29+
DocumentCloud paginates search results. By default the search methods returns
30+
from all pages. If you want to restrict the number of pages that are searched
31+
or retrieve a specific page you should provide some combination of the following
32+
keyword arguments.
33+
34+
>>> obj_list = client.documents.search('Ruben Salazar', page=1, per_page=10)
35+
# You can guess that will do.
36+
>>> len(obj_list) == 10
37+
>>> True
38+
39+
By default, the search returns three mentions of the result in each document.
40+
You can increase that number up to 10 by modifying the keyword argument.
41+
42+
>>> client.documents.search('Ruben Salazar', mentions=10)
43+
44+
Unlike when you get a document directly via id, the key/value dictionaries
45+
they can be assigned are not provided by default in search results.
46+
47+
To have them included, switch the following keyword argument.
48+
49+
>> client.documents.search('Ruben Salazar', data=True)
50+
2951
Editing
3052
-------
3153

0 commit comments

Comments
 (0)