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:
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:
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 sectionsharing_searches
for more details.
Sharing Searches
Searches can be shared with everyone else in the company. Once
shared, those users will see the search in their list of saved searches
and perform searches based on it, although they won’t be able to modify
it. To share a search, you can use the share_with_company
method on
the search object. For example:
Note that you must save a search before sharing it. Attempting to share an unsaved search will raise an exception.
After sharing, the company_shared_permission
attribute of the search
object will be set to SharePermission.READ
. To share all searches, you
can iterate through them:
To unshare a search, use the unshare_with_company
method:
If a shared search includes one or more private watchlists, those watchlists will be automatically shared with the company. However, if you unshare a search that contains a watchlist, the watchlist will not be automatically unshared.
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: