Search
InsightMaker.search(query, dataset=None, fields=None, size=100, raw=False)
Parameters:
query
String, dict or insight_maker.api. query_builders. SubQuery
dataset
string, Dataset or list
Optional - Dataset object, dataset name string, or list of either
fields
list
Optional – List of field ids of Field objects
size
integer
Number of results to return (default 100)
raw
boolean
Default False, if true, returns the raw REST JSON response as a python dictionary.
Response:
A DataSample object, properties:
DataSample.df A pandas DataFrame object containing all results
DataSample.scroll_id The scroll ID required for a scroll search
Example:
Below is an example of a simple string query, these use Lucene Syntax or more simply, they behave in same way as the search box in the enterprise search app. An asterisk will return all documents.
Alternatively, a python dictionary can be used to store an Elastic Query DSL JSON query. This is the most complex, but also most flexible way to query InsightMaker. For example: