Manage your Searches¶
Below, you can check how to persist, manage and share the searches you create in Bigdata.
Save a Search¶
You have the option to store and manipulate your searches over time. To save your search:
s = bigdata.search.new(query=(Entity("228D42") | Keyword("tesla")))
s.save("My search")
Retrieve Searches¶
Subsequently, you can get the search by its ID or obtain a list of all
your saved searches. These methods return instances of the same type,
Search
, and a list of searches, respectively. You
can use them directly to perform searches or retrieve co-mentions. For example:
searches = bigdata.search.list()
s = searches[0]
# or
s = bigdata.search.get("<the_search_id>")
for result in s.limit_documents(10):
print(result)
The Search
object has the following attributes:
id
: The unique identifier of the search, a 32-character hexadecimal string. This is only set if the search has been saved.name
: The name of the search. This is only set if the search has been saved.query
: The query object that represents the search criteria. You will typically never access this attribute directly.company_shared_permission
:SharePermission
value that represents the share status of this saved search within the company. The only valid values areSharePermission.READ
, if the search is currently shared with the company, orNone
if it’s not shared or the search has not even been saved. See the section Sharing Searches for more details.
Delete Searches¶
Finally, you can delete the search either by calling the delete
method on
the search object if you have it, or by calling the delete
method on the
bigdata.search
object with the search ID as an argument if you
don’t have the search object. For example:
s.delete()
# or if you don't have the search object but know the ID:
bigdata.search.delete("<the_search_id>")