gnes.indexer.doc.leveldb module¶

class gnes.indexer.doc.leveldb.AsyncLVDBIndexer(data_path, keep_na_doc=True, drop_raw_bytes=False, drop_chunk_blob=False, *args, **kwargs)[source]¶

Bases: gnes.indexer.doc.leveldb.LVDBIndexer

add(keys, docs, *args, **kwargs)[source]¶

adding new docs and their protobuf representation

Parameters:
  • keys (List[int]) – list of doc_id
  • docs (List[Document]) – list of protobuf Document objects
close()[source]¶

Release the resources as model is destroyed

post_init()[source]¶

Declare class attributes/members that can not be serialized in standard way

query(*args, **kwargs)[source]¶
Return type:List[Any]
train(*args, **kwargs)¶

Train the model, need to be overrided

class gnes.indexer.doc.leveldb.LVDBIndexer(data_path, keep_na_doc=True, drop_raw_bytes=False, drop_chunk_blob=False, *args, **kwargs)[source]¶

Bases: gnes.indexer.base.BaseDocIndexer

add(keys, docs, *args, **kwargs)[source]¶

adding new docs and their protobuf representation

Parameters:
  • keys (List[int]) – list of doc_id
  • docs (List[Document]) – list of protobuf Document objects
close()[source]¶

Release the resources as model is destroyed

post_init()[source]¶

Declare class attributes/members that can not be serialized in standard way

query(keys, *args, **kwargs)[source]¶
Return type:List[Document]
train(*args, **kwargs)¶

Train the model, need to be overrided