graviti.manager.search
#
The implementation of the SearchHistory and SearchManager.
Module Contents#
Classes#
This class defines the structure of the search history of Graviti Data Platform. |
|
This class defines the operations on the searches on Graviti. |
- class graviti.manager.search.SearchHistory(dataset, response)[source]#
Bases:
graviti.utility.ReprMixin
This class defines the structure of the search history of Graviti Data Platform.
- Parameters
dataset (graviti.manager.dataset.Dataset) – Class
Dataset
instance.response (Dict[str, Any]) –
The response of the OpenAPI associated with the search history:
{ "id": <str> "commit_id": <str>, "draft_number": <int>, "sheet": <str>, "criteria": <dict>, "record_count": <int>, "creator": <str>, "created_at": <str>, },
- search_id#
The id of this search history.
- commit#
The commit of this search history.
- draft_number#
The draft number of this search history.
- sheet#
The sheet name of this search history.
- criteria#
The criteria of this search history.
- creator#
The creator of this search history.
- created_at#
The create time of this search history.
- record_count(self)[source]#
Get the record count of the search.
- Returns
The record count of the search.
- Return type
int
- class graviti.manager.search.SearchManager(dataset)[source]#
This class defines the operations on the searches on Graviti.
- Parameters
access_key – User’s access key.
url – The URL of the graviti website.
dataset (graviti.manager.dataset.Dataset) –
- get(self, search_id)[source]#
Get a Graviti search history with given search id.
- Parameters
search_id (str) – The id of the search history.
- Returns
The requested
SearchManager
instance.- Return type
- list(self, *, commit_id=None, draft_number=None, sheet=None, sort=None)[source]#
List Graviti search histories.
- Parameters
commit_id (Optional[str]) – The commit id.
draft_number (Optional[int]) – The draft number.
sheet (Optional[str]) – The name of the sheet.
sort (graviti.utility.SortParam) – The column and the direction the list result sorted by.
- Returns
The LazyPagingList of
SearchHistory
instances.- Return type