capreolus.index

Submodules

Package Contents

Classes

Index

Base class for Index modules. The purpose of an Index module is to represent an inverted index that can be queried with a Searcher module and used to obtain documents and collection statistics.

Attributes

logger

capreolus.index.logger[source]
class capreolus.index.Index(config=None, provide=None, share_dependency_objects=False, build=True)[source]

Bases: capreolus.ModuleBase

Base class for Index modules. The purpose of an Index module is to represent an inverted index that can be queried with a Searcher module and used to obtain documents and collection statistics.

Modules should provide:
  • a _create_index method that creates an index on the Collection dependency

  • a get_doc(docid) and a get_docs(docid) method

  • a get_df(term) method

module_type = 'index'[source]
dependencies[source]
get_index_path()[source]
exists()[source]
create_index()[source]
abstract get_doc(doc_id)[source]
abstract get_docs(doc_ids)[source]