(self, sketch_id=None, indices=None, timeline_ids=None)
Initialize the aggregator object.

        Args:
            field: String that contains the field name used for URL generation.
            sketch_id: Sketch ID.
            indices: Optional list of OpenSearch index names. If not provided
                the default behavior is to include all the indices in a sketch.
            timeline_ids: Optional list of timeline IDs, if not provided the
                default behavior is to query all the data in the provided
                search indices.
Initialize the aggregator object.
Initialize the aggregator object .
def __init__(self, sketch_id=None, indices=None, timeline_ids=None):
        """Initialize the aggregator object.

        Args:
            field: String that contains the field name used for URL generation.
            sketch_id: Sketch ID.
            indices: Optional list of OpenSearch index names. If not provided
                the default behavior is to include all the indices in a sketch.
            timeline_ids: Optional list of timeline IDs, if not provided the
                default behavior is to query all the data in the provided
                search indices.
        """
        if not sketch_id and not indices:
            raise RuntimeError('Need at least sketch_id or index')

        self.opensearch = OpenSearchDataStore(
            host=current_app.config.get('OPENSEARCH_HOST'),
            port=current_app.config.get('OPENSEARCH_PORT')
        )

        self._sketch_url = '/sketch/{0:d}/explore'.format(sketch_id)
        self.field = ''
        self.indices = indices
        self.sketch = SQLSketch.query.get(sketch_id)
        self.timeline_ids = None

        active_timelines = self.sketch.active_timelines
        if not self.indices:
            self.indices = [t.searchindex.index_name for t in active_timelines]

        if timeline_ids:
            valid_ids = [t.id for t in active_timelines]
            self.timeline_ids = [t for t in timeline_ids if t in valid_ids]
def __init__ ( self , sketch_id = None , indices = None , timeline_ids = None ) : if not sketch_id and not indices : raise RuntimeError ( 'Need at least sketch_id or index' ) self . opensearch = OpenSearchDataStore ( host = current_app . config . get ( 'OPENSEARCH_HOST' ) , port = current_app . config . get ( 'OPENSEARCH_PORT' ) ) self . _sketch_url = '/sketch/{0:d}/explore' . format ( sketch_id ) self . field = '' self . indices = indices self . sketch = SQLSketch . query . get ( sketch_id ) self . timeline_ids = None active_timelines = self . sketch . active_timelines if not self . indices : self . indices = [ t . searchindex . index_name for t in active_timelines ] if timeline_ids : valid_ids = [ t . id for t in active_timelines ] self . timeline_ids = [ t for t in timeline_ids if t in valid_ids ]