Ejemplo n.º 1
0
class VisualizationElasticsearchDAO(VisualizationSearchDAO):
    """ class for manage access to datasets' elasticsearch documents """

    def __init__(self, visualization_revision):
        self.visualization_revision = visualization_revision
        self.search_index = ElasticsearchIndex()

    def add(self):
        return self.search_index.indexit(self._build_document())

    def remove(self):
        self.search_index.delete_documents([{"type": self._get_type(), "docid": self._get_id()}])
Ejemplo n.º 2
0
class VisualizationElasticsearchDAO(VisualizationSearchDAO):
    """ class for manage access to datasets' elasticsearch documents """

    def __init__(self, visualization_revision):
        self.visualization_revision=visualization_revision
        self.search_index = ElasticsearchIndex()
        
    def add(self):
        return self.search_index.indexit(self._build_document())
        
    def remove(self):
        self.search_index.delete_documents([{"type": self._get_type(), "docid": self._get_id()}])
Ejemplo n.º 3
0
class DatasetElasticsearchDAO(DatasetSearchIndexDAO):
    """ class for manage access to datasets' ElasticSearch documents """

    def __init__(self, dataset_revision):
        self.logger = logging.getLogger(__name__)
        self.dataset_revision=dataset_revision
        self.search_index = ElasticsearchIndex()
        
    def add(self):
        return self.search_index.indexit(self._build_document())
        
    def remove(self):
        self.search_index.delete_documents([{"type": self._get_type(), "docid": self._get_id()}])
Ejemplo n.º 4
0
class DatastreamElasticsearchDAO(DatastreamSearchDAO):
    """ class for manage access to datastreams elasticsearch documents """

    def __init__(self, datastream_revision):
        self.datastream_revision=datastream_revision
        self.search_index = ElasticsearchIndex()
        
    def add(self):
        output=self.search_index.indexit(self._build_document())

        return (self.datastream_revision.id, self.datastream_revision.datastream.id, output)
        
    def remove(self):
        return self.search_index.delete_documents([{"type": self._get_type(), "docid": self._get_id()}])
Ejemplo n.º 5
0
class DatasetElasticsearchDAO(DatasetSearchIndexDAO):
    """ class for manage access to datasets' ElasticSearch documents """
    def __init__(self, dataset_revision):
        self.logger = logging.getLogger(__name__)
        self.dataset_revision = dataset_revision
        self.search_index = ElasticsearchIndex()

    def add(self):
        return self.search_index.indexit(self._build_document())

    def remove(self):
        self.search_index.delete_documents([{
            "type": self._get_type(),
            "docid": self._get_id()
        }])
Ejemplo n.º 6
0
class DatastreamElasticsearchDAO(DatastreamSearchDAO):
    """ class for manage access to datastreams elasticsearch documents """
    def __init__(self, revision):
        self.revision = revision
        self.search_index = ElasticsearchIndex()

    def add(self):
        output = self.search_index.indexit(self._build_document())

        return (self.revision.id, self.revision.datastream.id, output)

    def remove(self):
        return self.search_index.delete_documents([{
            "type": self._get_type(),
            "docid": self._get_id()
        }])