The forward_index stores information on a corpus by doc_ids.
More...
#include <forward_index.h>
|
void | load_index () |
| This function loads a disk index from its filesystem representation.
|
|
void | create_index (const std::string &config_file) |
| This function initializes the forward index. More...
|
|
bool | valid () const |
|
|
template<class Index , class... Args> |
std::shared_ptr< Index > | make_index (const std::string &config_file, Args &&...args) |
| forward_index is a friend of the factory method used to create it. More...
|
|
template<class Index , template< class, class > class Cache, class... Args> |
std::shared_ptr< cached_index< Index, Cache > > | make_index (const std::string &config_file, Args &&...args) |
| forward_index is a friend of the factory method used to create cached versions of it. More...
|
|
The forward_index stores information on a corpus by doc_ids.
Each doc_id key is associated with a distribution of term_ids or term "counts" that occur in that particular document.
meta::index::forward_index::forward_index |
( |
const cpptoml::table & |
config | ) |
|
|
protected |
- Parameters
-
config | The table that specifies how to create the index. |
auto meta::index::forward_index::search_primary |
( |
doc_id |
d_id | ) |
const |
|
virtual |
- Parameters
-
d_id | The doc_id to search for |
- Returns
- the postings data for a given doc_id
std::string meta::index::forward_index::liblinear_data |
( |
doc_id |
d_id | ) |
const |
- Parameters
-
d_id | The document id of the doc to convert to liblinear format |
- Returns
- the string representation liblinear format
uint64_t meta::index::forward_index::unique_terms |
( |
| ) |
const |
|
overridevirtual |
void meta::index::forward_index::create_index |
( |
const std::string & |
config_file | ) |
|
|
private |
This function initializes the forward index.
- Parameters
-
config_file | The configuration file used to create the index |
bool meta::index::forward_index::valid |
( |
| ) |
const |
|
private |
- Returns
- whether this index contains all necessary files
template<class Index , class... Args>
std::shared_ptr<Index> make_index |
( |
const std::string & |
config_file, |
|
|
Args &&... |
args |
|
) |
| |
|
friend |
forward_index is a friend of the factory method used to create it.
Usage:
auto idx = index::make_index<derived_index_type>(config_path);
- Parameters
-
config_file | The path to the configuration file to be used to build the index |
args | any additional arguments to forward to the constructor for the chosen index type (usually none) |
- Returns
- A properly initialized index
Usage:
auto idx =
cache_type>(config_path, other, options);
Other options will be forwarded to the constructor for the chosen cache class.
- Parameters
-
config_file | the path to the configuration file to be used to build the index. |
args | any additional arguments to forward to the constructor for the cache class chosen |
- Returns
- A properly initialized, and automatically cached, index.
template<class Index , template< class, class > class Cache, class... Args>
std::shared_ptr<cached_index<Index, Cache> > make_index |
( |
const std::string & |
config_file, |
|
|
Args &&... |
args |
|
) |
| |
|
friend |
forward_index is a friend of the factory method used to create cached versions of it.
forward_index is a friend of the factory method used to create it.
Usage:
auto idx = index::make_index<derived_index_type>(config_path);
- Parameters
-
config_file | The path to the configuration file to be used to build the index |
args | any additional arguments to forward to the constructor for the chosen index type (usually none) |
- Returns
- A properly initialized index
forward_index is a friend of the factory method used to create it.
Usage:
auto idx =
cache_type>(config_path, other, options);
Other options will be forwarded to the constructor for the chosen cache class.
- Parameters
-
config_file | the path to the configuration file to be used to build the index. |
args | any additional arguments to forward to the constructor for the cache class chosen |
- Returns
- A properly initialized, and automatically cached, index.
The documentation for this class was generated from the following files: