gransk.plugins.storage¶
Store stuff places.
gransk.plugins.storage.copy_file¶
gransk.plugins.storage.copy_picture¶
gransk.plugins.storage.es_index¶
-
class
gransk.plugins.storage.es_index.Subscriber(pipeline)¶ Bases:
gransk.core.abstract_subscriber.SubscriberClass for adding documents to an Elasticsearch cluster.
Add subscriber to pipeline.
Parameters: pipeline ( gransk.core.pipeline.Pipeline) – Pipeline managing subscribers and events.-
consume(doc, _)¶ Add document to Elasticsearch.
Parameters: doc ( gransk.core.document.Document) – Document object.
-
create_mapping()¶ Create index mappig in Elasticsearch cluster.
-
setup(config)¶ Establish connection to Elasticsearch cluster and start periodic commit.
Parameters: config ( dict) – Configuration object.
-
stop()¶ Commit current remaning documents.
-